1 #! /usr/bin/perl -w -I ..
3 # File Transfer Protocol (FTP) Test via check_ftp
12 BEGIN {$tests = 4; plan tests => $tests}
14 my $host_tcp_ftp = getTestParameter("NP_HOST_TCP_FTP", "A host providing the FTP Service (an FTP server)", "localhost");
15 my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
16 my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
18 my $successOutput = '/FTP OK -\s+[0-9]?\.?[0-9]+ second response time/';
22 $t += checkCmd( "./check_ftp $host_tcp_ftp -wt 300 -ct 600", 0, $successOutput );
23 $t += checkCmd( "./check_ftp $host_nonresponsive -wt 0 -ct 0 -to 1", 2 );
24 $t += checkCmd( "./check_ftp $hostname_invalid -wt 0 -ct 0", 2 );
26 exit(0) if defined($Test::Harness::VERSION);