summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c349438)
raw | patch | inline | side by side (parent: c349438)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Mon, 25 Aug 2008 13:26:11 +0000 (13:26 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Mon, 25 Aug 2008 13:26:11 +0000 (13:26 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2047 f882894a-f735-0410-b71e-b25c423dba1c
plugins/tests/check_http.t | patch | blob | history |
index e4d770b345983ae8149c58bb9de69117768a09f4..a4a45cb8f2428c3ebb2005d55a2620b77f205664 100755 (executable)
}
if (-x "./check_http") {
- plan tests => 15;
+ plan tests => 19;
} else {
plan skip_all => "No check_http compiled";
}
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 );
+