summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/t/apache/if_sections.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:01:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:01:31 +0000
commitc9cf025fadfe043f0f2f679e10d1207d8a158bb6 (patch)
tree3a94effe0bdc0a6814d8134f4ed840d7cc6b6f19 /debian/perl-framework/t/apache/if_sections.t
parentAdding upstream version 2.4.57. (diff)
downloadapache2-c9cf025fadfe043f0f2f679e10d1207d8a158bb6.tar.xz
apache2-c9cf025fadfe043f0f2f679e10d1207d8a158bb6.zip
Adding debian version 2.4.57-2.debian/2.4.57-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/perl-framework/t/apache/if_sections.t')
-rw-r--r--debian/perl-framework/t/apache/if_sections.t76
1 files changed, 76 insertions, 0 deletions
diff --git a/debian/perl-framework/t/apache/if_sections.t b/debian/perl-framework/t/apache/if_sections.t
new file mode 100644
index 0000000..12d591a
--- /dev/null
+++ b/debian/perl-framework/t/apache/if_sections.t
@@ -0,0 +1,76 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestRequest;
+use Apache::TestUtil;
+
+#
+# Test <If > section merging
+#
+
+plan tests => (have_min_apache_version('2.4.26') ? 23 : 11) * 2,
+ need need_lwp,
+ need_module('mod_headers'),
+ need_module('mod_proxy'),
+ need_module('mod_proxy_http'),
+ 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');
+
+if (have_min_apache_version('2.4.26')) {
+ do_test('/foo.if_test', '1 11', 'global1, nested11, nested113');
+ do_test('/foo.if_test', '1 11 111', 'global1, nested11, nested111');
+ do_test('/foo.if_test', '1 11 112', 'global1, nested11, nested112');
+}
+
+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');
+
+if (have_min_apache_version('2.4.26')) {
+ do_test('/dir/', '1 11', 'global1, dir1, nested11, nested113');
+ do_test('/dir/', '1 11 111', 'global1, dir1, nested11, nested111');
+ do_test('/dir/', '1 11 112', 'global1, dir1, nested11, nested112');
+}
+
+do_test('/loc/', '1 2', 'global1, loc1, loc2');
+do_test('/loc/foo.txt', '1 2', 'global1, loc1, loc2');
+
+if (have_min_apache_version('2.4.26')) {
+ do_test('/loc/', '1 11', 'global1, loc1, nested11, nested113');
+ do_test('/loc/', '1 11 111', 'global1, loc1, nested11, nested111');
+ do_test('/loc/', '1 11 112', 'global1, loc1, nested11, nested112');
+}
+
+do_test('/loc/foo.if_test', '1 2', 'global1, files2, loc1, loc2');
+
+if (have_min_apache_version('2.4.26')) {
+ do_test('/loc/foo.if_test', '1 2 11', 'global1, files2, loc1, loc2, nested11, nested113');
+ do_test('/loc/foo.if_test', '1 2 11 111', 'global1, files2, loc1, loc2, nested11, nested111');
+ do_test('/loc/foo.if_test', '1 2 11 112', 'global1, files2, loc1, loc2, nested11, nested112');
+}
+
+do_test('/proxy/', '1 2', 'global1, locp1, locp2');
+do_test('/proxy/', '2', 'locp2');
+