Code

check_ping's timeout interval is only +1 if ping command has a timeout value.
[nagiosplug.git] / plugins / t / check_ftp.t
1 #! /usr/bin/perl -w -I ..
2 #
3 # File Transfer Protocol (FTP) Test via check_ftp
4 #
5 # $Id$
6 #
8 use strict;
9 use Test;
10 use NPTest;
12 use vars qw($tests);
13 BEGIN {$tests = 4; plan tests => $tests}
15 my $host_tcp_ftp       = getTestParameter( "host_tcp_ftp",       "NP_HOST_TCP_FTP",       "localhost",
16                                            "A host providing the FTP Service (an FTP server)");
18 my $host_nonresponsive = getTestParameter( "host_nonresponsive", "NP_HOST_NONRESPONSIVE", "10.0.0.1",
19                                            "The hostname of system not responsive to network requests" );
21 my $hostname_invalid   = getTestParameter( "hostname_invalid",   "NP_HOSTNAME_INVALID",   "nosuchhost",
22                                            "An invalid (not known to DNS) hostname" );
24 my $successOutput = '/FTP OK -\s+[0-9]?\.?[0-9]+ second response time/';
26 my $t;
28 $t += checkCmd( "./check_ftp $host_tcp_ftp       -wt 300 -ct 600",       0, $successOutput );
29 $t += checkCmd( "./check_ftp $host_nonresponsive -wt 0   -ct 0   -to 1", 2 );
30 $t += checkCmd( "./check_ftp $hostname_invalid   -wt 0   -ct 0",         2 );
32 exit(0) if defined($Test::Harness::VERSION);
33 exit($tests - $t);