Testing LWP 5.64, perl 5.6.1 and up-to-date CPAN prerequisites gets the following
failures:
live/activestate......EOF instead of reponse status line at
../blib/lib/Net/HTTP/Methods.pm line 299.
live/activestate......dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-2
Failed 2/2 tests, 0.00% okay
live/jigsaw-auth-b....ok
live/jigsaw-auth-d....ok
live/jigsaw-chunk.....Use of uninitialized value in string eq at live/jigsaw-chunk.t
line 14.
live/jigsaw-chunk.....FAILED test 2
Failed 1/5 tests, 80.00% okay
live/jigsaw-md5.......FAILED test 2
Failed 1/2 tests, 50.00% okay
live/jigsaw-neg.......ok
live/jigsaw-te........skipped test on this platform
live/validator........ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
live/activestate.t 255 65280 2 2 100.00% 1-2
live/jigsaw-chunk.t 5 1 20.00% 2
live/jigsaw-md5.t 2 1 50.00% 2
1 test skipped.
I'm currently investigating the activestate.t failure. Part of it is
that the received headers are slightly different than what was
expected. This may be because of my proxy.
DB<8> p $buf
TRACE /libwww-perl HTTP/1.0
Accept: */*
Accept-Language: no,en
Cache-Control: max-age=259200
Connection: keep-alive
Host: ftp.activestate.com
User-Agent: Mozilla/5.0
Via: 1.1 e-smith.cbrady.tzo.com:3128 (Squid/2.3.STABLE4)
X-Forwarded-For: 192.168.117.84
DB<9> n
main::(t/live/activestate.t:34): $err++ unless $buf eq "TRACE /libwww-perl
HTTP/1.1
main::(t/live/activestate.t:35): Accept: */*
main::(t/live/activestate.t:36): Accept-Language: no,en
main::(t/live/activestate.t:37): Host: ftp.activestate.com:80
main::(t/live/activestate.t:38): User-Agent: Mozilla/5.0
as proxies are not uncommon, you may wish to loosen up the test a bit:
$buf =~ m{^TRACE /libwww-perl HTTP/1.\d$}m;
$buf =~ m{^Accept: \*/\*$}m;
$buf =~ m{^Accept-Language: no,en$}m;
$buf =~ m{^Host: ftp.activestate.com(:80)?$}m;
$buf =~ m{^User-Agent: Mozilla/5.0$}m;
the second problem is because my proxy is speaking HTTP/1.0 for some
reason it does not support KeepAlive. Thus the second connection
attempt fails.
ok 1
EOF instead of reponse status line at blib/lib/Net/HTTP/Methods.pm line 299.
the configuration of the proxy is out of my control, as it may be for
other people. In which case it may be wise to simply skip the
KeepAlive test if there's a proxy involved.
Here's a patch to do all that. Plus a small nit, printing
things to STDOUT ist verboten unless there's a # in front.
Test::Harness might misinterpret it otherwise.
--- t/live/activestate.t 2002/03/23 01:44:03 1.1
+++ t/live/activestate.t 2002/03/23 01:54:26
@@ -3,7 +3,7 @@
use strict;
use Net::HTTP;
-
+my $http_version;
my $s = Net::HTTP->new(Host => "ftp.activestate.com",
KeepAlive => 1,
Timeout => 15,
@@ -11,13 +11,18 @@
MaxLineLength => 512) || die "$@";
for (1..2) {
+ if( defined $http_version && $http_version < 1.1 ) {
+ print "ok $_ # skip: server using HTTP/$http_version can't do keep-alive\n";
+ next;
+ }
+
$s->write_request(TRACE => "/libwww-perl",
'User-Agent' => 'Mozilla/5.0',
'Accept-Language' => 'no,en',
Accept => '*/*');
my($code, $mess, %h) = $s->read_response_headers;
- print "$code $mess\n";
+ print "# $code $mess\n";
my $err;
$err++ unless $code eq "200";
$err++ unless $h{'Content-Type'} eq "message/http";
@@ -31,13 +36,13 @@
}
$buf =~ s/\r//g;
- $err++ unless $buf eq "TRACE /libwww-perl HTTP/1.1
-Accept: */*
-Accept-Language: no,en
-Host: ftp.activestate.com:80
-User-Agent: Mozilla/5.0
+ $err++ unless $buf =~ m{^TRACE /libwww-perl HTTP/(1.\d)$}m;
+ $http_version = $1;
-";
+ $err++ unless $buf =~ m{^Accept: \*/\*$}m;
+ $err++ unless $buf =~ m{^Accept-Language: no,en$}m;
+ $err++ unless $buf =~ m{^Host: ftp.activestate.com(:80)?$}m;
+ $err++ unless $buf =~ m{^User-Agent: Mozilla/5.0$}m;
print "not " if $err;
print "ok $_\n";
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
But let us not dwell on such unhappy things. Let us instead think of
pancakes--moist, delicious pancakes, dripping with syrup and hot butter.
-- http://www.angryflower.com/timelo.gif