httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jchamp...@apache.org
Subject svn commit: r1772791 - in /httpd/test/framework/trunk/t: apache/iffile.t conf/extra.conf.in htdocs/apache/iffile/ htdocs/apache/iffile/document
Date Mon, 05 Dec 2016 20:38:47 GMT
Author: jchampion
Date: Mon Dec  5 20:38:47 2016
New Revision: 1772791

URL: http://svn.apache.org/viewvc?rev=1772791&view=rev
Log:
Add some tests for trunk's new <IfFile> directive

Been sitting on these since ACEU.

Added:
    httpd/test/framework/trunk/t/apache/iffile.t
    httpd/test/framework/trunk/t/htdocs/apache/iffile/
    httpd/test/framework/trunk/t/htdocs/apache/iffile/document
Modified:
    httpd/test/framework/trunk/t/conf/extra.conf.in

Added: httpd/test/framework/trunk/t/apache/iffile.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/iffile.t?rev=1772791&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/apache/iffile.t (added)
+++ httpd/test/framework/trunk/t/apache/iffile.t Mon Dec  5 20:38:47 2016
@@ -0,0 +1,16 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestRequest;
+use Apache::TestUtil;
+
+plan tests => 2,
+     need(
+         need_module('mod_headers'),
+         need_min_apache_version('2.5.0')
+     );
+
+my $resp = GET('/apache/iffile/document');
+ok t_cmp($resp->code, 200);
+ok t_cmp($resp->header('X-Out'), "success1, success2, success3, success4");

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=1772791&r1=1772790&r2=1772791&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Mon Dec  5 20:38:47 2016
@@ -1000,3 +1000,44 @@ LimitRequestFields    32
     </IfModule>
   </IfModule>
 </IfDefine>
+
+#
+# <IfFile> test config (see t/apache/iffile.t)
+#
+<IfDefine APACHE2>
+  <IfVersion >= 2.5.0>
+  <IfModule mod_headers.c>
+
+    <Location /apache/iffile>
+      # First, the IfFiles that should succeed.
+      <IfFile htdocs/apache/iffile/document>
+        Header merge X-Out success1
+      </IfFile>
+      <IfFile !htdocs/apache/iffile/doesnotexist>
+        Header merge X-Out success2
+      </IfFile>
+      <IfFile htdocs/apache/iffile>
+        Header merge X-Out success3
+      </IfFile>
+      <IfFile @SERVERROOT@/htdocs/apache/iffile/document>
+        Header merge X-Out success4
+      </IfFile>
+
+      # Followed by the IfFiles that should fail.
+      <IfFile !htdocs/apache/iffile/document>
+        Header merge X-Out fail1
+      </IfFile>
+      <IfFile htdocs/apache/iffile/doesnotexist>
+        Header merge X-Out fail2
+      </IfFile>
+      <IfFile !htdocs/apache/iffile>
+        Header merge X-Out fail3
+      </IfFile>
+      <IfFile !@SERVERROOT@/htdocs/apache/iffile/document>
+        Header merge X-Out fail4
+      </IfFile>
+    </Location>
+
+  </IfModule>
+  </IfVersion>
+</IfDefine>

Added: httpd/test/framework/trunk/t/htdocs/apache/iffile/document
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/apache/iffile/document?rev=1772791&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/apache/iffile/document (added)
+++ httpd/test/framework/trunk/t/htdocs/apache/iffile/document Mon Dec  5 20:38:47 2016
@@ -0,0 +1 @@
+placeholder



Mime
View raw message