[Nagiosplug-checkins] SF.net SVN: nagiosplug:[2047] nagiosplug/trunk/plugins/tests/check_http.t

tonvoon at users.sourceforge.net tonvoon at users.sourceforge.net
Mon Aug 25 15:26:13 CEST 2008


Revision: 2047
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2047&view=rev
Author:   tonvoon
Date:     2008-08-25 13:26:11 +0000 (Mon, 25 Aug 2008)

Log Message:
-----------
Updated with more tests re: multiple status codes (Sven Nierlein)

Modified Paths:
--------------
    nagiosplug/trunk/plugins/tests/check_http.t

Modified: nagiosplug/trunk/plugins/tests/check_http.t
===================================================================
--- nagiosplug/trunk/plugins/tests/check_http.t	2008-08-25 11:42:57 UTC (rev 2046)
+++ nagiosplug/trunk/plugins/tests/check_http.t	2008-08-25 13:26:11 UTC (rev 2047)
@@ -60,7 +60,7 @@
 }
 
 if (-x "./check_http") {
-	plan tests => 15;
+	plan tests => 19;
 } else {
 	plan skip_all => "No check_http compiled";
 }
@@ -106,3 +106,13 @@
 is( $result->return_code, 0, $cmd);
 like( $result->output, '/^HTTP OK HTTP/1.1 200 OK - 89 bytes in ([\d\.]+) seconds/', "Output correct: ".$result->output );
 
+$cmd = "$command -u /statuscode/201 -e 200,201,202";
+$result = NPTest->testCmd( $cmd );
+is( $result->return_code, 0, $cmd);
+like( $result->output, '/^HTTP OK HTTP/1.1 201 Created - 94 bytes in ([\d\.]+) seconds/', "Output correct: ".$result->output );
+
+$cmd = "$command -u /statuscode/203 -e 200,201,202";
+$result = NPTest->testCmd( $cmd );
+is( $result->return_code, 2, $cmd);
+like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port (\d+): HTTP/1.1 203 Non-Authoritative Information/', "Output correct: ".$result->output );
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list