diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-02 13:37:39 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-02 13:37:39 +0100 |
| commit | 3faeed07c4825d5c3ceb323e814e703d9262cd82 (patch) | |
| tree | b6a61e24ffa0fbb4af5f145c137f1f584aaba1bc /plugins/tests/check_http.t | |
| parent | 735b04eff721a28e791714c0da4c8ac5726bfbcf (diff) | |
| parent | 6d1d1dac32841d5ca6ee51bb09b30a6c604b17e2 (diff) | |
| download | monitoring-plugins-3faeed07c4825d5c3ceb323e814e703d9262cd82.tar.gz | |
Merge branch 'master' into check_swap_again
Diffstat (limited to 'plugins/tests/check_http.t')
| -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 6078b274..6eaf85b2 100755 --- a/plugins/tests/check_http.t +++ b/plugins/tests/check_http.t | |||
| @@ -13,7 +13,7 @@ use IO::Socket::INET; | |||
| 13 | 13 | ||
| 14 | $ENV{'LC_TIME'} = "C"; | 14 | $ENV{'LC_TIME'} = "C"; |
| 15 | 15 | ||
| 16 | my $common_tests = 71; | 16 | my $common_tests = 73; |
| 17 | my $virtual_port_tests = 8; | 17 | my $virtual_port_tests = 8; |
| 18 | my $ssl_only_tests = 12; | 18 | my $ssl_only_tests = 12; |
| 19 | my $chunked_encoding_special_tests = 1; | 19 | my $chunked_encoding_special_tests = 1; |
| @@ -199,6 +199,11 @@ sub run_server { | |||
| 199 | $c->send_basic_header; | 199 | $c->send_basic_header; |
| 200 | $c->send_crlf; | 200 | $c->send_crlf; |
| 201 | $c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' )); | 201 | $c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' )); |
| 202 | } elsif ($r->url->path eq "/redirect_rel") { | ||
| 203 | $c->send_basic_header(302); | ||
| 204 | $c->send_header("Location", "/redirect2" ); | ||
| 205 | $c->send_crlf; | ||
| 206 | $c->send_response('moved to /redirect2'); | ||
| 202 | } elsif ($r->url->path eq "/redir_timeout") { | 207 | } elsif ($r->url->path eq "/redir_timeout") { |
| 203 | $c->send_redirect( "/timeout" ); | 208 | $c->send_redirect( "/timeout" ); |
| 204 | } elsif ($r->url->path eq "/timeout") { | 209 | } elsif ($r->url->path eq "/timeout") { |
| @@ -515,6 +520,11 @@ sub run_common_tests { | |||
| 515 | is( $result->return_code, 0, $cmd); | 520 | is( $result->return_code, 0, $cmd); |
| 516 | like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); | 521 | like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); |
| 517 | 522 | ||
| 523 | $cmd = "$command -f follow -u /redirect_rel -s redirected"; | ||
| 524 | $result = NPTest->testCmd( $cmd ); | ||
| 525 | is( $result->return_code, 0, $cmd); | ||
| 526 | like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); | ||
| 527 | |||
| 518 | # These tests may block | 528 | # These tests may block |
| 519 | print "ALRM\n"; | 529 | print "ALRM\n"; |
| 520 | 530 | ||
