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:26:58 UTC

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

Author: covener
Date: Mon Aug 20 19:26:58 2018
New Revision: 1838456

URL: http://svn.apache.org/viewvc?rev=1838456&view=rev
Log:
add a skeleton of a ratelimit test


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

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=1838456&r1=1838455&r2=1838456&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:26:58 2018
@@ -1213,3 +1213,17 @@ LimitRequestFields    32
       </IfVersion>
    </VirtualHost>
 </IfModule>
+
+
+<IfModule mod_ratelimit.c>
+   AliasMatch ^/apache/ratelimit/autoindex/$ @SERVERROOT@/htdocs/
+   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-initial-burst 512
+       </IfModule>
+   </Location>
+</IfModule>

Added: httpd/test/framework/trunk/t/modules/ratelimit.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/ratelimit.t?rev=1838456&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/modules/ratelimit.t (added)
+++ httpd/test/framework/trunk/t/modules/ratelimit.t Mon Aug 20 19:26:58 2018
@@ -0,0 +1,27 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestRequest;
+use Apache::TestUtil;
+use MIME::Base64;
+use Data::Dumper;
+use HTTP::Response;
+use Socket;
+
+my @testcases = (
+    ['/apache/ratelimit/'           => '200'],
+    ['/apache/ratelimit/autoindex/' => '200'],
+);
+
+plan tests => scalar @testcases, need
+                 need_module('mod_ratelimit'),
+                 need_module('mod_autoindex'),
+                 need_min_apache_version('2.5.1');
+
+foreach my $t (@testcases) {
+    my $r = GET($t->[0]);
+    chomp $r;
+    ok t_cmp($r->code, $t->[1], "rc was bad");
+}
+