diff options
author | tonvoon <ton.voon@opsview.com> | 2010-06-23 14:44:34 +0000 |
---|---|---|
committer | tonvoon <ton.voon@opsview.com> | 2010-06-23 14:44:34 +0000 |
commit | 1252195ed5cdf7b5f5fdc1fd5f2b09827a46f6ce (patch) | |
tree | 17fdee97da603cce596098bc86385165a940d5c0 /plugins/tests/check_http.t | |
parent | 18f6835edaf7d640a2c9e476cb1babdbdadbfd9b (diff) | |
download | monitoring-plugins-1252195ed5cdf7b5f5fdc1fd5f2b09827a46f6ce.tar.gz |
Display missing search string and URL when failed (Duncan Ferguson #2999924)
Diffstat (limited to 'plugins/tests/check_http.t')
-rwxr-xr-x | plugins/tests/check_http.t | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t index 88b77d3b..f03933bd 100755 --- a/plugins/tests/check_http.t +++ b/plugins/tests/check_http.t | |||
@@ -157,7 +157,7 @@ if ($ARGV[0] && $ARGV[0] eq "-d") { | |||
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | my $common_tests = 62; | 160 | my $common_tests = 66; |
161 | my $ssl_only_tests = 6; | 161 | my $ssl_only_tests = 6; |
162 | if (-x "./check_http") { | 162 | if (-x "./check_http") { |
163 | plan tests => $common_tests * 2 + $ssl_only_tests; | 163 | plan tests => $common_tests * 2 + $ssl_only_tests; |
@@ -205,6 +205,14 @@ sub run_common_tests { | |||
205 | is( $result->return_code, 0, "/file/root search for string"); | 205 | is( $result->return_code, 0, "/file/root search for string"); |
206 | like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" ); | 206 | like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" ); |
207 | 207 | ||
208 | $result = NPTest->testCmd( "$command -u /file/root -s NonRoot" ); | ||
209 | is( $result->return_code, 2, "Missing string check"); | ||
210 | like( $result->output, qr%^HTTP CRITICAL: HTTP/1\.1 200 OK - string 'NonRoot' not found on 'https?://127\.0\.0\.1:\d+/file/root'%, "Shows search string and location"); | ||
211 | |||
212 | $result = NPTest->testCmd( "$command -u /file/root -s NonRootWithOver30charsAndMoreFunThanAWetFish" ); | ||
213 | is( $result->return_code, 2, "Missing string check"); | ||
214 | like( $result->output, qr%HTTP CRITICAL: HTTP/1\.1 200 OK - string 'NonRootWithOver30charsAndM...' not found on 'https?://127\.0\.0\.1:\d+/file/root'%, "Shows search string and location"); | ||
215 | |||
208 | 216 | ||
209 | my $cmd; | 217 | my $cmd; |
210 | $cmd = "$command -u /slow"; | 218 | $cmd = "$command -u /slow"; |