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/10/17 03:30:40 UTC

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

dougm       01/10/16 18:30:40

  Modified:    perl-framework/Apache-Test README
               perl-framework/Apache-Test/lib/Apache TestConfig.pm
                        TestRun.pm
  Log:
  backing out the set of --? enforcing patches due to breaking of:
   is not proxying requests:
   t/TEST -proxy
  
   args meant for Apache::TestRequest are dropped on the floor:
    t/TEST -post /foo content one=1         (-content was not working either)
    t/TEST -get /foo username x password y  (nor -username or -password)
  
   runs all tests rather than just the specified one:
    t/TEST -httpd ~/foo/httpd t/foo/bar.t
  
  also was using @ARGV instead of @$argv that is passed into
  Apache::PerlRun->getopts (hmm, maybe this is what broke things, but i've
  already spent too much time fighting these problems, just need things to
  work right now)
  
  Revision  Changes    Path
  1.13      +9 -12     httpd-test/perl-framework/Apache-Test/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/README,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- README	2001/10/06 05:03:33	1.12
  +++ README	2001/10/17 01:30:40	1.13
  @@ -7,9 +7,6 @@
   
   see t/TEST as an example test harness
   
  -For an extensive documentation see
  -modperl-2.0/docs/src/devel/writing_tests/writing_tests.pod.
  -
   see t/*.t for example tests
   
   if the file t/conf/httpd.conf.in exists, it will be used instead of
  @@ -48,16 +45,16 @@
   % t/TEST -configure
   
   run as user nobody:
  -% t/TEST -User nobody
  +% t/TEST User nobody
   
   run on a different port:
  -% t/TEST -Port 8799
  +% t/TEST Port 8799
   
   configure an httpd other than the default (that apxs figures out)
  -% t/TEST -httpd ~/ap/httpd-2.0/httpd
  +% t/TEST httpd ~/ap/httpd-2.0/httpd
   
   switch to another apxs
  -% t/TEST -apxs ~/ap/httpd-2.0-prefork/bin/apxs
  +% t/TEST apxs ~/ap/httpd-2.0-prefork/bin/apxs
   
   turn on tracing
   % t/TEST -preamble "PerlTrace all"
  @@ -72,19 +69,19 @@
   % t/TEST -head
   
   GET url with authentication credentials
  -% t/TEST -get /server-info -username dougm -password foo
  +% t/TEST -get /server-info username dougm password foo
   
   POST url (read content from string)
  -% t/TEST -post /TestApache::post -content 'name=dougm&company=covalent'
  +% t/TEST -post /TestApache::post content 'name=dougm&company=covalent'
   
   POST url (read content from stdin)
  -% t/TEST -post /TestApache::post -content - < foo.txt
  +% t/TEST -post /TestApache::post content - < foo.txt
   
   POST url (generate a body of data 1024 bytes in length)
  -% t/TEST -post /TestApache::post -content x1024
  +% t/TEST -post /TestApache::post content x1024
   
   POST url (only print headers, e.g. useful to just check Content-length)
  -% t/TEST -post -head /TestApache::post -content x100000
  +% t/TEST -post -head /TestApache::post content x100000
   
   GET url (only print headers, e.g. useful to just check Content-length)
   % t/TEST -get -head /foo
  
  
  
  1.74      +2 -3      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.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- TestConfig.pm	2001/10/16 20:30:57	1.73
  +++ TestConfig.pm	2001/10/17 01:30:40	1.74
  @@ -68,9 +68,8 @@
       }
   
       while (my($key, $val) = splice @filter, 0, 2) {
  -        if ($key =~ /^-?-?(.+)/ # optinal - or -- prefix
  -            && exists $wanted_args->{$1}) {
  -            $keep{$1} = $val;
  +        if ($wanted_args->{$key}) {
  +            $keep{$key} = $val;
           }
           else {
               push @pass, $key, $val;
  
  
  
  1.58      +17 -29    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.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- TestRun.pm	2001/10/16 22:51:27	1.57
  +++ TestRun.pm	2001/10/17 01:30:40	1.58
  @@ -75,12 +75,12 @@
   #so we dont slurp arguments that are not tests, example:
   # httpd $HOME/apache-2.0/bin/httpd
   
  -sub split_test_args {
  -    my($self) = @_;
  +sub split_args {
  +    my($self, $argv) = @_;
   
  -    my(@tests);
  +    my(@tests, @args);
   
  -    for (@ARGV) {
  +    for (@$argv) {
           my $arg = $_;
           #need the t/ for stat-ing, but dont want to include it in test output
           $arg =~ s:^t/::;
  @@ -109,9 +109,12 @@
                   next;
               }
           }
  +
  +        push @args, $_;
       }
   
       $self->{tests} = \@tests;
  +    $self->{args}  = \@args;
   }
   
   sub passenv {
  @@ -125,13 +128,12 @@
   sub getopts {
       my($self, $argv) = @_;
   
  -    my(%opts, %vopts, %conf_opts);
  +    $self->split_args($argv);
   
  -    # no_permute  : an opt. value cannot come before the option
  -    # pass_through: all unknown things are to be left in @ARGV
  -    Getopt::Long::Configure(qw(pass_through no_permute));
  +    #dont count test files/dirs as @ARGV arguments
  +    local *ARGV = $self->{args};
  +    my(%opts, %vopts, %conf_opts);
   
  -    # grab from @ARGV only the options that we expect
       GetOptions(\%opts, @flag_opts, @help_opts,
                  (map "$_:s", @debug_opts, @request_opts, @ostring_opts),
                  (map "$_=s", @string_opts),
  @@ -140,29 +142,17 @@
                  (map { ("$_=s", $vopts{$_} ||= {}) } @hash_opts));
   
       $opts{$_} = $vopts{$_} for keys %vopts;
  -
  -    # separate configuration options and test files/dirs
  -    my @argv = ();
  -    while (@ARGV) {
  -        my $val = shift @ARGV;
  -        # a known config option?
  -        if ($val =~ /^--?(.+)/ # must have a leading - or --
  -            && exists $Apache::TestConfig::Usage{lc $1}) {
  -            $conf_opts{lc $1} = shift @ARGV || '';
  -        }
  -        else {
  -            push @argv, $val;
  -        }
  -    }
  -    # @ARGV now includes only test files/dirs if any at all
  -    @ARGV = @argv;
   
  -    # force regeneration of httpd.conf if commandline args want to modify it
  +    #force regeneration of httpd.conf if commandline args want to modify it
       $self->{reconfigure} = $opts{configure} ||
         (grep { $opts{$_}->[0] } qw(preamble postamble)) ||
  -        (grep { $Apache::TestConfig::Usage{$_} } keys %conf_opts ) ||
  +        (grep { $Apache::TestConfig::Usage{$_} } @ARGV) ||
             $self->passenv() || (! -e 'conf/httpd.conf');
   
  +    while (my($key, $val) = splice @ARGV, 0, 2) {
  +       $conf_opts{lc $key} = $val;
  +    }
  +
       if (exists $opts{debug}) {
           $opts{debugger} = $opts{debug};
           $opts{debug} = 1;
  @@ -496,8 +486,6 @@
       $self->try_exit_opts;
   
       $self->default_run_opts;
  -
  -    $self->split_test_args;
   
       $self->start;
   
  
  
  

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

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
----- Original Message ----- 
From: "Doug MacEachern" <do...@covalent.net>
To: <te...@httpd.apache.org>
Sent: Tuesday, October 16, 2001 10:27 PM
Subject: Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestRun.pm


> On Tue, 16 Oct 2001, William A. Rowe, Jr. wrote:
>  
> > As far as file 'comparisons' to the pod files, I believe we've probably
> > opened those files in the wrong 'mode'... and we need to binmode them into
> > binary (thus, all our mismatches :)  Where would I find that comparison code?
> 
> hmm, server side the default-handler is sending the files, client side
> libwww-perl is reading the data over a socket, i don't think binmode() can
> be applied there, can it?  and the comparision to the file on disk is done
> with -s $file;  can you run that test with t/TEST -v t/apache/getfile
> so we can see what it reports for download and file bytes?

No, getfile got it right.

Any chance that something is wrong with the socket handling itself?


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

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Doug MacEachern" <do...@covalent.net>
Sent: Tuesday, October 16, 2001 10:27 PM


> On Tue, 16 Oct 2001, William A. Rowe, Jr. wrote:
>  
> > As far as file 'comparisons' to the pod files, I believe we've probably
> > opened those files in the wrong 'mode'... and we need to binmode them into
> > binary (thus, all our mismatches :)  Where would I find that comparison code?
> 
> hmm, server side the default-handler is sending the files, client side
> libwww-perl is reading the data over a socket, i don't think binmode() can
> be applied there, can it?  and the comparision to the file on disk is done
> with -s $file;  can you run that test with t/TEST -v t/apache/getfile
> so we can see what it reports for download and file bytes?

Ugh... that passes.

apache/byterange --- that hangs (well, appears to hang.)

apache/byterange....1..82
Range:         bytes=1-8193
Content-Range: NONE
downloaded 1 bytes, file is 12521 bytes
not ok 1
# Failed test 1 in apache/byterange.t at line 82

We lock up for quite some time on each byterange test.  Any suggestions?
I grabbed the newest lwp as you suggested and installed it.

Bill


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

Posted by Doug MacEachern <do...@covalent.net>.
On Tue, 16 Oct 2001, William A. Rowe, Jr. wrote:
 
> As far as file 'comparisons' to the pod files, I believe we've probably
> opened those files in the wrong 'mode'... and we need to binmode them into
> binary (thus, all our mismatches :)  Where would I find that comparison code?

hmm, server side the default-handler is sending the files, client side
libwww-perl is reading the data over a socket, i don't think binmode() can
be applied there, can it?  and the comparision to the file on disk is done
with -s $file;  can you run that test with t/TEST -v t/apache/getfile
so we can see what it reports for download and file bytes?




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

Posted by Doug MacEachern <do...@covalent.net>.
On Tue, 16 Oct 2001, William A. Rowe, Jr. wrote:
 
> httpd is now 'undef'... not pretty... watching for the next commit.

hmm, you might need to:
t/TEST -clean
(and double check that any *.conf in t/conf and
t/conf/apache_test_config.pm are gone after that)

and backing out that change means you'll need to use:
perl Makefile.PL httpd .../Apache.exe
rather than     -httpd .../Apache.exe

> I believe the other patch you suggested for win32 paths solves our problem on
> that platform.

ok great.
 
> As far as file 'comparisons' to the pod files, I believe we've probably
> opened those files in the wrong 'mode'... and we need to binmode them into
> binary (thus, all our mismatches :)  Where would I find that comparison code?

oh right, i'll need to dig to find it anyhow, i'll just go ahead and add
the binmode() calls.



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

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: <do...@apache.org>
Sent: Tuesday, October 16, 2001 8:30 PM


> dougm       01/10/16 18:30:40
> 
>   Modified:    perl-framework/Apache-Test README
>                perl-framework/Apache-Test/lib/Apache TestConfig.pm
>                         TestRun.pm
>   Log:
>   backing out the set of --? enforcing patches due to breaking of:
>    is not proxying requests:
>    t/TEST -proxy
>   
>    args meant for Apache::TestRequest are dropped on the floor:
>     t/TEST -post /foo content one=1         (-content was not working either)
>     t/TEST -get /foo username x password y  (nor -username or -password)
>   
>    runs all tests rather than just the specified one:
>     t/TEST -httpd ~/foo/httpd t/foo/bar.t
>   
>   also was using @ARGV instead of @$argv that is passed into
>   Apache::PerlRun->getopts (hmm, maybe this is what broke things, but i've
>   already spent too much time fighting these problems, just need things to
>   work right now)

httpd is now 'undef'... not pretty... watching for the next commit.

I believe the other patch you suggested for win32 paths solves our problem on
that platform.

As far as file 'comparisons' to the pod files, I believe we've probably
opened those files in the wrong 'mode'... and we need to binmode them into
binary (thus, all our mismatches :)  Where would I find that comparison code?

Bill