diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-04-16 14:53:32 (GMT) |
---|---|---|
committer | Sven Nierlein <sven@nierlein.de> | 2018-10-22 14:30:31 (GMT) |
commit | 54c8f76c72ce73a9e0e23dbce26d09aa15e002ad (patch) | |
tree | 1df96ac98157082ec88e34d3a9922250b261ee7a /plugins/tests | |
parent | 3c681a2ec5b8329e53bf5cdba9e60e3fb4a0aaee (diff) | |
download | monitoring-plugins-54c8f76c72ce73a9e0e23dbce26d09aa15e002ad.tar.gz |
fixed test outputs for status line checks
handling empty data in POST and PUT
handling data upload (from -P <postdata>) also in PUT
Diffstat (limited to 'plugins/tests')
-rwxr-xr-x | plugins/tests/check_curl.t | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/tests/check_curl.t b/plugins/tests/check_curl.t index dd56706..702edb8 100755 --- a/plugins/tests/check_curl.t +++ b/plugins/tests/check_curl.t | |||
@@ -257,7 +257,7 @@ sub run_common_tests { | |||
257 | $cmd = "$command -u /statuscode/200 -e 200"; | 257 | $cmd = "$command -u /statuscode/200 -e 200"; |
258 | $result = NPTest->testCmd( $cmd ); | 258 | $result = NPTest->testCmd( $cmd ); |
259 | is( $result->return_code, 0, $cmd); | 259 | is( $result->return_code, 0, $cmd); |
260 | like( $result->output, '/^HTTP OK: Status line output matched "200" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); | 260 | like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - Status line output matched "200" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); |
261 | 261 | ||
262 | $cmd = "$command -u /statuscode/201"; | 262 | $cmd = "$command -u /statuscode/201"; |
263 | $result = NPTest->testCmd( $cmd ); | 263 | $result = NPTest->testCmd( $cmd ); |
@@ -267,7 +267,7 @@ sub run_common_tests { | |||
267 | $cmd = "$command -u /statuscode/201 -e 201"; | 267 | $cmd = "$command -u /statuscode/201 -e 201"; |
268 | $result = NPTest->testCmd( $cmd ); | 268 | $result = NPTest->testCmd( $cmd ); |
269 | is( $result->return_code, 0, $cmd); | 269 | is( $result->return_code, 0, $cmd); |
270 | like( $result->output, '/^HTTP OK: Status line output matched "201" - \d+ bytes in [\d\.]+ second /', "Output correct: ".$result->output ); | 270 | like( $result->output, '/^HTTP OK: HTTP/1.1 201 Created - Status line output matched "201" - \d+ bytes in [\d\.]+ second /', "Output correct: ".$result->output ); |
271 | 271 | ||
272 | $cmd = "$command -u /statuscode/201 -e 200"; | 272 | $cmd = "$command -u /statuscode/201 -e 200"; |
273 | $result = NPTest->testCmd( $cmd ); | 273 | $result = NPTest->testCmd( $cmd ); |
@@ -277,12 +277,12 @@ sub run_common_tests { | |||
277 | $cmd = "$command -u /statuscode/200 -e 200,201,202"; | 277 | $cmd = "$command -u /statuscode/200 -e 200,201,202"; |
278 | $result = NPTest->testCmd( $cmd ); | 278 | $result = NPTest->testCmd( $cmd ); |
279 | is( $result->return_code, 0, $cmd); | 279 | is( $result->return_code, 0, $cmd); |
280 | like( $result->output, '/^HTTP OK: Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); | 280 | like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); |
281 | 281 | ||
282 | $cmd = "$command -u /statuscode/201 -e 200,201,202"; | 282 | $cmd = "$command -u /statuscode/201 -e 200,201,202"; |
283 | $result = NPTest->testCmd( $cmd ); | 283 | $result = NPTest->testCmd( $cmd ); |
284 | is( $result->return_code, 0, $cmd); | 284 | is( $result->return_code, 0, $cmd); |
285 | like( $result->output, '/^HTTP OK: Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); | 285 | like( $result->output, '/^HTTP OK: HTTP/1.1 201 Created - Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); |
286 | 286 | ||
287 | $cmd = "$command -u /statuscode/203 -e 200,201,202"; | 287 | $cmd = "$command -u /statuscode/203 -e 200,201,202"; |
288 | $result = NPTest->testCmd( $cmd ); | 288 | $result = NPTest->testCmd( $cmd ); |