looks good, but what happens when 1.3 is used? Shouldn't it always return preforked?
doh!
here's a better patch.
--Geoff
Index: Test.pm =================================================================== RCS file: /home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm,v retrieving revision 1.63 diff -u -r1.63 Test.pm --- Test.pm 19 Jun 2003 00:45:31 -0000 1.63 +++ Test.pm 30 Jun 2003 13:46:35 -0000 @@ -15,7 +15,7 @@ have_cgi have_access have_auth have_module have_apache have_min_apache_version have_apache_version have_perl have_min_perl_version have_min_module_version - have_threads under_construction); + have_threads under_construction have_apache_mpm); $VERSION = '1.04'; %SubTests = (); @@ -274,6 +274,22 @@ push @SkipReasons, "apache version $wanted or higher is required," . " this is version $current"; + return 0; + } + else { + return 1; + } +} + +sub have_apache_mpm { + my $wanted = shift; + my $cfg = Apache::Test::config(); + my $current = $cfg->{server}->{mpm}; + + if ($current ne $wanted) { + push @SkipReasons, + "apache mpm $wanted is required," . + " this is the $current mpm"; return 0; } else { Index: TestConfigParse.pm =================================================================== RCS file: /home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm,v retrieving revision 1.33 diff -u -r1.33 TestConfigParse.pm --- TestConfigParse.pm 27 Apr 2003 22:52:28 -0000 1.33 +++ TestConfigParse.pm 30 Jun 2003 13:46:36 -0000 @@ -309,6 +309,10 @@ if (my $mpm_dir = $self->{httpd_defines}->{APACHE_MPM_DIR}) { $self->{mpm} = basename $mpm_dir; } + else { + # Apache 1.3 + $self->{mpm} = 'prefork'; + } } sub httpd_version { @@ -339,6 +343,10 @@ close $v; return $version; +} + +sub httpd_mpm { + return shift->{mpm}; } 1; Index: TestServer.pm =================================================================== RCS file: /home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v retrieving revision 1.62 diff -u -r1.62 TestServer.pm --- TestServer.pm 21 May 2003 04:02:14 -0000 1.62 +++ TestServer.pm 30 Jun 2003 13:46:36 -0000 @@ -38,6 +38,7 @@ $self->{port_counter} = $self->{config}->{vars}->{port}; $self->{version} = $self->{config}->httpd_version || ''; + $self->{mpm} = $self->{config}->httpd_mpm || ''; ($self->{rev}) = $self->{version} =~ m:^Apache/(\d)\.:; $self->{rev} ||= 2;