From 1252195ed5cdf7b5f5fdc1fd5f2b09827a46f6ce Mon Sep 17 00:00:00 2001 From: tonvoon Date: Wed, 23 Jun 2010 14:44:34 +0000 Subject: Display missing search string and URL when failed (Duncan Ferguson #2999924) --- plugins/tests/check_http.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/tests/check_http.t') 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") { } } -my $common_tests = 62; +my $common_tests = 66; my $ssl_only_tests = 6; if (-x "./check_http") { plan tests => $common_tests * 2 + $ssl_only_tests; @@ -205,6 +205,14 @@ sub run_common_tests { is( $result->return_code, 0, "/file/root search for string"); like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" ); + $result = NPTest->testCmd( "$command -u /file/root -s NonRoot" ); + is( $result->return_code, 2, "Missing string check"); + 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"); + + $result = NPTest->testCmd( "$command -u /file/root -s NonRootWithOver30charsAndMoreFunThanAWetFish" ); + is( $result->return_code, 2, "Missing string check"); + 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"); + my $cmd; $cmd = "$command -u /slow"; -- cgit v1.2.3