httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r1774142 - /httpd/test/framework/trunk/t/modules/ext_filter.t
Date Wed, 14 Dec 2016 08:48:58 GMT
Author: jorton
Date: Wed Dec 14 08:48:58 2016
New Revision: 1774142

URL: http://svn.apache.org/viewvc?rev=1774142&view=rev
Log:
Skip tests on platform without /usr/bin/sed, cope with sed which adds
a trailing newline.

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

Modified: httpd/test/framework/trunk/t/modules/ext_filter.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/ext_filter.t?rev=1774142&r1=1774141&r2=1774142&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/ext_filter.t (original)
+++ httpd/test/framework/trunk/t/modules/ext_filter.t Wed Dec 14 08:48:58 2016
@@ -8,24 +8,30 @@ use Apache::TestUtil;
 Apache::TestRequest::user_agent(keep_alive => 1);
 
 my $iters = 10;
-my $tests = 3 + $iters * 2;
+my $tests = 4 + $iters * 2;
 
-plan tests => $tests, need need_module('ext_filter');
+plan tests => $tests, need 
+    need_module('ext_filter'), need_cgi;
 
-if (Apache::TestConfig::WINFU()) {
-    skip "Unix-only test" foreach 1..$tests;
+if (Apache::TestConfig::WINFU() || ! -x "/usr/bin/sed") {
+    skip "needs Unix and executable /usr/bin/sed" foreach 1..$tests;
 }
 
-ok t_cmp(GET_BODY("/apache/extfilter/out-foo/foobar.html"), "barbar", "sed output filter");
-
-my $r = POST "/apache/extfilter/in-foo/modules/cgi/perl_echo.pl", content => "foobar";
+my $content = GET_BODY("/apache/extfilter/out-foo/foobar.html");
+chomp $content;
+ok t_cmp($content, "barbar", "sed output filter");
+
+$content = GET_BODY("/apache/extfilter/out-slow/foobar.html");
+chomp $content;    
+ok t_cmp($content, "foobar", "slow filter process");
 
+my $r = POST "/apache/extfilter/in-foo/modules/cgi/perl_echo.pl", content => "foobar\n";
 ok t_cmp($r->code, 200, "echo worked");
-ok t_cmp($r->content, "barbar", "request body filtered");
+ok t_cmp($r->content, "barbar\n", "request body filtered");
 
 # PR 60375 -- appears to be intermittent failure with 2.4.x ... but works with trunk?
 foreach (1..$iters) {
-    $r = POST "/apache/extfilter/out-limit/modules/cgi/perl_echo.pl", content => "foo
and bar";
+    $r = POST "/apache/extfilter/out-limit/modules/cgi/perl_echo.pl", content => "foo
and bar\n";
     
     ok t_cmp($r->code, 413, "got 413 error");
     ok t_cmp($r->content, qr/413 Request Entity Too Large/, "got 413 error body");



Mime
View raw message