You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by jw...@apache.org on 2002/04/05 09:27:29 UTC
cvs commit: httpd-test/perl-framework/t/htdocs/modules/include/bucketeer y.shtml y0.shtml y1.shtml y2.shtml y3.shtml y4.shtml
jwoolley 02/04/04 23:27:29
Modified: perl-framework/t/conf extra.conf.in
perl-framework/t/modules include.t
Added: perl-framework/t/htdocs/modules/include/bucketeer y.shtml
y0.shtml y1.shtml y2.shtml y3.shtml y4.shtml
Log:
Added a bunch of tests that use mod_bucketeer to find edge cases in
mod_include. Many thanks to Ian Holsman for providing the groundwork
for this.
Revision Changes Path
1.35 +12 -5 httpd-test/perl-framework/t/conf/extra.conf.in
Index: extra.conf.in
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/conf/extra.conf.in,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -u -r1.34 -r1.35
--- extra.conf.in 5 Feb 2002 09:08:41 -0000 1.34
+++ extra.conf.in 5 Apr 2002 07:27:28 -0000 1.35
@@ -142,15 +142,13 @@
<IfModule mod_include.c>
+ AddType text/html .shtml
+
<IfDefine APACHE1>
- AddType text/html .shtml
AddHandler server-parsed .shtml
</IfDefine>
-
<IfDefine APACHE2>
- <Files ~ *.shtml>
- SetOutputFilter INCLUDES
- </Files>
+ AddOutputFilter INCLUDES .shtml
</IfDefine>
<Directory @SERVERROOT@/htdocs/modules/include>
@@ -170,6 +168,15 @@
<Directory @SERVERROOT@/htdocs/modules/include/exec/on>
Options Includes
</Directory>
+
+ <IfDefine APACHE2>
+ <IfModule mod_bucketeer.c>
+ <Directory @SERVERROOT@/htdocs/modules/include/bucketeer>
+ SetOutputFilter BUCKETEER
+ </Directory>
+ </IfModule>
+ </IfDefine>
+
</IfModule>
##
1.17 +69 -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.16
retrieving revision 1.17
diff -u -d -u -r1.16 -r1.17
--- include.t 29 Mar 2002 07:10:33 -0000 1.16
+++ include.t 5 Apr 2002 07:27:29 -0000 1.17
@@ -11,6 +11,9 @@
my ($doc);
my $dir = "/modules/include/";
my $have_apache_2 = have_apache 2;
+my $vars = Apache::Test::vars();
+my $docroot = $vars->{documentroot};
+
my %test = (
"echo.shtml" => "echo.shtml",
@@ -63,10 +66,11 @@
#
# in addition to $tests, there are 1 GET test, 9 XBitHack tests,
-# 2 exec cgi tests, and 2 malformed-ssi-directive tests
+# 2 exec cgi tests, 2 malformed-ssi-directive tests, and 6 tests
+# that use mod_bucketeer to construct brigades for mod_include
#
my $tests = keys %test;
-plan tests => $tests + 14, have_module 'include';
+plan tests => $tests + 20, have_module 'include';
foreach $doc (sort keys %test) {
ok t_cmp($test{$doc},
@@ -181,6 +185,69 @@
"XBitHack full [0554]"
);
+
+### MOD_BUCKETEER+MOD_INCLUDE TESTS
+# we can use mod_bucketeer to create edge conditions for mod_include, since
+# it allows us to create bucket and brigade boundaries wherever we want
+if (have_module 'mod_bucketeer') {
+
+ $expected = "____ _____ _____ ___________________ </table> ".
+ "##################################1/8</tr> ".
+ "##################################2/8</tr> ".
+ "##################################3/8</tr> ".
+ "##################################4/8</tr> ".
+ "##################################5/8</tr> ".
+ "##################################6/8$docroot</tr> ".
+ "##################################7/8</tr> ".
+ "##################################8/8</tr> ".
+ "@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@";
+
+ $doc = "bucketeer/y.shtml";
+ ok t_cmp($expected,
+ super_chomp(GET_BODY "$dir$doc"),
+ "GET $dir$doc"
+ );
+
+ $expected = "____ ___________________________________".
+ "________________________________________".
+ "___ ____________________________________".
+ "________________________________________".
+ "__________ ___________________ </table> ".
+ "#####################################</tr> ".
+ "#####################################</tr> ".
+ "#####################################</tr> ".
+ "#####################################</tr> ".
+ "#####################################</tr> ".
+ "#####################################</tr> ".
+ "#####################################</tr> ".
+ "#####################################</tr> ".
+ "@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@";
+
+ for (0..3) {
+ $doc = "bucketeer/y$_.shtml";
+ my ($body) = super_chomp(GET_BODY "$dir$doc");
+ $body =~ s/\002/^B/g;
+ $body =~ s/\006/^F/g;
+ $body =~ s/\020/^P/g;
+ ok t_cmp($expected,
+ $body,
+ "GET $dir$doc"
+ );
+ }
+
+ $expected = "[an error occurred while processing this directive]";
+ $doc = "bucketeer/y4.shtml";
+ ok t_cmp($expected,
+ super_chomp(GET_BODY "$dir$doc"),
+ "GET $dir$doc"
+ );
+
+}
+else {
+ for (1..6) {
+ skip "Skipping bucket boundary tests, no mod_bucketeer", 1;
+ }
+}
sub super_chomp {
my ($body) = shift;
1.1 httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/y.shtml
Index: y.shtml
===================================================================
____
_____
_____
___________________
</table>
##################################1/8</tr>
##################################2/8</tr>
##################################3/8</tr>
##################################4/8</tr>
##################################5/8</tr>
##################################6/8<!--#echo var="DOCUMENT_ROOT" --></tr>
##################################7/8</tr>
##################################8/8</tr>
@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@
1.1 httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/y0.shtml
Index: y0.shtml
===================================================================
____
______________________________________________________________________________
______________________________________________________________________________________
___________________
</table>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@
1.1 httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/y1.shtml
Index: y1.shtml
===================================================================
____
______________________________________________________________________________
______________________________________________________________________________________
___________________
</table>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@
1.1 httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/y2.shtml
Index: y2.shtml
===================================================================
____
______________________________________________________________________________
______________________________________________________________________________________
___________________
</table>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
#####################################</tr>
@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@
1.1 httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/y3.shtml
<<Binary file>>
1.1 httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/y4.shtml
<<Binary file>>