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

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
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.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.