jorton 2004/09/24 02:43:24
Modified: perl-framework/t/htdocs/modules/cgi .cvsignore
perl-framework/t/modules include.t
Added: perl-framework/t/htdocs/modules/cgi big.pl.PL
perl-framework/t/htdocs/modules/include ranged-virtual.shtml
Log:
Add regression test for PR 31247.
Revision Changes Path
1.8 +1 -0 httpd-test/perl-framework/t/htdocs/modules/cgi/.cvsignore
Index: .cvsignore
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/t/htdocs/modules/cgi/.cvsignore,v
retrieving revision 1.7
retrieving revision 1.8
diff -d -w -u -r1.7 -r1.8
--- .cvsignore 17 Aug 2004 16:13:36 -0000 1.7
+++ .cvsignore 24 Sep 2004 09:43:24 -0000 1.8
@@ -10,3 +10,4 @@
nph-stderr.pl
ranged.pl
nph-foldhdr.pl
+big.pl
1.1 httpd-test/perl-framework/t/htdocs/modules/cgi/big.pl.PL
Index: big.pl.PL
===================================================================
# This is a regression test for PR 31247.
# By sleeping, it ensures that the CGI bucket is left in the brigade
# (the first 8K will be morphed into a HEAP bucket), and hence *must*
# be setaside correctly when the byterange filter calls
# ap_save_brigade().
# Without the fix for PR 31247, the STDOUT content does not get
# consumed as expected, so the server will deadlock as it tries to
# consume STDERR after script execution in mod_cgi, whilst the script
# tries to write to STDOUT. So close STDERR to avoid that.
close STDERR;
print "Content-type: text/plain\n\n";
print "x"x8192;
sleep 1;
print "x"x8192;
1.1
httpd-test/perl-framework/t/htdocs/modules/include/ranged-virtual.shtml
Index: ranged-virtual.shtml
===================================================================
<!--#include virtual="/modules/cgi/big.pl" --><!--#include
virtual="/modules/cgi/big.pl" -->
1.51 +19 -2 httpd-test/perl-framework/t/modules/include.t
Index: include.t
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/modules/include.t,v
retrieving revision 1.50
retrieving revision 1.51
diff -d -w -u -r1.50 -r1.51
--- include.t 24 Sep 2004 09:23:28 -0000 1.50
+++ include.t 24 Sep 2004 09:43:24 -0000 1.51
@@ -90,6 +90,7 @@
"exec/off/cgi.shtml" => "[an error occurred while processing this ".
"directive]",
"exec/on/cgi.shtml" => "perl cgi",
+"ranged-virtual.shtml" => "x"x32768,
);
# now, assuming 2.1 has the proper behavior across the board,
@@ -146,6 +147,11 @@
# $test{"errmsg5.shtml"} = delete $todo{"errmsg5.shtml"};
}
+if ($have_apache_20) {
+ # this test doesn't work in 2.0 yet but should work in 1.3 and 2.1
+ delete $test{"ranged-virtual.shtml"};
+}
+
unless ($have_apache_21) {
# apache 1.3 and 2.0 do not support these tests
delete $test{"echo2.shtml"};
@@ -215,6 +221,17 @@
"GET $dir$doc"
);
}
+ elsif ($doc =~ m/ranged/) {
+ if (have_cgi) {
+ ok t_cmp(GET_BODY("$dir$doc", Range => "bytes=0-"),
+ $tests{$doc},
+ "GET $dir$doc with Range"
+ );
+ }
+ else {
+ skip "Skipping virtual-range test; no cgi module", 1;
+ }
+ }
elsif ($doc =~ m/cgi/) {
if (have_cgi) {
ok t_cmp(super_chomp(GET_BODY "$dir$doc"),
@@ -325,7 +342,7 @@
ok $str;
for my $pat (@patterns) {
- ok t_cmp($str, qr{$pat}, "/$pat/");
+ ok t_cmp($str, qr/$pat/, "/$pat/");
}
### MOD_BUCKETEER+MOD_INCLUDE TESTS