diff options
Diffstat (limited to 'plugins/tests/check_curl.t')
| -rwxr-xr-x | plugins/tests/check_curl.t | 18 | 
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/tests/check_curl.t b/plugins/tests/check_curl.t index aa72ef67..86bfb538 100755 --- a/plugins/tests/check_curl.t +++ b/plugins/tests/check_curl.t  | |||
| @@ -21,7 +21,7 @@ use FindBin qw($Bin); | |||
| 21 | 21 | ||
| 22 | $ENV{'LC_TIME'} = "C"; | 22 | $ENV{'LC_TIME'} = "C"; | 
| 23 | 23 | ||
| 24 | my $common_tests = 72; | 24 | my $common_tests = 74; | 
| 25 | my $ssl_only_tests = 8; | 25 | my $ssl_only_tests = 8; | 
| 26 | # Check that all dependent modules are available | 26 | # Check that all dependent modules are available | 
| 27 | eval "use HTTP::Daemon 6.01;"; | 27 | eval "use HTTP::Daemon 6.01;"; | 
| @@ -200,6 +200,17 @@ sub run_server { | |||
| 200 | $c->send_basic_header; | 200 | $c->send_basic_header; | 
| 201 | $c->send_crlf; | 201 | $c->send_crlf; | 
| 202 | $c->send_response(HTTP::Response->new( 200, 'OK', undef, $r->header ('Host'))); | 202 | $c->send_response(HTTP::Response->new( 200, 'OK', undef, $r->header ('Host'))); | 
| 203 | } elsif ($r->url->path eq "/chunked") { | ||
| 204 | $c->send_basic_header; | ||
| 205 | $c->send_header('Transfer-Encoding', "chunked"); | ||
| 206 | $c->send_crlf; | ||
| 207 | my $chunks = ["chunked", "encoding", "test\n"]; | ||
| 208 | $c->send_response(HTTP::Response->new( 200, 'OK', undef, sub { | ||
| 209 | my $chunk = shift @{$chunks}; | ||
| 210 | return unless $chunk; | ||
| 211 | sleep(1); | ||
| 212 | return($chunk); | ||
| 213 | })); | ||
| 203 | } else { | 214 | } else { | 
| 204 | $c->send_error(HTTP::Status->RC_FORBIDDEN); | 215 | $c->send_error(HTTP::Status->RC_FORBIDDEN); | 
| 205 | } | 216 | } | 
| @@ -508,4 +519,9 @@ sub run_common_tests { | |||
| 508 | }; | 519 | }; | 
| 509 | is( $@, "", $cmd ); | 520 | is( $@, "", $cmd ); | 
| 510 | 521 | ||
| 522 | $cmd = "$command -u /chunked -s 'chunkedencodingtest'"; | ||
| 523 | eval { | ||
| 524 | $result = NPTest->testCmd( $cmd, 5 ); | ||
| 525 | }; | ||
| 526 | is( $@, "", $cmd ); | ||
| 511 | } | 527 | } | 
