[BUG] mod_perl2 test failures (when building Debian package)

[BUG] mod_perl2 test failures (when building Debian package)

am 22.12.2008 17:47:18 von Gunnar Wolf

Hi,

I am a member of the Debian pkg-perl group [1]. I stumbled upon a test
failure when rebuilding - For further information on my build
environment, please refer to the bug report in the Debian BTS [2].

The test failure appears on hooks/authz.t:

Test Summary Report
-------------------
t/hooks/authz (Wstat: 0 Tests: 4 Failed: 1)
Failed test: 4

As per the instructions on the modperl website, I ran (snipping out
the repetitive lines that I don't think convey any extra information):

$ make test TEST_VERBOSE=1 TEST_FILES="hooks/authz.t"
(...)
/usr/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl /tmp/build-area/libapache2-mod-perl2-2.0.4/t/TEST -clean
echo "*** PASSENV: APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= APACHE_TEST_APXS="
*** PASSENV: APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= APACHE_TEST_APXS=
echo "*** APACHE_TEST_HTTPD: "
*** APACHE_TEST_HTTPD:
echo "*** APACHE_TEST_EXTRA_ARGS: "
*** APACHE_TEST_EXTRA_ARGS:
APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= APACHE_TEST_APXS= \
/usr/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -bugreport -verbose=1 hooks/authz.t
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl /tmp/build-area/libapache2-mod-perl2-2.0.4/t/TEST -bugreport -verbose=1 'hooks/authz.t'
/usr/sbin/apache2 -d /tmp/build-area/libapache2-mod-perl2-2.0.4/t -f /tmp/build-area/libapache2-mod-perl2-2.0.4/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
using Apache/2.2.11 (prefork MPM)

waiting 120 seconds for server to start: .[Mon Dec 22 10:34:52 2008] [info] 6 Apache2:: modules loaded
[Mon Dec 22 10:34:52 2008] [info] 0 APR:: modules loaded
[Mon Dec 22 10:34:52 2008] [info] base server + 28 vhosts ready to run tests
.
waiting 120 seconds for server to start: ok (waited 1 secs)
(...)
server localhost:8550 listening (TestHooks::hookrun)
(...)
t/hooks/authz....
1..4
# Running under perl version 5.010000 for linux
# Current time local: Mon Dec 22 10:34:54 2008
# Current time GMT: Mon Dec 22 16:34:54 2008
# Using Test.pm version 1.25
# Using Apache/Test.pm version 1.31
ok 1
ok 2
ok 3
not ok 4
# Failed test 4 in t/hooks/authz.t at line 19
Failed 1/4 subtests

Test Summary Report
-------------------
t/hooks/authz (Wstat: 0 Tests: 4 Failed: 1)
Failed test: 4
Files=1, Tests=4, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.40 cusr 0.06 csys = 0.50 CPU)
Result: FAIL
Failed 1/1 test programs. 1/4 subtests failed.
[warning] server localhost:8529 shutdown
[ error] error running tests (please examine t/logs/error_log)
+--------------------------------------------------------+
| Please file a bug report: http://perl.apache.org/bugs/ |
+--------------------------------------------------------+
make: *** [run_tests] Error 1

This test attempts to:

ok ! GET_OK $location;

Fail to get the requested resource with no authorization information

my $rc = GET_RC $location;
ok $rc == 401;

Ensure the failure is due to lack of authorization

ok GET_OK $location, username => 'dougm', password => 'foo';

Ensure that, given the proper authorization credentials, the request
succeeds.

ok ! GET_OK $location, username => 'jobbob', password => 'whatever';

Ensure that, without a wrong authorization, the request fails

Now, this last step is the one failing - For some reason, I get this
in my logs/error_log:

127.0.0.1 - - [22/Dec/2008:10:34:54 -0600] "GET /index.html HTTP/1.0" 200 873
127.0.0.1 - - [22/Dec/2008:10:34:54 -0600] "GET /TestHooks__authz HTTP/1.0" 401 534
127.0.0.1 - - [22/Dec/2008:10:34:54 -0600] "GET /TestHooks__authz HTTP/1.0" 401 534
127.0.0.1 - - [22/Dec/2008:10:34:54 -0600] "GET /TestHooks__authz HTTP/1.0" 401 534
127.0.0.1 - dougm [22/Dec/2008:10:34:54 -0600] "GET /TestHooks__authz HTTP/1.0" 200 217
127.0.0.1 - dougm [22/Dec/2008:10:34:54 -0600] "GET /TestHooks__authz HTTP/1.0" 200 217

This is, either the test sends again the original authorization
information, or the server fails to forget it and process the new one.

Thank you for any insight.

Oh! I am not subscribed to the list, and I'm not the sole maintainer
for this package in Debian - please include the bug report's mail
address (509457@bugs.debian.org) in any replies.

Thanks,

[1] http://pkg-perl.alioth.debian.org/

[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509457

--
Gunnar Wolf - gwolf@gwolf.org - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF

Re: Bug#509457: [BUG] mod_perl2 test failures (when building

am 22.12.2008 22:14:00 von Niko Tyni

--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Dec 22, 2008 at 10:47:18AM -0600, Gunnar Wolf wrote:

> I am a member of the Debian pkg-perl group [1]. I stumbled upon a test
> failure when rebuilding - For further information on my build
> environment, please refer to the bug report in the Debian BTS [2].
>
> The test failure appears on hooks/authz.t:
>
> Test Summary Report
> -------------------
> t/hooks/authz (Wstat: 0 Tests: 4 Failed: 1)
> Failed test: 4

This broke when libwww-perl was upgraded from 5.813 to 5.820.
It still happens with the current version, 5.822.

This changelog entry seems relevant:

2008-09-24 Release 5.815
[...]
Also thanks to contributions by Bron Gondwana LWP's Basic/Digest
authenticate modules now registers handlers which allow them to
automatically fill in the Authorization headers without first taking
the round-trip of a 401 response when LWP knows the credentials for a
given realm.

My limited understanding of this is that it's a bug in LWP: the
new handler installed by LWP::Authen::Basic::authenticate() uses
$ua->credentials() instead of $ua->get_basic_credentials(). However,
the LWP::UserAgent documentation recommends that subclasses override
just get_basic_credentials(), and that's what Apache::TestRequest
currently does.

The attached patch works around the problem by providing a credentials()
wrapper too. It's probably not quite correct, but the tests pass with
this on both libwww-perl 5.813 and 5.822.
--
Niko Tyni ntyni@debian.org

--Nq2Wo0NMKNjxTN9z
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="apache-test-hack.patch"

Index: Apache-Test/lib/Apache/TestRequest.pm
============================================================ =======
--- Apache-Test/lib/Apache/TestRequest.pm (revision 28483)
+++ Apache-Test/lib/Apache/TestRequest.pm (working copy)
@@ -256,6 +256,11 @@
$self;
}

+sub credentials {
+ my $self = shift;
+ return $self->get_basic_credentials(@_);
+}
+
sub get_basic_credentials {
my($self, $realm, $uri, $proxy) = @_;


--Nq2Wo0NMKNjxTN9z--

Re: Bug#509457: [BUG] mod_perl2 test failures (when building Debianpackage)

am 22.12.2008 23:22:19 von Philip Gollucci

Niko Tyni wrote:
> On Mon, Dec 22, 2008 at 10:47:18AM -0600, Gunnar Wolf wrote:
> The attached patch works around the problem by providing a credentials()
> wrapper too. It's probably not quite correct, but the tests pass with
> this on both libwww-perl 5.813 and 5.822.

Committed revision 728811.
http://svn.apache.org/viewvc?rev=728811&view=rev

Thanks!

--
------------------------------------------------------------ ------------
Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354
Consultant - P6M7G8 Inc. http://p6m7g8.net
Senior System Admin - RideCharge, Inc. http://ridecharge.com
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.

Re: Bug#509457: [BUG] mod_perl2 test failures (when building Debianpackage)

am 23.12.2008 17:01:54 von Adam Prime

This is a multi-part message in MIME format.
--------------090408040903010408080807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Philip M. Gollucci wrote:
> Niko Tyni wrote:
>> On Mon, Dec 22, 2008 at 10:47:18AM -0600, Gunnar Wolf wrote:
>> The attached patch works around the problem by providing a credentials()
>> wrapper too. It's probably not quite correct, but the tests pass with
>> this on both libwww-perl 5.813 and 5.822.
>
> Committed revision 728811.
> http://svn.apache.org/viewvc?rev=728811&view=rev
>
> Thanks!
>

mod_perl 1 is affected by this as well. This is actually the same bug i
ran reported in this thread:

http://marc.info/?l=apache-modperl&m=122886595126742&w=2

Attached is a patch against the 1.x svn branch which resolves the
problem there as well using the same technique the Niko used for
TestRequest.pm

Adam


--------------090408040903010408080807
Content-Type: text/x-diff;
name="mp1.authz.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="mp1.authz.patch"

Index: t/internal/auth.t
============================================================ =======
--- t/internal/auth.t (revision 729005)
+++ t/internal/auth.t (working copy)
@@ -28,6 +28,7 @@
@creds = qw(dougm mod_perl);

sub get_basic_credentials { shift->creds }
+sub credentials { shift->creds }

sub creds {
shift;

--------------090408040903010408080807--

Re: Bug#509457: [BUG] mod_perl2 test failures (when building Debianpackage)

am 24.12.2008 02:03:51 von Philip Gollucci

Adam Prime wrote:
> mod_perl 1 is affected by this as well. This is actually the same bug i
> ran reported in this thread:

> Attached is a patch against the 1.x svn branch which resolves the
> problem there as well using the same technique the Niko used for
> TestRequest.pm
Committed 729185

http://svn.apache.org/viewvc?rev=729185&view=rev
--
------------------------------------------------------------ ------------
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C
Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354
Consultant - P6M7G8 Inc. http://p6m7g8.net
Director IT - RideCharge, Inc. http://ridecharge.com
Contractor - PositiveEnergyUSA http://positiveenergyusa.com
ASF Member - Apache Software Foundation http://apache.org
FreeBSD Committer - FreeBSD Foundation http://freebsd.org

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.