hi all...

I've altered include.t to add a test for ETag header supression to follow up on a bug I've reported (patch attached). one of the two new tests fails, exposing the bug.

I have a patch against the old mod_include, but since 2.1 and apr are currently playing catch up, I can't make the change to the new version and test it. if somebody wants to make the change by hand, it's pretty simple and listed here

http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=105120818606501&w=2

in other news, lots of the current include.t tests are failing for me with 2.0 cvs/worker...

  FAILED tests 9, 18, 34-35, 40, 55

of course, the numbers are different without the patch :)

--Geoff
Index: t/modules/include.t
===================================================================
RCS file: /home/cvspublic/httpd-test/perl-framework/t/modules/include.t,v
retrieving revision 1.40
diff -u -r1.40 include.t
--- t/modules/include.t 29 Aug 2003 00:05:32 -0000      1.40
+++ t/modules/include.t 3 Sep 2003 18:27:05 -0000
@@ -109,11 +109,11 @@
 
 #
 # in addition to $tests, there are 1 fsize/flastmod test, 1 GET test,
-# 11 XBitHack tests, 2 exec cgi tests, 2 malformed-ssi-directive tests,
+# 13 XBitHack tests, 2 exec cgi tests, 2 malformed-ssi-directive tests,
 # and 14 tests that use mod_bucketeer to construct brigades for mod_include
 #
 my $tests = scalar(keys %test) + scalar(keys %t_test) + @patterns + 2;
-plan tests => $tests + 31, have_module 'include';
+plan tests => $tests + 33, have_module 'include';
 
 Apache::TestRequest::scheme('http'); #ssl not listening on this vhost
 Apache::TestRequest::module('mod_include'); #use this module's port
@@ -282,10 +282,22 @@
              "XBitHack full [0554] / If-Modified-Since"
             );
 
+    ok t_cmp("No ETag ; <BODY> inc-two.shtml body  </BODY>",
+             check_xbithack_etag(GET("$dir$doc", 'If-Modified-Since' => $lm)),
+             "XBitHack full [0554] / ETag"
+            );
+
     chmod 0544, "htdocs/$dir$doc";
     ok t_cmp(200, GET("$dir$doc", 'If-Modified-Since' => $lm)->code,
              "XBitHack full [0544] / If-Modified-Since"
             );
+
+    chmod 0544, "htdocs/$dir$doc";
+    ok t_cmp("No ETag ; <BODY> inc-two.shtml body  </BODY>",
+             check_xbithack_etag(GET("$dir$doc", 'If-Modified-Since' => $lm)),
+             "XBitHack full [0554] / ETag"
+            );
+
 }
 
 ### test include + query string
@@ -457,4 +469,16 @@
     $$data = $resp->header('Last-Modified') if $data;
 
     "$lastmod ; $body";
+}
+
+sub check_xbithack_etag {
+    my ($resp) = shift;
+    my ($body) = super_chomp($resp->content);
+    my ($etag) = ($resp->header('ETag'))
+                   ? "Has ETag" : "No ETag";
+
+    my $data = shift;
+    $$data = $etag if $data;
+
+    "$etag ; $body";
 }

Reply via email to