From 512a73ef7e40be5ec95604bd7a7a41455008f84a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 12 Apr 2024 10:32:35 +0200 Subject: Merging debian version 2.4.59-1. Signed-off-by: Daniel Baumann --- debian/perl-framework/t/modules/sed.t | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'debian/perl-framework/t/modules/sed.t') diff --git a/debian/perl-framework/t/modules/sed.t b/debian/perl-framework/t/modules/sed.t index 10edcd7..6ab1ee1 100644 --- a/debian/perl-framework/t/modules/sed.t +++ b/debian/perl-framework/t/modules/sed.t @@ -7,20 +7,42 @@ use Apache::TestUtil; my @ts = ( # see t/conf/extra.conf.in - { url => "/apache/sed/out-foo/foobar.html", content => 'barbar', msg => "sed output filter", code => 200 } + { url => "/apache/sed/out-foo/foobar.html", content => 'barbar', msg => "sed output filter", code => '200' }, + # error after status sent + { url => "/apache/sed-echo/out-foo-grow/foobar.html", content => "", msg => "sed output filter too large", code => '200', body=>"foo" x (8192*1024), resplen=>0}, + { url => "/apache/sed-echo/input", content => 'barbar', msg => "sed input filter", code => '200', body=>"foobar" }, + { url => "/apache/sed-echo/input", content => undef, msg => "sed input filter", code => '200', body=>"foo" x (1024)}, + # fixme: returns 400 default error doc for some people instead + # { url => "/apache/sed-echo/input", content => '!!!ERROR!!!', msg => "sed input filter", code => '200', skippable=>true body=>"foo" x (1024*4096)} ); my $tests = 2*scalar @ts; -plan tests => $tests, need_module('sed'); +plan tests => $tests, need 'LWP::Protocol::AnyEvent::http', need_module('sed'); +# Hack to allow streaming of data in/out of mod_echo +require LWP::Protocol::AnyEvent::http; for my $t (@ts) { - my $req = GET $t->{'url'}; + my $req; + if (defined($t->{'body'})) { + t_debug "posting body of size ". length($t->{'body'}); + $req = POST $t->{'url'}, content => $t->{'body'}; + t_debug "... posted body of size ". length($t->{'body'}); + } + else { + $req = GET $t->{'url'}; + } + t_debug "Content Length " . length $req->content; ok t_cmp($req->code, $t->{'code'}, "status code for " . $t->{'url'}); - my $content = $req->content; - chomp($content); - ok t_cmp($content, $t->{content}, $t->{msg}); + if (defined($t->{content})) { + my $content = $req->content; + chomp($content); + ok t_cmp($content, $t->{content}, $t->{msg}); + } + else { + ok "no body check"; + } } -- cgit v1.2.3