diff options
| author | Holger Weiss <hweiss@users.sourceforge.net> | 2008-08-25 11:42:57 +0000 |
|---|---|---|
| committer | Holger Weiss <hweiss@users.sourceforge.net> | 2008-08-25 11:42:57 +0000 |
| commit | c349438e32a99d1d3171bb4cef6c70815c138c45 (patch) | |
| tree | c966452dcd503dad1909ca6ff86e504db04f57e3 /plugins/tests | |
| parent | e61022df19da2c1b1ab02cd8cc2a6932b4ef9413 (diff) | |
| download | monitoring-plugins-c349438e32a99d1d3171bb4cef6c70815c138c45.tar.gz | |
The "-e" option now accepts a comma-delimited list of expected status
lines (Sven Nierlein - 1894496).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2046 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/tests')
| -rwxr-xr-x | plugins/tests/check_http.t | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t index d5a7c822..e4d770b3 100755 --- a/plugins/tests/check_http.t +++ b/plugins/tests/check_http.t | |||
| @@ -18,6 +18,8 @@ my $pid = fork(); | |||
| 18 | if ($pid) { | 18 | if ($pid) { |
| 19 | # Parent | 19 | # Parent |
| 20 | #print "parent\n"; | 20 | #print "parent\n"; |
| 21 | # give our webserver some time to startup | ||
| 22 | sleep(1); | ||
| 21 | } else { | 23 | } else { |
| 22 | # Child | 24 | # Child |
| 23 | #print "child\n"; | 25 | #print "child\n"; |
| @@ -58,7 +60,7 @@ if ($ARGV[0] && $ARGV[0] eq "-d") { | |||
| 58 | } | 60 | } |
| 59 | 61 | ||
| 60 | if (-x "./check_http") { | 62 | if (-x "./check_http") { |
| 61 | plan tests => 13; | 63 | plan tests => 15; |
| 62 | } else { | 64 | } else { |
| 63 | plan skip_all => "No check_http compiled"; | 65 | plan skip_all => "No check_http compiled"; |
| 64 | } | 66 | } |
| @@ -97,5 +99,10 @@ like( $result->output, '/^HTTP OK HTTP/1.1 201 Created - 94 bytes in ([\d\.]+) s | |||
| 97 | $cmd = "$command -u /statuscode/201 -e 200"; | 99 | $cmd = "$command -u /statuscode/201 -e 200"; |
| 98 | $result = NPTest->testCmd( $cmd ); | 100 | $result = NPTest->testCmd( $cmd ); |
| 99 | is( $result->return_code, 2, $cmd); | 101 | is( $result->return_code, 2, $cmd); |
| 100 | like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port /', "Output correct: ".$result->output ); | 102 | like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port \d+: HTTP/1.1 201 Created/', "Output correct: ".$result->output ); |
| 103 | |||
| 104 | $cmd = "$command -u /statuscode/200 -e 200,201,202"; | ||
| 105 | $result = NPTest->testCmd( $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 ); | ||
| 101 | 108 | ||
