summaryrefslogtreecommitdiffstats
path: root/plugins/tests/check_http.t
diff options
context:
space:
mode:
authorLorenz <12514511+RincewindsHat@users.noreply.github.com>2023-01-09 16:55:10 +0100
committerGitHub <noreply@github.com>2023-01-09 16:55:10 +0100
commite0ada6f11a82ed6119836482b84c8ba5df491d8f (patch)
tree6ddcd5f7850169d82d88dca56a2e5c0dbda08b4e /plugins/tests/check_http.t
parentc389aa4f918aab5cf181aa2cb9dec68b3bf34d4f (diff)
parent0899e41f5075d661153eb2c77ace1734a8f66bfa (diff)
downloadmonitoring-plugins-e0ada6f.tar.gz
Merge branch 'master' into rename_output_to_cmd_output
Diffstat (limited to 'plugins/tests/check_http.t')
-rwxr-xr-xplugins/tests/check_http.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t
index ea11b2ac..d766ac37 100755
--- a/plugins/tests/check_http.t
+++ b/plugins/tests/check_http.t
@@ -12,7 +12,7 @@ use FindBin qw($Bin);
12 12
13$ENV{'LC_TIME'} = "C"; 13$ENV{'LC_TIME'} = "C";
14 14
15my $common_tests = 70; 15my $common_tests = 71;
16my $virtual_port_tests = 8; 16my $virtual_port_tests = 8;
17my $ssl_only_tests = 12; 17my $ssl_only_tests = 12;
18# Check that all dependent modules are available 18# Check that all dependent modules are available
@@ -190,6 +190,14 @@ sub run_server {
190 $c->send_basic_header; 190 $c->send_basic_header;
191 $c->send_crlf; 191 $c->send_crlf;
192 $c->send_response(HTTP::Response->new( 200, 'OK', undef, $r->header ('Host'))); 192 $c->send_response(HTTP::Response->new( 200, 'OK', undef, $r->header ('Host')));
193 } elsif ($r->url->path eq "/chunked") {
194 my $chunks = ["chunked", "encoding", "test\n"];
195 $c->send_response(HTTP::Response->new( 200, 'OK', undef, sub {
196 my $chunk = shift @{$chunks};
197 return unless $chunk;
198 sleep(1);
199 return($chunk);
200 }));
193 } else { 201 } else {
194 $c->send_error(HTTP::Status->RC_FORBIDDEN); 202 $c->send_error(HTTP::Status->RC_FORBIDDEN);
195 } 203 }
@@ -497,4 +505,9 @@ sub run_common_tests {
497 }; 505 };
498 is( $@, "", $cmd ); 506 is( $@, "", $cmd );
499 507
508 $cmd = "$command -u /chunked -s 'chunkedencodingtest' -d 'Transfer-Encoding: chunked'";
509 eval {
510 $result = NPTest->testCmd( $cmd, 5 );
511 };
512 is( $@, "", $cmd );
500} 513}