summaryrefslogtreecommitdiffstats
path: root/plugins/tests/check_http.t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/tests/check_http.t')
-rwxr-xr-xplugins/tests/check_http.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t
index ea11b2a..132c665 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 = 72;
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,17 @@ 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 $c->send_basic_header;
195 $c->send_header('Transfer-Encoding', "chunked");
196 $c->send_crlf;
197 my $chunks = ["chunked", "encoding", "test\n"];
198 $c->send_response(HTTP::Response->new( 200, 'OK', undef, sub {
199 my $chunk = shift @{$chunks};
200 return unless $chunk;
201 sleep(1);
202 return($chunk);
203 }));
193 } else { 204 } else {
194 $c->send_error(HTTP::Status->RC_FORBIDDEN); 205 $c->send_error(HTTP::Status->RC_FORBIDDEN);
195 } 206 }
@@ -497,4 +508,9 @@ sub run_common_tests {
497 }; 508 };
498 is( $@, "", $cmd ); 509 is( $@, "", $cmd );
499 510
511 $cmd = "$command -u /chunked -s 'chunkedencodingtest'";
512 eval {
513 $result = NPTest->testCmd( $cmd, 5 );
514 };
515 is( $@, "", $cmd );
500} 516}