[nagiosplug] corrected http test

Nagios Plugin Development nagios-plugins at users.sourceforge.net
Thu Aug 15 11:20:16 CEST 2013


 Module: nagiosplug
 Branch: master
 Commit: 2e6a0138de4eb87138372e25f9d895f816c8dd32
 Author: Sven Nierlein <sven at nierlein.de>
   Date: Thu Aug 15 11:10:04 2013 +0200
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=2e6a013

corrected http test

multiple headers have to be set by multiple -k switches. Seperating them
by semicolons is not longer supported as semicolons are valid characters in
http headers.

---

 plugins/t/check_http.t |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index 0a25c77..6299791 100644
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
@@ -8,7 +8,7 @@ use strict;
 use Test::More;
 use NPTest;
 
-plan tests => 28;
+plan tests => 27;
 
 my $successOutput = '/OK.*HTTP.*second/';
 
@@ -45,14 +45,9 @@ cmp_ok( $res->return_code, '==', 0, "Webserver $host_tcp_http responded" );
 like( $res->output, $successOutput, "Output OK" );
 
 $res = NPTest->testCmd(
-	"./check_http $host_tcp_http -wt 300 -ct 600 -v -v -v -k 'bob:there;fred:here'"
+	"./check_http $host_tcp_http -wt 300 -ct 600 -v -v -v -k 'bob:there' -k 'carl:frown'"
 	);
-like( $res->output, '/bob:there\r\nfred:here\r\n/', "Got headers, delimited with ';'" );
-
-$res = NPTest->testCmd(
-	"./check_http $host_tcp_http -wt 300 -ct 600 -v -v -v -k 'bob:there;fred:here' -k 'carl:frown'"
-	);
-like( $res->output, '/bob:there\r\nfred:here\r\ncarl:frown\r\n/', "Got headers with multiple -k options" );
+like( $res->output, '/bob:there\r\ncarl:frown\r\n/', "Got headers with multiple -k options" );
 
 $res = NPTest->testCmd(
 	"./check_http $host_nonresponsive -wt 1 -ct 2"





More information about the Commits mailing list