httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestRequest.pm TestRun.pm
Date Fri, 14 Dec 2001 08:55:25 GMT
dougm       01/12/14 00:55:25

  Modified:    perl-framework/Apache-Test/lib/Apache TestConfig.pm
                        TestRequest.pm TestRun.pm
  Log:
  integrate with new Apache::TestSSLCA module
  
  Revision  Changes    Path
  1.104     +43 -0     httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
  
  Index: TestConfig.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- TestConfig.pm	2001/12/14 04:21:44	1.103
  +++ TestConfig.pm	2001/12/14 08:55:25	1.104
  @@ -46,6 +46,8 @@
      httpd_conf    => 'inherit config from this file (default is apxs derived)',
      maxclients    => 'maximum number of concurrent clients (default is 1)',
      perlpod       => 'location of perl pod documents (for testing downloads)',
  +   sslca         => 'location of SSL CA (default is $t_conf/ssl/ca)',
  +   sslcaorg      => 'SSL CA organization to use for tests (default is asf)',
      (map { $_ . '_module_name', "$_ module name"} qw(cgi ssl thread)),
   );
   
  @@ -192,6 +194,8 @@
       $vars->{perlpod}      ||= $self->find_in_inc('pod');
       $vars->{perl}         ||= $^X;
       $vars->{t_conf}       ||= catfile $vars->{serverroot}, 'conf';
  +    $vars->{sslca}        ||= catfile $vars->{t_conf}, 'ssl', 'ca';
  +    $vars->{sslcaorg}     ||= 'asf';
       $vars->{t_logs}       ||= catfile $vars->{serverroot}, 'logs';
       $vars->{t_conf_file}  ||= catfile $vars->{t_conf},   'httpd.conf';
   
  @@ -721,6 +725,7 @@
   
       $self->new_test_server->clean;
       $self->cmodules_clean;
  +    $self->sslca_clean;
   
       for (keys %{ $self->{clean}->{files} }) {
           if (-e $_) {
  @@ -954,6 +959,44 @@
       #but we want extra.conf Included first so vhosts inherit base config
       #such as LimitRequest*
       return [ sort @extra_conf ];
  +}
  +
  +sub sslca_can {
  +    my($self, $check) = @_;
  +
  +    return 0 unless $self->{modules}->{ $self->{vars}->{ssl_module} };
  +    require Apache::TestSSLCA;
  +
  +    my $ca = $self->{vars}->{sslca};
  +    return 0 unless $ca and -d dirname($ca); #t/conf/ssl
  +
  +    if ($check) {
  +        my $openssl = Apache::TestSSLCA::openssl();
  +        if (which($openssl)) {
  +            return 1;
  +        }
  +
  +        error "cannot locate '$openssl' program required to generate SSL CA";
  +        exit(1);
  +    }
  +
  +    return 1;
  +}
  +
  +sub sslca_generate {
  +    my $self = shift;
  +
  +    return unless $self->sslca_can(1);
  +
  +    Apache::TestSSLCA::generate($self);
  +}
  +
  +sub sslca_clean {
  +    my $self = shift;
  +
  +    return unless $self->sslca_can;
  +
  +    Apache::TestSSLCA::clean($self);
   }
   
   #XXX: just a quick hack to support t/TEST -ssl
  
  
  
  1.62      +2 -2      httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm
  
  Index: TestRequest.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- TestRequest.pm	2001/12/11 04:08:55	1.61
  +++ TestRequest.pm	2001/12/14 08:55:25	1.62
  @@ -527,8 +527,8 @@
   
   sub set_client_cert {
       my $name = shift;
  -    my $config = Apache::Test::config();
  -    my $dir = "$config->{vars}->{t_conf}/ssl";
  +    my $vars = Apache::Test::vars();
  +    my $dir = join '/', $vars->{sslca}, $vars->{sslcaorg};
   
       if ($name) {
           $ENV{HTTPS_CERT_FILE} = "$dir/certs/$name.crt";
  
  
  
  1.73      +1 -0      httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm
  
  Index: TestRun.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- TestRun.pm	2001/12/05 08:58:04	1.72
  +++ TestRun.pm	2001/12/14 08:55:25	1.73
  @@ -359,6 +359,7 @@
       }
   
       my $test_config = $self->{test_config};
  +    $test_config->sslca_generate;
       $test_config->generate_ssl_conf if $self->{opts}->{ssl};
       $test_config->cmodules_configure;
       $test_config->generate_httpd_conf;
  
  
  

Mime
View raw message