httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1507106 - /httpd/test/framework/trunk/t/modules/deflate.t
Date Thu, 25 Jul 2013 20:01:04 GMT
Author: rjung
Date: Thu Jul 25 20:01:03 2013
New Revision: 1507106

URL: http://svn.apache.org/r1507106
Log:
Try to fix the deflate tests.

One test doesn't work reliably. I commnted it out -
which it was before I commented it in a few weeks ago.

The remaining tests work for me on trunk and 2.4.

Modified:
    httpd/test/framework/trunk/t/modules/deflate.t

Modified: httpd/test/framework/trunk/t/modules/deflate.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/deflate.t?rev=1507106&r1=1507105&r2=1507106&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/deflate.t (original)
+++ httpd/test/framework/trunk/t/modules/deflate.t Thu Jul 25 20:01:03 2013
@@ -21,7 +21,7 @@ my @server_bucketeer_uri = ("/modules/de
                            );
 
 my $cgi_tests = 3;
-my $tests_per_uri = 4;
+my $tests_per_uri = 3;
 my $tests = $tests_per_uri * (@server_deflate_uris + @server_bucketeer_uri) + $cgi_tests;
 my $vars = Apache::Test::vars();
 my $module = 'default';
@@ -54,28 +54,45 @@ for my $server_deflate_uri (@server_defl
     ok $original_str eq $inflated_str;
     my $resp = POST($server_inflate_uri, @inflate_headers,
                     content => "foo123456789012346");
-    if (have_min_apache_version("2.4.5")) {
+    if (have_min_apache_version("2.5")) {
+        ok($resp->code, 400, "did not detect invalid compressed request body for $server_deflate_uri");
+    }
+    elsif (have_min_apache_version("2.4.5")) {
         ok($resp->content, '!!!ERROR!!!', "did not detect invalid compressed request body
for $server_deflate_uri");
     }
     else {
         ok($resp->code, 200, "invalid response for $server_deflate_uri");
     }
     
-    if (have_min_apache_version("2.4.5")) {
-        # The "x 1000" can be removed, once r1502772 is ported back to 2.4.x
-        $resp = POST($server_inflate_uri, @inflate_headers,
-                     content => $deflated_str . ("foobarfoo" x 1000));
-        ok($resp->content, '/.*!!!ERROR!!!$/', "did not detect spurious data after compressed
request body for $server_deflate_uri");
-    }
-    else {
-        ok($resp->code, 200, "invalid response for $server_deflate_uri");
-    }
+    # Disabled because not working reliably.
+    # If the compressed data it big enough, a partial response
+    # will get flushed to the client before the trailing spurious data
+    # is found.
+    #
+    #if (have_min_apache_version("2.5")) {
+    #    $resp = POST($server_inflate_uri, @inflate_headers,
+    #                 content => $deflated_str . "foobarfoo");
+    #    ok($resp->code, 400, "did not detect spurious data after compressed request body
for $server_deflate_uri");
+    #}
+    #elsif (have_min_apache_version("2.4.5")) {
+    #    # The "x 1000" can be removed, once r1502772 is ported back to 2.4.x
+    #    $resp = POST($server_inflate_uri, @inflate_headers,
+    #                 content => $deflated_str . ("foobarfoo" x 1000));
+    #    ok($resp->content, '/.*!!!ERROR!!!$/', "did not detect spurious data after compressed
request body for $server_deflate_uri");
+    #}
+    #else {
+    #    ok($resp->code, 200, "invalid response for $server_deflate_uri");
+    #}
 
     my $broken = $deflated_str;
-    substr($broken, -15, 15, "123456789012345");
+    my $offset = (length($broken) > 35) ? 20 : -15;
+    substr($broken, $offset, 15, "123456789012345");
     $resp = POST($server_inflate_uri, @inflate_headers,
                   content => $broken);
-    if (have_min_apache_version("2.4.5")) {
+    if (have_min_apache_version("2.5")) {
+        ok($resp->code, 400, "did not detect broken compressed request body for $server_deflate_uri");
+    }
+    elsif (have_min_apache_version("2.4.5")) {
         ok($resp->content, '/.*!!!ERROR!!!$/', "did not detect broken compressed request
body for $server_deflate_uri");
     }
     else {



Mime
View raw message