summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/t/modules/info.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 02:04:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 02:04:07 +0000
commit1221c736f9a90756d47ea6d28320b6b83602dd2a (patch)
treeb453ba7b1393205258c9b098a773b4330984672f /debian/perl-framework/t/modules/info.t
parentAdding upstream version 2.4.38. (diff)
downloadapache2-debian/2.4.38-3+deb10u8.tar.xz
apache2-debian/2.4.38-3+deb10u8.zip
Adding debian version 2.4.38-3+deb10u8.debian/2.4.38-3+deb10u8
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/perl-framework/t/modules/info.t')
-rw-r--r--debian/perl-framework/t/modules/info.t69
1 files changed, 69 insertions, 0 deletions
diff --git a/debian/perl-framework/t/modules/info.t b/debian/perl-framework/t/modules/info.t
new file mode 100644
index 0000000..cbc4d6e
--- /dev/null
+++ b/debian/perl-framework/t/modules/info.t
@@ -0,0 +1,69 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestRequest;
+
+##
+## mod_info quick test
+##
+
+plan tests => 1, need_module 'info';
+
+my $uri = '/server-info';
+my $info = GET_BODY $uri;
+my $config = Apache::Test::config();
+my $mods = $config->{modules};
+my (@actual,@expected) = ((),());
+
+## extract module names from html ##
+foreach (split /\n/, $info) {
+ if ($_ =~ /<a name=\"(\w+\.c)\">/) {
+ if ($1 eq 'util_ldap.c') {
+ push(@actual,'mod_ldap.c');
+ } elsif ($1 eq 'mod_apreq2.c') {
+ push(@actual,'mod_apreq.c');
+ } else {
+ push(@actual, $1);
+ }
+ }
+}
+
+foreach (sort keys %$mods) {
+ ($mods->{$_} && !$config->should_skip_module($_)) or next;
+ if ($_ =~ /^mod_mpm_(eventopt|event|prefork|worker)\.c$/) {
+ push(@expected,"$1.c");
+ } elsif ($_ eq 'mod_mpm_simple.c') {
+ push(@expected,'simple_api.c');
+ # statically linked mod_ldap
+ } elsif ($_ eq 'util_ldap.c') {
+ push(@expected,'mod_ldap.c');
+ # statically linked mod_apreq2
+ } elsif ($_ eq 'mod_apreq2.c') {
+ push(@expected,'mod_apreq.c');
+ } else {
+ push(@expected,$_);
+ }
+}
+@actual = sort @actual;
+@expected = sort @expected;
+
+## verify all mods are there ##
+my $ok = 1;
+if (@actual == @expected) {
+ for (my $i=1 ; $i<@expected ; $i++) {
+ if ($expected[$i] ne $actual[$i]) {
+ $ok = 0;
+ print "comparing expected ->$expected[$i]<-\n";
+ print "to actual ->$actual[$i]<-\n";
+ print "actual:\n@actual\nexpect:\n@expected\n";
+ last;
+ }
+ }
+} else {
+ $ok = 0;
+ my $a = @actual; my $e = @expected;
+ print "actual($a modules):\n@actual\nexpect($e modules):\n@expected\n";
+}
+
+ok $ok;