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 do...@apache.org on 2001/12/14 09:55:25 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestRequest.pm TestRun.pm

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;
  
  
  

Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestRequest.pm TestRun.pm

Posted by Doug MacEachern <do...@covalent.net>.
backwards logic error.  has nothing todo with the Makefile or Makefile.PL
try now.








Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestRequest.pm TestRun.pm

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Doug MacEachern wrote:
> 
> i'll have a look on win32 later, in the meantime you can grab this:
> http://perl.apache.org/~dougm/httpd-test-sslca.tar.gz
> 
> unpack it inside the httpd-test/perl-framework directory.
> and there will be no attempt to use openssl or generate the ca.

Nope, I'm still getting the 'can't find "openssl"' error, unless
I redo the 'perl Makefile.PL' step w/o the -ssl switch.  Which,
by the way, is particularly annoying when I'm not trying to
run any SSL tests; it completely disables the suite. :-(  IMHO,
having to re-do the Makefile depending on whether you intend to
test SSL or not isn't cool..
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestRequest.pm TestRun.pm

Posted by Doug MacEachern <do...@covalent.net>.
i'll have a look on win32 later, in the meantime you can grab this:
http://perl.apache.org/~dougm/httpd-test-sslca.tar.gz

unpack it inside the httpd-test/perl-framework directory.
and there will be no attempt to use openssl or generate the ca.

openssl is not a requirement, the current code just assumes it is
available if $self->{modules}->{ $self->{vars}->{ssl_module} }
i will fix that.

of course, openssl is a required to run the tests (lwp/Net::SSL requires
it) but i will fix so things don't blow up.



Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestRequest.pm TestRun.pm

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
dougm@apache.org wrote:
> 
>   +    if ($check) {
>   +        my $openssl = Apache::TestSSLCA::openssl();
>   +        if (which($openssl)) {
>   +            return 1;
>   +        }
>   +
>   +        error "cannot locate '$openssl' program required to generate SSL CA";
>   +        exit(1);
>   +    }

Okey, now everything SSL is broken on my Win box, and I'm getting
this error.  I don't have OpenSSL installed; if that is now a
requirement, -1 on this whole patch sequence..
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"