You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2018/08/20 19:57:42 UTC

svn commit: r1838481 - in /httpd/test/framework/trunk/t: conf/extra.conf.in modules/ratelimit.t

Author: covener
Date: Mon Aug 20 19:57:42 2018
New Revision: 1838481

URL: http://svn.apache.org/viewvc?rev=1838481&view=rev
Log:
tweak ratelimit test to fail on 2.4.x


Modified:
    httpd/test/framework/trunk/t/conf/extra.conf.in
    httpd/test/framework/trunk/t/modules/ratelimit.t

Modified: httpd/test/framework/trunk/t/conf/extra.conf.in
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/extra.conf.in?rev=1838481&r1=1838480&r2=1838481&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Mon Aug 20 19:57:42 2018
@@ -1217,13 +1217,16 @@ LimitRequestFields    32
 
 <IfModule mod_ratelimit.c>
    AliasMatch ^/apache/ratelimit/autoindex/$ @SERVERROOT@/htdocs/
-   AliasMatch ^/apache/ratelimit/ @SERVERROOT@/htdocs/index.html
+   AliasMatch ^/apache/ratelimit/$ @SERVERROOT@/htdocs/index.html
    <Location /apache/ratelimit/>
        Options +Indexes
        SetOutputFilter RATE_LIMIT
        <IfModule mod_env.c>
-           SetEnv rate-limit 400 
+           SetEnv rate-limit 1024
            SetEnv rate-initial-burst 512
        </IfModule>
    </Location>
+   <Location /apache/ratelimit/chunk>
+      SetHandler random_chunk
+   </Location>
 </IfModule>

Modified: httpd/test/framework/trunk/t/modules/ratelimit.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/ratelimit.t?rev=1838481&r1=1838480&r2=1838481&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/ratelimit.t (original)
+++ httpd/test/framework/trunk/t/modules/ratelimit.t Mon Aug 20 19:57:42 2018
@@ -9,19 +9,27 @@ use Data::Dumper;
 use HTTP::Response;
 use Socket;
 
+use LWP::UserAgent ();
+ 
+
 my @testcases = (
-    ['/apache/ratelimit/'           => '200'],
-    ['/apache/ratelimit/autoindex/' => '200'],
+    ['/apache/ratelimit/'                    => '200', "ratelimited small file"],
+    ['/apache/ratelimit/autoindex/'          => '200', "ratelimited small autoindex output"],
+    ['/apache/ratelimit/chunk?0,8192'        => '200', "ratelimited chunked response"],
 );
 
-plan tests => scalar @testcases, need
+plan tests => scalar @testcases, need need_lwp,
                  need_module('mod_ratelimit'),
                  need_module('mod_autoindex'),
                  need_min_apache_version('2.5.1');
 
+my $ua = LWP::UserAgent->new;
+$ua->timeout(4);
+
 foreach my $t (@testcases) {
     my $r = GET($t->[0]);
     chomp $r;
-    ok t_cmp($r->code, $t->[1], "rc was bad");
+    t_debug "Status Line: '" .  $r->status_line . "'";
+    ok t_cmp($r->code, $t->[1], $t->[2]);
 }