You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by ge...@apache.org on 2003/08/13 18:25:15 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache Test.pm TestConfigParse.pm TestServer.pm

geoff       2003/07/30 14:31:12

  Modified:    perl-framework/Apache-Test/lib/Apache Test.pm
                        TestConfigParse.pm TestServer.pm
  Log:
  add have_apache_mpm() function and docs
  Submitted by:	geoff
  Reviewed by:	stas
  
  Revision  Changes    Path
  1.65      +27 -1     httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm
  
  Index: Test.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- Test.pm	8 Jul 2003 07:57:03 -0000	1.64
  +++ Test.pm	30 Jul 2003 21:31:12 -0000	1.65
  @@ -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 = ();
  @@ -281,6 +281,22 @@
       }
   }
   
  +sub have_apache_mpm {
  +    my $wanted = shift;
  +    my $cfg = Apache::Test::config();
  +    my $current = $cfg->{server}->{mpm};
  +
  +    if ($current ne $wanted) {
  +        push @SkipReasons,
  +          "apache $wanted mpm is required," .
  +          " this is the $current mpm";
  +        return 0;
  +    }
  +    else {
  +        return 1;
  +    }
  +}
  +
   sub config_enabled {
       my $key = shift;
       defined $Config{$key} and $Config{$key} eq 'define';
  @@ -539,6 +555,16 @@
     plan tests => 5, have_apache_version("2.0.40");
   
   requires Apache 2.0.40.
  +
  +=item have_apache_mpm
  +
  +Used to require a specific Apache Multi-Processing Module.
  +
  +For example:
  +
  +  plan tests => 5, have_apache_mpm('prefork');
  +
  +requires the prefork MPM.
   
   =item have_perl
   
  
  
  
  1.34      +8 -0      httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm
  
  Index: TestConfigParse.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- TestConfigParse.pm	27 Apr 2003 22:52:28 -0000	1.33
  +++ TestConfigParse.pm	30 Jul 2003 21:31:12 -0000	1.34
  @@ -309,6 +309,10 @@
       if (my $mpm_dir = $self->{httpd_defines}->{APACHE_MPM_DIR}) {
           $self->{mpm} = basename $mpm_dir;
       }
  +    else {
  +        # Apache 1.3 - no mpm to speak of
  +        $self->{mpm} = '';
  +    }
   }
   
   sub httpd_version {
  @@ -339,6 +343,10 @@
       close $v;
   
       return $version;
  +}
  +
  +sub httpd_mpm {
  +    return shift->{mpm};
   }
   
   1;
  
  
  
  1.63      +3 -2      httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm
  
  Index: TestServer.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- TestServer.pm	21 May 2003 04:02:14 -0000	1.62
  +++ TestServer.pm	30 Jul 2003 21:31:12 -0000	1.63
  @@ -38,8 +38,9 @@
       $self->{port_counter} = $self->{config}->{vars}->{port};
   
       $self->{version} = $self->{config}->httpd_version || '';
  -    ($self->{rev}) = $self->{version} =~ m:^Apache/(\d)\.:;
  -    $self->{rev} ||= 2;
  +    $self->{mpm}     = $self->{config}->httpd_mpm     || '';
  +    ($self->{rev})   = $self->{version} =~ m:^Apache/(\d)\.:;
  +    $self->{rev}   ||= 2;
   
       $self;
   }