diff options
Diffstat (limited to 't/01-ssh-from-dev.t')
| -rwxr-xr-x | t/01-ssh-from-dev.t | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/01-ssh-from-dev.t b/t/01-ssh-from-dev.t new file mode 100755 index 0000000..d86649d --- /dev/null +++ b/t/01-ssh-from-dev.t @@ -0,0 +1,36 @@ +#!/usr/bin/env perl +# -*- mode: perl-ts; -*- + +use 5.32.0; +use strict; +use warnings; + +use FindBin; +use lib "${FindBin::Bin}/lib"; +use Test2::V0; +use FAPG::TestSupport qw(@HOSTS); +use Net::SSH::Perl; + +foreach my $h (@HOSTS) { + my ( $out, $err, $exit ); + my $timeout = 5; + + my $ok = eval { + local $SIG{ALRM} = sub { die "SSH timeout after $timeout seconds.\n" }; + alarm $timeout; + + my $ssh = Net::SSH::Perl->new( $h->{hostname}); + $ssh->login( $h->{user}, $h->{password} ); + ( $out, $err, $exit ) = $ssh->cmd('true'); + + 1; + }; + + alarm 0; + + ok $ok, "host $h->{hostname} can be reached via ssh"; + diag $@ if $@; + +} + +done_testing(); |