diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2008-08-25 13:26:11 (GMT) |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2008-08-25 13:26:11 (GMT) |
commit | bb5ce4be01810300d9dbffc72eb07364dd18e379 (patch) | |
tree | 0dcc85574f62575148fb37e9fc356d24aba32701 | |
parent | c349438e32a99d1d3171bb4cef6c70815c138c45 (diff) | |
download | monitoring-plugins-bb5ce4be01810300d9dbffc72eb07364dd18e379.tar.gz |
Updated with more tests re: multiple status codes (Sven Nierlein)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2047 f882894a-f735-0410-b71e-b25c423dba1c
-rwxr-xr-x | plugins/tests/check_http.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t index e4d770b..a4a45cb 100755 --- a/plugins/tests/check_http.t +++ b/plugins/tests/check_http.t | |||
@@ -60,7 +60,7 @@ if ($ARGV[0] && $ARGV[0] eq "-d") { | |||
60 | } | 60 | } |
61 | 61 | ||
62 | if (-x "./check_http") { | 62 | if (-x "./check_http") { |
63 | plan tests => 15; | 63 | plan tests => 19; |
64 | } else { | 64 | } else { |
65 | plan skip_all => "No check_http compiled"; | 65 | plan skip_all => "No check_http compiled"; |
66 | } | 66 | } |
@@ -106,3 +106,13 @@ $result = NPTest->testCmd( $cmd ); | |||
106 | is( $result->return_code, 0, $cmd); | 106 | is( $result->return_code, 0, $cmd); |
107 | like( $result->output, '/^HTTP OK HTTP/1.1 200 OK - 89 bytes in ([\d\.]+) seconds/', "Output correct: ".$result->output ); | 107 | like( $result->output, '/^HTTP OK HTTP/1.1 200 OK - 89 bytes in ([\d\.]+) seconds/', "Output correct: ".$result->output ); |
108 | 108 | ||
109 | $cmd = "$command -u /statuscode/201 -e 200,201,202"; | ||
110 | $result = NPTest->testCmd( $cmd ); | ||
111 | is( $result->return_code, 0, $cmd); | ||
112 | like( $result->output, '/^HTTP OK HTTP/1.1 201 Created - 94 bytes in ([\d\.]+) seconds/', "Output correct: ".$result->output ); | ||
113 | |||
114 | $cmd = "$command -u /statuscode/203 -e 200,201,202"; | ||
115 | $result = NPTest->testCmd( $cmd ); | ||
116 | is( $result->return_code, 2, $cmd); | ||
117 | 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 ); | ||
118 | |||