httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1059929 - in /httpd/test/framework/trunk/t: apache/ conf/ htdocs/if_sec/ htdocs/if_sec/dir/ htdocs/if_sec/loc/
Date Mon, 17 Jan 2011 14:03:30 GMT
Author: sf
Date: Mon Jan 17 14:03:30 2011
New Revision: 1059929

URL: http://svn.apache.org/viewvc?rev=1059929&view=rev
Log:
Add test for merging of <If> sections

Added:
    httpd/test/framework/trunk/t/apache/if_sections.t
    httpd/test/framework/trunk/t/htdocs/if_sec/
    httpd/test/framework/trunk/t/htdocs/if_sec/dir/
    httpd/test/framework/trunk/t/htdocs/if_sec/dir/foo.txt
    httpd/test/framework/trunk/t/htdocs/if_sec/dir/index.html
    httpd/test/framework/trunk/t/htdocs/if_sec/foo.if_test
    httpd/test/framework/trunk/t/htdocs/if_sec/index.html
    httpd/test/framework/trunk/t/htdocs/if_sec/loc/
    httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.if_test
    httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.txt
    httpd/test/framework/trunk/t/htdocs/if_sec/loc/index.html
Modified:
    httpd/test/framework/trunk/t/conf/extra.conf.in

Added: httpd/test/framework/trunk/t/apache/if_sections.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/if_sections.t?rev=1059929&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/apache/if_sections.t (added)
+++ httpd/test/framework/trunk/t/apache/if_sections.t Mon Jan 17 14:03:30 2011
@@ -0,0 +1,46 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestRequest;
+use Apache::TestUtil;
+
+#
+# test <If > section merging
+#
+
+plan tests => 11*2,
+                  need need_lwp,
+                  need_module('mod_headers'),
+                  need_min_apache_version('2.3.8');
+
+
+sub do_test
+{
+    my $url = shift;
+    my $set = shift;
+    my $expect = shift;
+
+    $url = "/if_sec$url";
+
+    my @headers_to_set = split(/\s+/, $set);
+    my @headers = map { ("In-If$_" => 1) } @headers_to_set;
+
+    my $response = GET($url, @headers);
+    print "# $url with '$set':\n";
+    ok t_cmp($response->code, 200);
+    ok t_cmp($response->header("Out-Trace"), $expect);
+}
+
+do_test('/',                '',    undef); 
+do_test('/foo.if_test',     '',    undef); 
+do_test('/foo.if_test',     '1',   'global1'); 
+do_test('/foo.if_test',     '1 2', 'global1, files2'); 
+do_test('/dir/foo.txt',     '1 2', 'global1, dir1, dir2, dir_files1'); 
+do_test('/dir/',            '1 2', 'global1, dir1, dir2'); 
+do_test('/loc/',            '1 2', 'global1, loc1, loc2'); 
+do_test('/loc/foo.txt',     '1 2', 'global1, loc1, loc2'); 
+do_test('/loc/foo.if_test', '1 2', 'global1, files2, loc1, loc2'); 
+do_test('/proxy/',          '1 2', 'global1, locp1, locp2'); 
+do_test('/proxy/',          '2',   'locp2'); 
+

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=1059929&r1=1059928&r2=1059929&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Mon Jan 17 14:03:30 2011
@@ -741,4 +741,50 @@ LimitRequestFields    32
     </Directory>
 </IfVersion>
 
+<IfDefine APACHE2>
+  <IfVersion >= 2.3.11>
+    <IfModule mod_headers.c>
+    <IfModule mod_proxy.c>
+       ProxyPass /if_sec/proxy/ http://@SERVERNAME@:@PORT@/
+       <Directory @SERVERROOT@/htdocs/if_sec/dir/>
+         <If "-n %{REQ:In-If1}">
+           Header merge Out-Trace dir1
+         </If>
+         <If "-n %{REQ:In-If2}">
+           Header merge Out-Trace dir2
+         </If>
+         <Files *.txt>
+           <If "-n %{REQ:In-If1}">
+             Header merge Out-Trace dir_files1
+           </If>
+         </Files>
+       </Directory>
+       <Location /if_sec/proxy/>
+         <If "-n %{REQ:In-If1}">
+           Header merge Out-Trace locp1
+         </If>
+         <If "-n %{REQ:In-If2}">
+           Header merge Out-Trace locp2
+         </If>
+       </Location>
+       <Location /if_sec/loc/>
+         <If "-n %{REQ:In-If1}">
+           Header merge Out-Trace loc1
+         </If>
+         <If "-n %{REQ:In-If2}">
+           Header merge Out-Trace loc2
+         </If>
+       </Location>
+       <Files *.if_test>
+         <If "-n %{REQ:In-If2}">
+           Header merge Out-Trace files2
+         </If>
+       </Files>
+       <If "-n %{REQ:In-If1}">
+         Header merge Out-Trace global1
+       </If>
+    </IfModule>
+    </IfModule>
+  </IfVersion>
+</IfDefine>
 

Added: httpd/test/framework/trunk/t/htdocs/if_sec/dir/foo.txt
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/if_sec/dir/foo.txt?rev=1059929&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/if_sec/dir/foo.txt (added)
+++ httpd/test/framework/trunk/t/htdocs/if_sec/dir/foo.txt Mon Jan 17 14:03:30 2011
@@ -0,0 +1 @@
+dir/foo.txt

Added: httpd/test/framework/trunk/t/htdocs/if_sec/dir/index.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/if_sec/dir/index.html?rev=1059929&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/if_sec/dir/index.html (added)
+++ httpd/test/framework/trunk/t/htdocs/if_sec/dir/index.html Mon Jan 17 14:03:30 2011
@@ -0,0 +1 @@
+dir/index.html

Added: httpd/test/framework/trunk/t/htdocs/if_sec/foo.if_test
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/if_sec/foo.if_test?rev=1059929&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/if_sec/foo.if_test (added)
+++ httpd/test/framework/trunk/t/htdocs/if_sec/foo.if_test Mon Jan 17 14:03:30 2011
@@ -0,0 +1 @@
+foo.if_test

Added: httpd/test/framework/trunk/t/htdocs/if_sec/index.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/if_sec/index.html?rev=1059929&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/if_sec/index.html (added)
+++ httpd/test/framework/trunk/t/htdocs/if_sec/index.html Mon Jan 17 14:03:30 2011
@@ -0,0 +1 @@
+index.html

Added: httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.if_test
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.if_test?rev=1059929&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.if_test (added)
+++ httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.if_test Mon Jan 17 14:03:30 2011
@@ -0,0 +1 @@
+loc/foo.if_test

Added: httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.txt
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.txt?rev=1059929&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.txt (added)
+++ httpd/test/framework/trunk/t/htdocs/if_sec/loc/foo.txt Mon Jan 17 14:03:30 2011
@@ -0,0 +1 @@
+loc/foo.txt

Added: httpd/test/framework/trunk/t/htdocs/if_sec/loc/index.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/if_sec/loc/index.html?rev=1059929&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/if_sec/loc/index.html (added)
+++ httpd/test/framework/trunk/t/htdocs/if_sec/loc/index.html Mon Jan 17 14:03:30 2011
@@ -0,0 +1 @@
+loc/index.html



Mime
View raw message