summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/Apache-Test/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-25 04:41:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-25 04:41:28 +0000
commit2eeb62e38ae17a3523ad3cd81c3de9f20f9e7742 (patch)
treefe91033d4712f6d836006b998525656b9dd193b8 /debian/perl-framework/Apache-Test/lib
parentMerging upstream version 2.4.59. (diff)
downloadapache2-debian.tar.xz
apache2-debian.zip
Adding debian version 2.4.59-1~deb10u1.debian/2.4.59-1_deb10u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/perl-framework/Apache-Test/lib')
-rw-r--r--debian/perl-framework/Apache-Test/lib/Apache/Test.pm2
-rw-r--r--debian/perl-framework/Apache-Test/lib/Apache/TestCommon.pm2
-rw-r--r--debian/perl-framework/Apache-Test/lib/Apache/TestConfig.pm155
-rw-r--r--debian/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm2
-rw-r--r--debian/perl-framework/Apache-Test/lib/Apache/TestRun.pm2
-rw-r--r--debian/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm2
-rw-r--r--debian/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm29
-rw-r--r--debian/perl-framework/Apache-Test/lib/Apache/TestTrace.pm4
8 files changed, 134 insertions, 64 deletions
diff --git a/debian/perl-framework/Apache-Test/lib/Apache/Test.pm b/debian/perl-framework/Apache-Test/lib/Apache/Test.pm
index e748c83..b18de11 100644
--- a/debian/perl-framework/Apache-Test/lib/Apache/Test.pm
+++ b/debian/perl-framework/Apache-Test/lib/Apache/Test.pm
@@ -37,7 +37,7 @@ BEGIN {
use vars qw(@ISA @EXPORT %EXPORT_TAGS $VERSION %SubTests @SkipReasons);
-$VERSION = '1.41';
+$VERSION = '1.44';
my @need = qw(need_lwp need_http11 need_cgi need_access need_auth
need_module need_apache need_min_apache_version need_min_apache_fix
diff --git a/debian/perl-framework/Apache-Test/lib/Apache/TestCommon.pm b/debian/perl-framework/Apache-Test/lib/Apache/TestCommon.pm
index e65d1d3..9722bc2 100644
--- a/debian/perl-framework/Apache-Test/lib/Apache/TestCommon.pm
+++ b/debian/perl-framework/Apache-Test/lib/Apache/TestCommon.pm
@@ -53,7 +53,7 @@ sub run_write_test {
$received += length $chunk;
});
- ok t_cmp($length, $received, 'bytes in body');
+ ok t_cmp($received, $length, 'bytes in body');
}
}
}
diff --git a/debian/perl-framework/Apache-Test/lib/Apache/TestConfig.pm b/debian/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
index ad0b02c..274f1a0 100644
--- a/debian/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
+++ b/debian/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
@@ -59,41 +59,44 @@ use Apache::TestRun ();
use vars qw(%Usage);
%Usage = (
- top_dir => 'top-level directory (default is $PWD)',
- t_dir => 'the t/ test directory (default is $top_dir/t)',
- t_conf => 'the conf/ test directory (default is $t_dir/conf)',
- t_logs => 'the logs/ test directory (default is $t_dir/logs)',
- t_pid_file => 'location of the pid file (default is $t_logs/httpd.pid)',
- t_conf_file => 'test httpd.conf file (default is $t_conf/httpd.conf)',
- src_dir => 'source directory to look for mod_foos.so',
- serverroot => 'ServerRoot (default is $t_dir)',
- documentroot => 'DocumentRoot (default is $ServerRoot/htdocs',
- port => 'Port [port_number|select] (default ' . DEFAULT_PORT . ')',
- servername => 'ServerName (default is localhost)',
- user => 'User to run test server as (default is $USER)',
- group => 'Group to run test server as (default is $GROUP)',
- bindir => 'Apache bin/ dir (default is apxs -q BINDIR)',
- sbindir => 'Apache sbin/ dir (default is apxs -q SBINDIR)',
- httpd => 'server to use for testing (default is $bindir/httpd)',
- target => 'name of server binary (default is apxs -q TARGET)',
- apxs => 'location of apxs (default is from Apache2::BuildConfig)',
- startup_timeout => 'seconds to wait for the server to start (default is 60)',
- httpd_conf => 'inherit config from this file (default is apxs derived)',
- httpd_conf_extra=> 'inherit additional config from this file',
- minclients => 'minimum number of concurrent clients (default is 1)',
- maxclients => 'maximum number of concurrent clients (default is minclients+1)',
- perlpod => 'location of perl pod documents (for testing downloads)',
- proxyssl_url => 'url for testing ProxyPass / https (default is localhost)',
- sslca => 'location of SSL CA (default is $t_conf/ssl/ca)',
- sslcaorg => 'SSL CA organization to use for tests (default is asf)',
- sslproto => 'SSL/TLS protocol version(s) to test',
- libmodperl => 'path to mod_perl\'s .so (full or relative to LIBEXECDIR)',
- defines => 'values to add as -D defines (for example, "VAR1 VAR2")',
+ top_dir => 'top-level directory (default is $PWD)',
+ t_dir => 'the t/ test directory (default is $top_dir/t)',
+ t_conf => 'the conf/ test directory (default is $t_dir/conf)',
+ t_logs => 'the logs/ test directory (default is $t_dir/logs)',
+ t_state => 'the state/ test directory (default is $t_dir/state)',
+ t_pid_file => 'location of the pid file (default is $t_logs/httpd.pid)',
+ t_conf_file => 'test httpd.conf file (default is $t_conf/httpd.conf)',
+ src_dir => 'source directory to look for mod_foos.so',
+ serverroot => 'ServerRoot (default is $t_dir)',
+ documentroot => 'DocumentRoot (default is $ServerRoot/htdocs',
+ port => 'Port [port_number|select] (default ' . DEFAULT_PORT . ')',
+ servername => 'ServerName (default is localhost)',
+ user => 'User to run test server as (default is $USER)',
+ group => 'Group to run test server as (default is $GROUP)',
+ bindir => 'Apache bin/ dir (default is apxs -q BINDIR)',
+ sbindir => 'Apache sbin/ dir (default is apxs -q SBINDIR)',
+ httpd => 'server to use for testing (default is $bindir/httpd)',
+ target => 'name of server binary (default is apxs -q TARGET)',
+ apxs => 'location of apxs (default is from Apache2::BuildConfig)',
+ startup_timeout => 'seconds to wait for the server to start (default is 60)',
+ httpd_conf => 'inherit config from this file (default is apxs derived)',
+ httpd_conf_extra => 'inherit additional config from this file',
+ minclients => 'minimum number of concurrent clients (default is 1)',
+ maxclients => 'maximum number of concurrent clients (default is minclients+1)',
+ threadsperchild => 'number of threads per child when using threaded MPMs (default is 10)',
+ limitrequestline => 'global LimitRequestLine setting (default is 128)',
+ perlpod => 'location of perl pod documents (for testing downloads)',
+ proxyssl_url => 'url for testing ProxyPass / https (default is localhost)',
+ sslca => 'location of SSL CA (default is $t_conf/ssl/ca)',
+ sslcaorg => 'SSL CA organization to use for tests (default is asf)',
+ sslproto => 'SSL/TLS protocol version(s) to test',
+ libmodperl => 'path to mod_perl\'s .so (full or relative to LIBEXECDIR)',
+ defines => 'values to add as -D defines (for example, "VAR1 VAR2")',
(map { $_ . '_module_name', "$_ module name"} qw(cgi ssl thread access auth php)),
);
my %filepath_conf_opts = map { $_ => 1 }
- qw(top_dir t_dir t_conf t_logs t_pid_file t_conf_file src_dir serverroot
+ qw(top_dir t_dir t_conf t_logs t_state t_pid_file t_conf_file src_dir serverroot
documentroot bindir sbindir httpd apxs httpd_conf httpd_conf_extra
perlpod sslca libmodperl);
@@ -298,9 +301,7 @@ sub new {
$vars->{sslca} ||= catfile $vars->{t_conf}, 'ssl', 'ca';
$vars->{sslcaorg} ||= 'asf';
- if (!defined($vars->{sslproto})) {
- require Apache::TestSSLCA;
-
+ if (!defined($vars->{sslproto}) and eval { require Apache::TestSSLCA; 1; }) {
$vars->{sslproto} = Apache::TestSSLCA::sslproto();
}
else {
@@ -308,6 +309,7 @@ sub new {
}
$vars->{t_logs} ||= catfile $vars->{serverroot}, 'logs';
+ $vars->{t_state} ||= catfile $vars->{serverroot}, 'state';
$vars->{t_conf_file} ||= catfile $vars->{t_conf}, 'httpd.conf';
$vars->{t_pid_file} ||= catfile $vars->{t_logs}, 'httpd.pid';
@@ -326,6 +328,7 @@ sub new {
$vars->{group} ||= $self->default_group;
$vars->{serveradmin} ||= $self->default_serveradmin;
+ $vars->{threadsperchild} ||= 10;
$vars->{minclients} ||= 1;
$vars->{maxclients_preset} = $vars->{maxclients} || 0;
# if maxclients wasn't explicitly passed try to
@@ -338,13 +341,36 @@ sub new {
$vars->{maxclients_preset} < $vars->{minclients}) {
$vars->{minclients} = $vars->{maxclients_preset};
}
+ if ($vars->{minclients} < 2) {
+ $vars->{maxspare} = 2;
+ } else {
+ $vars->{maxspare} = $vars->{minclients};
+ }
+ if ($vars->{maxclients} < $vars->{maxspare} + 1) {
+ $vars->{maxclients} = $vars->{maxspare} + 1;
+ }
+
+ # for threaded mpms MinClients and MaxClients must be a
+ # multiple of ThreadsPerChild
+ {
+ use integer;
+ $vars->{minclientsthreadedmpm} = ($vars->{minclients} + $vars->{threadsperchild} - 1) /
+ $vars->{threadsperchild} * $vars->{threadsperchild};
+ $vars->{maxclientsthreadedmpm} = ($vars->{maxclients} + $vars->{threadsperchild} - 1) /
+ $vars->{threadsperchild} * $vars->{threadsperchild};
+ $vars->{maxsparethreadedmpm} = ($vars->{maxspare} + $vars->{threadsperchild} - 1) /
+ $vars->{threadsperchild} * $vars->{threadsperchild};
+ $vars->{startserversthreadedmpm} = $vars->{minclientsthreadedmpm} / $vars->{threadsperchild};
+ }
+ if ($vars->{maxsparethreadedmpm} < 2 * $vars->{threadsperchild}) {
+ $vars->{maxsparethreadedmpm} = 2 * $vars->{threadsperchild};
+ }
+ if ($vars->{maxclientsthreadedmpm} < $vars->{maxsparethreadedmpm} + $vars->{threadsperchild}) {
+ $vars->{maxclientsthreadedmpm} = $vars->{maxsparethreadedmpm} + $vars->{threadsperchild};
+ }
- # for threaded mpms MaxClients must be a multiple of
- # ThreadsPerChild (i.e. maxclients % minclients == 0)
- # so unless -maxclients was explicitly specified use a double of
- # minclients
- $vars->{maxclientsthreadedmpm} =
- $vars->{maxclients_preset} || $vars->{minclients} * 2;
+ $vars->{limitrequestline} ||= 128;
+ $vars->{limitrequestlinex2} = 2 * $vars->{limitrequestline};
$vars->{proxy} ||= 'off';
$vars->{proxyssl_url} ||= '';
@@ -524,6 +550,15 @@ sub configure_proxy {
unless ($vars->{maxclients_preset}) {
$vars->{minclients}++;
$vars->{maxclients}++;
+ $vars->{maxspare}++;
+ $vars->{startserversthreadedmpm} ++;
+ $vars->{minclientsthreadedmpm} += $vars->{threadsperchild};
+ $vars->{maxclientsthreadedmpm} += $vars->{threadsperchild};
+ $vars->{maxsparethreadedmpm} += $vars->{threadsperchild};
+ #In addition allow for some backend processes
+ #in keep-alive state. For threaded MPMs we
+ #already should be fine.
+ $vars->{maxclients} += 3;
}
$vars->{proxy} = $self->{vhosts}->{'mod_proxy'}->{hostport};
return $vars->{proxy};
@@ -1409,6 +1444,15 @@ sub check_vars {
unless ($vars->{maxclients_preset}) {
$vars->{minclients}++;
$vars->{maxclients}++;
+ $vars->{maxspare}++;
+ $vars->{startserversthreadedmpm} ++;
+ $vars->{minclientsthreadedmpm} += $vars->{threadsperchild};
+ $vars->{maxclientsthreadedmpm} += $vars->{threadsperchild};
+ $vars->{maxsparethreadedmpm} += $vars->{threadsperchild};
+ #In addition allow for some backend processes
+ #in keep-alive state. For threaded MPMs we
+ #already should be fine.
+ $vars->{maxclients} += 3;
}
}
}
@@ -1571,6 +1615,7 @@ sub generate_httpd_conf {
$self->generate_index_html;
$self->gendir($vars->{t_logs});
+ $self->gendir($vars->{t_state});
$self->gendir($vars->{t_conf});
my @very_last_postamble = ();
@@ -1737,6 +1782,11 @@ sub which {
return undef unless $program;
+ # No need to search PATH components
+ # if $program already contains a path
+ return $program if !OSX and !WINFU and
+ $program =~ /\// and -f $program and -x $program;
+
my @dirs = File::Spec->path();
require Config;
@@ -2166,6 +2216,11 @@ LogLevel debug
DefaultRunTimeDir "@t_logs@"
LogLevel trace8
</IfVersion>
+<IfVersion > 2.4.34>
+<IfDirective DefaultStateDir>
+ DefaultStateDir "@t_state@"
+</IfDirective>
+</IfVersion>
</IfModule>
<IfModule mod_log_config.c>
@@ -2194,10 +2249,10 @@ HostnameLookups Off
LockFile @t_logs@/accept.lock
</IfVersion>
</IfModule>
- StartServers 1
- MinSpareThreads @MinClients@
- MaxSpareThreads @MinClients@
- ThreadsPerChild @MinClients@
+ StartServers @StartServersThreadedMPM@
+ MinSpareThreads @ThreadsPerChild@
+ MaxSpareThreads @MaxSpareThreadedMPM@
+ ThreadsPerChild @ThreadsPerChild@
MaxClients @MaxClientsThreadedMPM@
MaxRequestsPerChild 0
</IfModule>
@@ -2210,8 +2265,8 @@ HostnameLookups Off
</IfModule>
NumServers 1
StartThreads @MinClients@
- MinSpareThreads @MinClients@
- MaxSpareThreads @MinClients@
+ MinSpareThreads 1
+ MaxSpareThreads @MaxSpare@
MaxThreadsPerChild @MaxClients@
MaxRequestsPerChild 0
</IfModule>
@@ -2223,8 +2278,8 @@ HostnameLookups Off
</IfVersion>
</IfModule>
StartServers @MinClients@
- MinSpareServers @MinClients@
- MaxSpareServers @MinClients@
+ MinSpareServers 1
+ MaxSpareServers @MaxSpare@
MaxClients @MaxClients@
MaxRequestsPerChild 0
</IfModule>
@@ -2232,8 +2287,8 @@ HostnameLookups Off
<IfDefine APACHE1>
LockFile @t_logs@/accept.lock
StartServers @MinClients@
- MinSpareServers @MinClients@
- MaxSpareServers @MinClients@
+ MinSpareServers 1
+ MaxSpareServers @MaxSpare@
MaxClients @MaxClients@
MaxRequestsPerChild 0
</IfDefine>
diff --git a/debian/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm b/debian/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm
index fa26f34..60e12e3 100644
--- a/debian/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm
+++ b/debian/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm
@@ -342,7 +342,7 @@ sub inherit_config_file_or_directory {
(my $directive, $_) = split /\s+/, $_, 2;
- if ($directive eq "Include") {
+ if ($directive eq "Include" or $directive eq "IncludeOptional") {
foreach my $include (glob($self->server_file_rel2abs($_))) {
$self->inherit_config_file_or_directory($include);
}
diff --git a/debian/perl-framework/Apache-Test/lib/Apache/TestRun.pm b/debian/perl-framework/Apache-Test/lib/Apache/TestRun.pm
index f398eb5..515f69a 100644
--- a/debian/perl-framework/Apache-Test/lib/Apache/TestRun.pm
+++ b/debian/perl-framework/Apache-Test/lib/Apache/TestRun.pm
@@ -776,7 +776,7 @@ sub detect_relocation {
return unless -e $config_file;
my %inc = %INC;
- eval { require "$config_file" };
+ eval { require "./$config_file" };
%INC = %inc; # be stealth
warn($@), return if $@;
diff --git a/debian/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm b/debian/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm
index df01bc4..d2965ba 100644
--- a/debian/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm
+++ b/debian/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm
@@ -234,7 +234,7 @@ what this means, but it isn't important to understand the gory details.
instead, it is sufficient to understand that when C<Apache::Test> calls
C<bar.php> it feeds the results directly to C<Test::Harness>, a module
that comes with every Perl installation, and C<Test::Harness> expects
-what it receives to be formatted in a very specific way. by itself, all
+what it receives to be formated in a very specific way. by itself, all
of this is pretty useless, so C<Apache::Test> provides PHP testers with
something much better. here is a much better example:
diff --git a/debian/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm b/debian/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm
index 3f1a24a..ca37f16 100644
--- a/debian/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm
+++ b/debian/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm
@@ -23,7 +23,7 @@ use DirHandle ();
use File::Path ();
use File::Copy 'cp';
use File::Basename;
-use Net::SSLeay;
+use File::Spec::Functions qw(devnull);
use Apache::TestConfig ();
use Apache::TestTrace;
@@ -73,6 +73,7 @@ if (Apache::Test::normalize_vstring($version) <
my $sslproto = "all";
+eval { require Net::SSLeay; };
if (Apache::Test::normalize_vstring($version) >=
Apache::Test::normalize_vstring("1.1.1")
&& !defined(&Net::SSLeay::CTX_set_post_handshake_auth)) {
@@ -293,8 +294,20 @@ nsComment = This Is A Comment
1.3.6.1.4.1.18060.12.0 = DER:0c064c656d6f6e73
subjectAltName = email:\$mail$san_msupn
+[ client_ext ]
+extendedKeyUsage = clientAuth
+
[ server_ext ]
subjectAltName = DNS:\$CN$san_dnssrv
+extendedKeyUsage = serverAuth
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+[ ca_ext ]
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid:always,issuer
+basicConstraints = critical,CA:true
+
EOF
return $file;
@@ -325,7 +338,7 @@ sub new_ca {
join ':', dn_oneline('client_snakeoil'),
$basic_auth_password);
- openssl req => "-new -x509 -keyout $cakey -out $cacert $days",
+ openssl req => "-new -x509 -extensions ca_ext -keyout $cakey -out $cacert $days",
config('ca');
export_cert('ca'); #useful for importing into IE
@@ -366,7 +379,8 @@ sub sign_cert {
my $name = shift;
my $exts = '';
- $exts = ' -extensions client_ok_ext' if $name =~ /client_ok/;
+ $exts = ' -extensions client_ext' if $name =~ /client/;
+ $exts .= ' -extensions client_ok_ext' if $name =~ /client_ok/;
$exts = ' -extensions server_ext' if $name =~ /server/;
@@ -422,7 +436,7 @@ sub hash_certs {
for my $file ($dh->read) {
next unless $file =~ /\.cr[tl]$/;
- chomp(my $hash = `openssl $type -noout -hash < $file`);
+ chomp(my $hash = `$openssl $type -noout -hash < $file`);
next unless $hash;
my $symlink = "$hash.r$n";
$n++;
@@ -572,9 +586,10 @@ sub gendir {
}
sub version {
- my $version = qx($openssl version);
- return $1 if $version =~ /^OpenSSL (\S+) /;
- return 0;
+ my $devnull = devnull();
+ my $version = qx($openssl version 2>$devnull);
+ return $1 if $version =~ /^\S+SSL (\S+)/;
+ die "FATAL: unable to determine openssl version via `$openssl version` from: $version";
}
sub dgst {
diff --git a/debian/perl-framework/Apache-Test/lib/Apache/TestTrace.pm b/debian/perl-framework/Apache-Test/lib/Apache/TestTrace.pm
index 19c5b29..00426ea 100644
--- a/debian/perl-framework/Apache-Test/lib/Apache/TestTrace.pm
+++ b/debian/perl-framework/Apache-Test/lib/Apache/TestTrace.pm
@@ -126,9 +126,9 @@ sub nc_trace {
}
sub trace_level {
- # overridden by user/-trace
+ # overriden by user/-trace
(defined $Level && $levels{$Level}) ||
- # or overridden by env var
+ # or overriden by env var
(exists $ENV{APACHE_TEST_TRACE_LEVEL} &&
$levels{$ENV{APACHE_TEST_TRACE_LEVEL}}) ||
# or default