You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2003/02/07 05:34:55 UTC

are perl-framework apache tests still used?

I haven't seen any activity with maintaining tests in a while and I have a 
bunch of ssl tests failing. I remember Ryan working on a new test suite. 
What's the current status of things? Should Joe's new php tests be committed?

These fail for me:
ssl/basicauth.t                3    1  33.33%  2
ssl/http.t       255 65280     2    2 100.00%  1-2
ssl/proxy.t                  169    5   2.96%  113-117
ssl/varlookup.t               72    4   5.56%  38-39 52-53
5 tests and 6 subtests skipped.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: are perl-framework apache tests still used?

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Joe Orton wrote:
> 
>> On Fri, Feb 07, 2003 at 03:34:55PM +1100, Stas Bekman wrote:
>>
>>> I haven't seen any activity with maintaining tests in a while and I 
>>> have a bunch of ssl tests failing. I remember Ryan working on a new 
>>> test suite. What's the current status of things? Should Joe's new php 
>>> tests be committed?
>>>
>>> These fail for me:
>>> ssl/basicauth.t                3    1  33.33%  2
>>> ssl/http.t       255 65280     2    2 100.00%  1-2
>>> ssl/proxy.t                  169    5   2.96%  113-117
>>> ssl/varlookup.t               72    4   5.56%  38-39 52-53
>>> 5 tests and 6 subtests skipped.
>>
>>
>>
>> The varlookup.t tests fail if you use OpenSSL 0.9.7, since it uses the
>> string "emailAddress" not "Email" for an e-mail attribute in a DN. I
>> hacked round this by just removing the e-mail attributes from the DN.
> 
> 
> It's probably better to fix it, rather than remove tests. How about this:

Actually, there is no need to mangle the version number, since "0.9.6g" lt 
"0.9.7" will do the right thing. So here is a simpler version:


Index: Apache-Test/lib/Apache/TestSSLCA.pm
===================================================================
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm,v
retrieving revision 1.12
diff -u -r1.12 TestSSLCA.pm
--- Apache-Test/lib/Apache/TestSSLCA.pm	3 Apr 2002 17:39:36 -0000	1.12
+++ Apache-Test/lib/Apache/TestSSLCA.pm	7 Feb 2003 23:33:15 -0000
@@ -21,6 +21,7 @@
  *import = \&Exporter::import;

  my $openssl = $ENV{APACHE_TEST_OPENSSL_CMD} || 'openssl';
+my $version = version();

  my $CA = 'asf';
  my $Config; #global Apache::TestConfig object
@@ -36,6 +37,9 @@
  my $passin  = "-passin pass:$pass";
  my $passout = "-passout pass:$pass";

+# in 0.9.7 s/Email/emailAddress/ in DN
+my $email_field = $version lt "0.9.7" ? "Email" : "emailAddress";
+
  my $ca_dn = {
      asf => {
          C  => 'US',
@@ -44,7 +48,7 @@
          O  => 'ASF',
          OU => 'httpd-test',
          CN => '',
-        Email => 'test-dev@httpd.apache.org',
+        $email_field => 'test-dev@httpd.apache.org',
      },
  };

@@ -132,7 +136,7 @@

      my $string = "";

-    for my $k (qw(C ST L O OU CN Email)) {
+    for my $k ((qw(C ST L O OU CN), $email_field)) {
          next unless $dn->{$k};
          $string .= "/$k=$dn->{$k}";
      }
@@ -185,7 +189,7 @@
  O                      = $dn->{O}
  OU                     = $dn->{OU}
  CN                     = $dn->{CN}
-emailAddress           = $dn->{Email}
+emailAddress           = $dn->{$email_field}

  [ req_attributes ]
  challengePassword      = $pass
@@ -488,6 +492,12 @@

      return if -d $dir;
      mkdir $dir, 0755;
+}
+
+sub version {
+    my $version = qx($openssl version);
+    return $1 if $version =~ /^OpenSSL (\S+) /;
+    return 0;
  }

  1;


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: are perl-framework apache tests still used?

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> On Fri, Feb 07, 2003 at 03:34:55PM +1100, Stas Bekman wrote:
> 
>>I haven't seen any activity with maintaining tests in a while and I have a 
>>bunch of ssl tests failing. I remember Ryan working on a new test suite. 
>>What's the current status of things? Should Joe's new php tests be 
>>committed?
>>
>>These fail for me:
>>ssl/basicauth.t                3    1  33.33%  2
>>ssl/http.t       255 65280     2    2 100.00%  1-2
>>ssl/proxy.t                  169    5   2.96%  113-117
>>ssl/varlookup.t               72    4   5.56%  38-39 52-53
>>5 tests and 6 subtests skipped.
> 
> 
> The varlookup.t tests fail if you use OpenSSL 0.9.7, since it uses the
> string "emailAddress" not "Email" for an e-mail attribute in a DN. I
> hacked round this by just removing the e-mail attributes from the DN.

It's probably better to fix it, rather than remove tests. How about this:

Index: Apache-Test/lib/Apache/TestSSLCA.pm
===================================================================
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm,v
retrieving revision 1.12
diff -u -r1.12 TestSSLCA.pm
--- Apache-Test/lib/Apache/TestSSLCA.pm	3 Apr 2002 17:39:36 -0000	1.12
+++ Apache-Test/lib/Apache/TestSSLCA.pm	7 Feb 2003 23:09:11 -0000
@@ -21,6 +21,7 @@
  *import = \&Exporter::import;

  my $openssl = $ENV{APACHE_TEST_OPENSSL_CMD} || 'openssl';
+my $version = version();

  my $CA = 'asf';
  my $Config; #global Apache::TestConfig object
@@ -36,6 +37,9 @@
  my $passin  = "-passin pass:$pass";
  my $passout = "-passout pass:$pass";

+# in 0.9.7 s/Email/emailAddress/ in DN
+my $email_field = $version lt "097" ? "Email" : "emailAddress";
+
  my $ca_dn = {
      asf => {
          C  => 'US',
@@ -44,7 +48,7 @@
          O  => 'ASF',
          OU => 'httpd-test',
          CN => '',
-        Email => 'test-dev@httpd.apache.org',
+        $email_field => 'test-dev@httpd.apache.org',
      },
  };

@@ -132,7 +136,7 @@

      my $string = "";

-    for my $k (qw(C ST L O OU CN Email)) {
+    for my $k ((qw(C ST L O OU CN), $email_field)) {
          next unless $dn->{$k};
          $string .= "/$k=$dn->{$k}";
      }
@@ -185,7 +189,7 @@
  O                      = $dn->{O}
  OU                     = $dn->{OU}
  CN                     = $dn->{CN}
-emailAddress           = $dn->{Email}
+emailAddress           = $dn->{$email_field}

  [ req_attributes ]
  challengePassword      = $pass
@@ -488,6 +492,15 @@

      return if -d $dir;
      mkdir $dir, 0755;
+}
+
+sub version {
+    my $version = qx($openssl version);
+    if ($version =~ /^OpenSSL (\S+) /) {
+        ($version = $1) =~ s/\.//g;
+        return $version;
+    }
+    return 0;
  }

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: are perl-framework apache tests still used?

Posted by Joe Orton <jo...@redhat.com>.
On Fri, Feb 07, 2003 at 03:34:55PM +1100, Stas Bekman wrote:
> I haven't seen any activity with maintaining tests in a while and I have a 
> bunch of ssl tests failing. I remember Ryan working on a new test suite. 
> What's the current status of things? Should Joe's new php tests be 
> committed?
> 
> These fail for me:
> ssl/basicauth.t                3    1  33.33%  2
> ssl/http.t       255 65280     2    2 100.00%  1-2
> ssl/proxy.t                  169    5   2.96%  113-117
> ssl/varlookup.t               72    4   5.56%  38-39 52-53
> 5 tests and 6 subtests skipped.

The varlookup.t tests fail if you use OpenSSL 0.9.7, since it uses the
string "emailAddress" not "Email" for an e-mail attribute in a DN. I
hacked round this by just removing the e-mail attributes from the DN.

--- perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm.os097	2003-01-28 15:08:50.000000000 +0000
+++ perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm	2003-01-28 15:11:52.000000000 +0000
@@ -44,7 +44,6 @@
         O  => 'ASF',
         OU => 'httpd-test',
         CN => '',
-        Email => 'test-dev@httpd.apache.org',
     },
 };
 
@@ -132,7 +131,7 @@
 
     my $string = "";
 
-    for my $k (qw(C ST L O OU CN Email)) {
+    for my $k (qw(C ST L O OU CN)) {
         next unless $dn->{$k};
         $string .= "/$k=$dn->{$k}";
     }
@@ -185,7 +184,6 @@
 O                      = $dn->{O}
 OU                     = $dn->{OU}
 CN                     = $dn->{CN}
-emailAddress           = $dn->{Email}
 
 [ req_attributes ]
 challengePassword      = $pass

Re: are perl-framework apache tests still used?

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> On Fri, Feb 07, 2003 at 06:04:29PM +1100, Stas Bekman wrote:
> 
>>William A. Rowe, Jr. wrote:
>>
>>>AHHH... you are confusing apr/test (Ryan's ongoing efforts, even apart
>>
>>>from the apr group) which tests internal functions, with perl-testsuite,
>>
>>>which tests behavior of the server.
>>>
>>>If Joe's tests work - commit them :-)
>>
>>I don't have php installed. Preferrably, someone who can test them first, 
>>will commit them. Otherwise I can commit without testing, though they need 
>>some cleanup (use hardcoded / path separator is not crossplatform)...
> 
> 
> OK - is there some easy way to make this portable? The only other places
> I can find which use local files seem to be doing the same thing,
> though: modules/cgi.t with $cgi_log and write_htaccess in modules/dir.t?

There are many more tests in the modperl-2.0 repository. And there is also an 
extensive doc http://perl.apache.org/docs/general/testing/testing.html

To make things portable in Perl you have to use File::Spec.

use File::Spec::Functions qw(catfile);
my $docroot = $vars->{documentroot};
my $fname = catfile $docroot, "php", "getlastmod.php";

Though of course you don't want to use catfile for generating URLs, because 
there are always Unix way and "/php/getlastmod.php" is correct.

Finally, rather than using:

printf "# debug: month is %s\n", $month;

Apache::TestUtil imports t_debug(), so you just need to say:

t_debug("month is $month");

But we want the verbosity mode to be automatically enabled and disabled from 
the command line, so we use another utility: t_cmp

and we end up with:

ok t_cmp($result, $month, "testing modification month");

when you run the test suite with -v:

% t/TEST -v php/getlastmod

you will get the verbose debug information, so you don't need to add any extra 
debugging statements.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: are perl-framework apache tests still used?

Posted by Joe Orton <jo...@redhat.com>.
On Fri, Feb 07, 2003 at 06:04:29PM +1100, Stas Bekman wrote:
> William A. Rowe, Jr. wrote:
> >AHHH... you are confusing apr/test (Ryan's ongoing efforts, even apart
> >from the apr group) which tests internal functions, with perl-testsuite,
> >which tests behavior of the server.
> >
> >If Joe's tests work - commit them :-)
> 
> I don't have php installed. Preferrably, someone who can test them first, 
> will commit them. Otherwise I can commit without testing, though they need 
> some cleanup (use hardcoded / path separator is not crossplatform)...

OK - is there some easy way to make this portable? The only other places
I can find which use local files seem to be doing the same thing,
though: modules/cgi.t with $cgi_log and write_htaccess in modules/dir.t?

Regards,

joe

Re: are perl-framework apache tests still used?

Posted by Stas Bekman <st...@stason.org>.
William A. Rowe, Jr. wrote:
> AHHH... you are confusing apr/test (Ryan's ongoing efforts, even apart
> from the apr group) which tests internal functions, with perl-testsuite,
> which tests behavior of the server.
> 
> If Joe's tests work - commit them :-)

I don't have php installed. Preferrably, someone who can test them first, will 
commit them. Otherwise I can commit without testing, though they need some 
cleanup (use hardcoded / path separator is not crossplatform)...

> And the tests you cite... ssl/http.t is expected to fail today, mod_ssl once
> provided HTTP/1.0 responses, irrespective of ass-backwards requests
> (those that are pre HTTP/1.0, where the request is simply GET /foo with
> no version tag), while it now provides an HTTP/0.9 response (no headers.)
> Both behaviors are wrong, and the thorough solution isn't quite trivial, but
> we expect to implement good behavior RSN (so we look at the request
> and then emit the correct HTTP/1.0 or 0.9 response.)
> 
> The others concern me... -verbose feedback would be helpful.
> 
> Is this apache 2.0.45-dev or 2.1.0-dev?

2.1.0-dev from a few day ago. I will try again later with the latest cvs, but 
for now:

I've extracted the output of only failing sub-tests:

ssl/basicauth....1..3

# testing : Getting /ssl-fakebasicauth/index.html with client_snakeoil cert
# expected: 200
# received: '401'
# Failed test 2 in ssl/basicauth.t at line 25
not ok 2



ssl/proxy........1..169

# testing : using valid proxyssl client cert
# expected: 200
# received: '502'
# Failed test 113 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #113
# 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
line 47 is:     ok $sub->();
not ok 113
# testing : using invalid proxyssl client cert
# expected: 403
# received: '502'
# Failed test 114 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #114
not ok 114
# testing : protected cgi script
# expected: 200
# received: '502'
# Failed test 115 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #115
not ok 115
# testing : X-Forwarded-Host header
# expected: 'localhost.localdomain:8537'
# Failed test 116 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #116
# received: undef
not ok 116
# testing : client subject common name
# Failed test 117 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #117
# expected: 'client_ok'
# received: undef
not ok 117


ssl/varlookup....1..72


# testing : SSL_CLIENT_S_DN
# expected: '/C=US/ST=California/L=San 
Francisco/O=ASF/OU=httpd-test/CN=client_ok/Email=test-dev@httpd.apache.org'
# Failed test 38 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #38
# 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
line 47 is:     ok $sub->();
# received: '/C=US/ST=California/L=San 
Francisco/O=ASF/OU=httpd-test/CN=client_ok/emailAddress=test-dev@httpd.apache.org'
not ok 38
# testing : SSL_SERVER_S_DN
# expected: qr/(?-xism:^\/C=US\/ST=California\/L=San 
Francisco\/O=ASF\/OU=httpd-test\/([-\w]+)\/CN=localhost\/Email=test-dev@httpd.apache.org$)/
# received: '/C=US/ST=California/L=San 
Francisco/O=ASF/OU=httpd-test/rsa-test/CN=localhost/emailAddress=test-dev@httpd.apache.org'
# Failed test 39 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #39
not ok 39




# testing : SSL_CLIENT_I_DN
# expected: '/C=US/ST=California/L=San 
Francisco/O=ASF/OU=httpd-test/CN=ca/Email=test-dev@httpd.apache.org'
# received: '/C=US/ST=California/L=San 
Francisco/O=ASF/OU=httpd-test/CN=ca/emailAddress=test-dev@httpd.apache.org'
# Failed test 52 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #52
not ok 52
# testing : SSL_SERVER_I_DN
# expected: '/C=US/ST=California/L=San 
Francisco/O=ASF/OU=httpd-test/CN=ca/Email=test-dev@httpd.apache.org'
# Failed test 53 in 
/home/stas/apache.org/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm 
at line 47 fail #53
# received: '/C=US/ST=California/L=San 
Francisco/O=ASF/OU=httpd-test/CN=ca/emailAddress=test-dev@httpd.apache.org'
not ok 53




__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: are perl-framework apache tests still used?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
AHHH... you are confusing apr/test (Ryan's ongoing efforts, even apart
from the apr group) which tests internal functions, with perl-testsuite,
which tests behavior of the server.

If Joe's tests work - commit them :-)

And the tests you cite... ssl/http.t is expected to fail today, mod_ssl once
provided HTTP/1.0 responses, irrespective of ass-backwards requests
(those that are pre HTTP/1.0, where the request is simply GET /foo with
no version tag), while it now provides an HTTP/0.9 response (no headers.)
Both behaviors are wrong, and the thorough solution isn't quite trivial, but
we expect to implement good behavior RSN (so we look at the request
and then emit the correct HTTP/1.0 or 0.9 response.)

The others concern me... -verbose feedback would be helpful.

Is this apache 2.0.45-dev or 2.1.0-dev?

Bill

At 10:34 PM 2/6/2003, Stas Bekman wrote:
>I haven't seen any activity with maintaining tests in a while and I have a bunch of ssl tests failing. I remember Ryan working on a new test suite. What's the current status of things? Should Joe's new php tests be committed?
>
>These fail for me:
>ssl/basicauth.t                3    1  33.33%  2
>ssl/http.t       255 65280     2    2 100.00%  1-2
>ssl/proxy.t                  169    5   2.96%  113-117
>ssl/varlookup.t               72    4   5.56%  38-39 52-53
>5 tests and 6 subtests skipped.
>
>
>__________________________________________________________________
>Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
>http://stason.org/    mod_perl Guide ---> http://perl.apache.org
>mailto:stas@stason.org http://use.perl.org http://apacheweek.com
>http://modperlbook.org http://apache.org  http://ticketmaster.com



Re: are perl-framework apache tests still used?

Posted by Cliff Woolley <jw...@virginia.edu>.
On Fri, 7 Feb 2003, Stas Bekman wrote:

> I haven't seen any activity with maintaining tests in a while and I have a
> bunch of ssl tests failing. I remember Ryan working on a new test suite.
> What's the current status of things? Should Joe's new php tests be committed?
>
> These fail for me:
>
> ssl/basicauth.t                3    1  33.33%  2
> ssl/http.t       255 65280     2    2 100.00%  1-2
> ssl/proxy.t                  169    5   2.96%  113-117
> ssl/varlookup.t               72    4   5.56%  38-39 52-53

Glad it's not just me.  :)  I'm not sure when they broke... there was a
big gap in there up until last week when I hadn't run the perl-framework
tests in a long time.  :-/

Anybody?

I'm CC:ing dev@httpd on this to make sure it's on everyone's radar...
followups to test-dev, please.

--Cliff


Re: are perl-framework apache tests still used?

Posted by Cliff Woolley <jw...@virginia.edu>.
On Fri, 7 Feb 2003, Stas Bekman wrote:

> I haven't seen any activity with maintaining tests in a while and I have a
> bunch of ssl tests failing. I remember Ryan working on a new test suite.
> What's the current status of things? Should Joe's new php tests be committed?
>
> These fail for me:
>
> ssl/basicauth.t                3    1  33.33%  2
> ssl/http.t       255 65280     2    2 100.00%  1-2
> ssl/proxy.t                  169    5   2.96%  113-117
> ssl/varlookup.t               72    4   5.56%  38-39 52-53

Glad it's not just me.  :)  I'm not sure when they broke... there was a
big gap in there up until last week when I hadn't run the perl-framework
tests in a long time.  :-/

Anybody?

I'm CC:ing dev@httpd on this to make sure it's on everyone's radar...
followups to test-dev, please.

--Cliff