blob: d86649d9914276567b11ae79a8740ea0bb768b59 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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();
|