Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 51D6C10F6C for ; Sat, 13 Jul 2013 11:22:08 +0000 (UTC) Received: (qmail 71110 invoked by uid 500); 13 Jul 2013 11:22:07 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 71026 invoked by uid 500); 13 Jul 2013 11:22:06 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 71017 invoked by uid 99); 13 Jul 2013 11:22:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Jul 2013 11:22:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Jul 2013 11:22:03 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E967823889DA; Sat, 13 Jul 2013 11:21:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1502775 - /httpd/test/framework/trunk/t/modules/deflate.t Date: Sat, 13 Jul 2013 11:21:41 -0000 To: cvs@httpd.apache.org From: rjung@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130713112141.E967823889DA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rjung Date: Sat Jul 13 11:21:41 2013 New Revision: 1502775 URL: http://svn.apache.org/r1502775 Log: Fix some test cases: mod_echo_post does not return an error if the deflate filter errs, instead it adds "!!!ERROR!!!" to the response. The test for trailing garbage failed even earlier, because mod_deflate didn't detect trailing garbage if it was in the same bucket that contained the end of the deflated part of the body. See r1502772. 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=1502775&r1=1502774&r2=1502775&view=diff ============================================================================== --- httpd/test/framework/trunk/t/modules/deflate.t (original) +++ httpd/test/framework/trunk/t/modules/deflate.t Sat Jul 13 11:21:41 2013 @@ -21,7 +21,7 @@ my @server_bucketeer_uri = ("/modules/de ); my $cgi_tests = 3; -my $tests_per_uri = 3; +my $tests_per_uri = 4; my $tests = $tests_per_uri * (@server_deflate_uris + @server_bucketeer_uri) + $cgi_tests; my $vars = Apache::Test::vars(); my $module = 'default'; @@ -54,33 +54,32 @@ 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.5.0")) { - ok($resp->code, 400, "did not detect invalid compressed body for $server_deflate_uri"); + if (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"); } - # XXX This does not seem to work, does zlib ignore trailing garbage? - #$resp = POST($server_inflate_uri, @inflate_headers, - # content => $deflated_str . "foobarfoo"); - #ok($resp->code, 400, "did not detect spurious data after compressed body 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"); + } my $broken = $deflated_str; substr($broken, -15, 15, "123456789012345"); $resp = POST($server_inflate_uri, @inflate_headers, - content => $deflated_str); - if ($original_str eq $resp->content) { - # did not break compressed stream enough, but ok - ok 1; + content => $broken); + if (have_min_apache_version("2.4.5")) { + ok($resp->content, '/.*!!!ERROR!!!$/', "did not detect broken compressed request body for $server_deflate_uri"); } else { - if (have_min_apache_version("2.5.0")) { - ok($resp->code, 400, "did not detect broken compressed body for $server_deflate_uri"); - } - else { - ok($resp->code, 200, "invalid response for $server_deflate_uri"); - } + ok($resp->code, 200, "invalid response for $server_deflate_uri"); } }