[Nagiosplug-checkins] nagiosplug/plugins/t check_tcp.t,1.3,1.4

Thomas Guyot dermoth at users.sourceforge.net
Tue Jan 30 06:01:02 CET 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv10826/plugins/t

Modified Files:
	check_tcp.t 
Log Message:
Fix reporting bug using expect, affecting (not fixing) Debian bug #392610: check_jabber always return warning


Index: check_tcp.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_tcp.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- check_tcp.t	25 Jul 2005 01:47:15 -0000	1.3
+++ check_tcp.t	30 Jan 2007 05:01:00 -0000	1.4
@@ -10,7 +10,7 @@
 use NPTest;
 
 use vars qw($tests);
-BEGIN {$tests = 5; plan tests => $tests}
+BEGIN {$tests = 7; plan tests => $tests}
 
 my $host_tcp_http      = getTestParameter( "host_tcp_http",      "NP_HOST_TCP_HTTP",      "localhost",
 					   "A host providing the HTTP Service (a web server)" );
@@ -23,12 +23,15 @@
 
 my $successOutput = '/^TCP OK\s-\s+[0-9]?\.?[0-9]+ second response time on port [0-9]+/';
 
+my $failedExpect = '/^TCP WARNING\s-\sUnexpected response from host/socket on port [0-9]+/';
+
 my $t;
 
 $t += checkCmd( "./check_tcp $host_tcp_http      -p 80 -wt 300 -ct 600",       0, $successOutput );
 $t += checkCmd( "./check_tcp $host_tcp_http      -p 81 -wt   0 -ct   0 -to 1", 2 ); # use invalid port for this test
 $t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -wt   0 -ct   0 -to 1", 2 );
 $t += checkCmd( "./check_tcp $hostname_invalid   -p 80 -wt   0 -ct   0 -to 1", 2 );
+$t += checkCmd( "./check_tcp $host_tcp_http      -p 80 -s 'GET /\n' -e 'ThisShouldntMatch' -j", 1, $failedExpect );
 
 exit(0) if defined($Test::Harness::VERSION);
 exit($tests - $t);





More information about the Commits mailing list