Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@www.apache.org Received: (qmail 68833 invoked from network); 20 Jul 2004 02:58:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Jul 2004 02:58:50 -0000 Received: (qmail 7409 invoked by uid 500); 20 Jul 2004 02:58:49 -0000 Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 7392 invoked by uid 500); 20 Jul 2004 02:58:49 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 7370 invoked by uid 99); 20 Jul 2004 02:58:49 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [142.132.65.108] (HELO theoryx5.uwinnipeg.ca) (142.132.65.108) by apache.org (qpsmtpd/0.27.1) with ESMTP; Mon, 19 Jul 2004 19:58:46 -0700 Received: from theoryx5.uwinnipeg.ca (localhost.localdomain [127.0.0.1]) by theoryx5.uwinnipeg.ca (8.12.8/8.12.8) with ESMTP id i6K2xb8O026784; Mon, 19 Jul 2004 21:59:37 -0500 Received: from localhost (randy@localhost) by theoryx5.uwinnipeg.ca (8.12.8/8.12.8/Submit) with ESMTP id i6K2xajQ026780; Mon, 19 Jul 2004 21:59:37 -0500 Date: Mon, 19 Jul 2004 21:59:36 -0500 (CDT) From: Randy Kobes To: Markus Wichitill cc: apreq-dev Subject: Re: [apreq-2] Various test issues In-Reply-To: <40FC8333.5070705@gmx.de> Message-ID: References: <40FC8333.5070705@gmx.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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