httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject Re: [apreq-2] Various test issues
Date Tue, 20 Jul 2004 02:59:36 GMT
On Tue, 20 Jul 2004, Markus Wichitill wrote:

> After a pause, I've been doing some apreq2 testing again.
>
> First, to work with current mp2 CVS and its changed server API, request.pm
> needs this patch:
>
> Index: glue/perl/t/response/TestApReq/request.pm
> ===================================================================
> RCS file:
> /home/cvspublic/httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm,v
> retrieving revision 1.33
> diff -u -r1.33 request.pm
> --- glue/perl/t/response/TestApReq/request.pm	18 Jul 2004 23:24:51 -0000	1.33
> +++ glue/perl/t/response/TestApReq/request.pm	19 Jul 2004 23:22:22 -0000
> @@ -26,7 +26,8 @@
>
>   sub handler {
>       my $r = shift;
> -    my $temp_dir = $r->server->server_root_relative('logs');
> +    my $temp_dir =
> +        File::Spec->catfile(Apache::ServerUtil::server_root, 'logs');
>       my $req = Apache::Request->new($r, POST_MAX => 1_000_000,
>                                          TEMP_DIR => $temp_dir);
>
>

Thanks - I'll apply that in a few days (I'm away from
my Win32 machine until then).

> Under Win32, the linkfile part of the upload test needs another :APR open to
> work, otherwise the open will fail with permission denied:
>
> Index: glue/perl/t/response/TestApReq/upload.pm
> ===================================================================
> RCS file:
> /home/cvspublic/httpd-apreq-2/glue/perl/t/response/TestApReq/upload.pm,v
> retrieving revision 1.1
> diff -u -r1.1 upload.pm
> --- glue/perl/t/response/TestApReq/upload.pm	12 Jul 2004 13:10:14 -0000	1.1
> +++ glue/perl/t/response/TestApReq/upload.pm	20 Jul 2004 00:33:35 -0000
> @@ -41,7 +41,8 @@
>           my $link_file = File::Spec->catfile($temp_dir, "linkfile");
>           unlink $link_file if -f $link_file;
>           $upload->link($link_file) or die "Can't link to $link_file: $!";
> -        open $fh, "<", $link_file or die "Can't open $link_file: $!";
> +        open $fh, "<:APR", $link_file, $upload->pool
> +            or die "Can't open $link_file: $!";
>           binmode $fh;
>           read $fh, $data, $upload->size;
>           close $fh;
>

Strange - that worked for me without the patch ... It's
probably worth applying (with a note), but I'm curious -
what is your $temp_dir?

> Under Linux, when I run the upload test as root and if all files belong to
> root, I think not enough files get chowned to nobody (?):
>
> root@red /usr/src/httpd-apreq-2/glue/perl
> $ perl t/TEST -verbose t/apreq/upload.t
> [warning] setting ulimit to allow core files
> ulimit -c unlimited; /usr/local/perl/bin/perl
> /usr/src/httpd-apreq-2/glue/perl/t/TEST -verbose 't/apreq/upload.t'
> make: Nothing to be done for `all'.
> [warning] root mode: changing the files ownership to 'nobody' (65534:65533)
> [warning] testing whether 'nobody' is able to -rwx
> /usr/src/httpd-apreq-2/glue/perl/t
> "/usr/local/perl/bin/perl" -Mlib=/usr/local/perl/lib -MApache::TestRun -e
> 'eval { Apache::TestRun::run_root_fs_test(65534, 65533,
> q[/usr/src/httpd-apreq-2/glue/perl/t]) }';
>
> [warning] result: OK
> [warning] the client side drops 'root' permissions and becomes 'nobody'
> /usr/local/apache2/bin/httpd -d /usr/src/httpd-apreq-2/glue/perl/t -f
> /usr/src/httpd-apreq-2/glue/perl/t/conf/httpd.conf -D APACHE2 -D
> PERL_USEITHREADS
> using Apache/2.0.50 (worker MPM)
>
> waiting 60 seconds for server to start: ..
> waiting 60 seconds for server to start: ok (waited 1 secs)
> server localhost:8529 started
> t/apreq/upload....1..20
> # Running under perl version 5.008004 for linux
> # Current time local: Tue Jul 20 03:09:34 2004
> # Current time GMT:   Tue Jul 20 01:09:34 20040
> # Using Test.pm version 1.25
> # Using Apache/Test.pm version 1.13
> Cannot open /usr/src/httpd-apreq-2/glue/perl/httpd: Permission denied at
> t/apreq/upload.t line 27.
>
>
> When all files belong to another non-root user and the test is executed as
> that users, it works.

Running the tests as root (for any package) generally casues
problems with Apache-Test, for reasons of permissions, as
you saw. I don't think there's a general fix yet, apart from
running the tests as non-root.

> All apreq/cgi.t tests that worked before fail in that case however, since
> test_cgi.pl can't be executed due to the lack of mod_cgid in the generated
> t/conf/httpd.conf.
>
> not ok 1
> # Failed test 1 in t/apreq/cgi.t at line 51
> # # of keys : 15, key_len 5
> # testing : GET long query
> # expected: 90
> # received: #!/usr/local/perl/bin/perl

Is mod_cgi (or mod_cgid, if this is for a multi-threaded
unix mpm) enabled in your system httpd.conf?  We should
probably skip those tests if one of these, as appropriate,
isn't available.

> Finally, it would be nice if the apreq tests would include the apache\bin
> directory in the PATH under Win32. Unlike for mp2, I couldn't figure out how
> to do it this time.

I'll take a look when I return - thanks.

-- 
best regards,
randy

Mime
View raw message