LWP test script looses port number 
Author Message
 LWP test script looses port number

NT 4.0, SP 4, Intel
Perl 5.005_02 (ActiveState)
LibNet-1.0605
MIME-Base64-2.08
LibWWW-Perl-5.36

Most of the tests work but with local/http.t and robot/ua.t odd things
happen with the port numbers:

D:\w3mir\libwww-perl-5.36\t>perl test -v robot/ua local/http
robot/ua............1..7
Will access HTTP server at http://www.*-*-*.com/ :0/
not ok 1
not ok 2
not ok 3
ok 4
Terminating server...
not ok 5
ok 6
not ok 7
HTTP Server terminated
FAILED tests 1-3, 5, 7
        Failed 5/7 tests, 28.57% okay
local/http..........1..18
Will access HTTP server at http://www.*-*-*.com/
Bad request...
not ok 1
not ok 2
Simple echo...
not ok 3
not ok 4
Send file...
not ok 5
not ok 6
not ok 7
Check redirect...
Can't call method "is_redirect" on an undefined value at local/http.t
line 179, <
DAEMON> chunk 1.
not ok 8
HTTP Server terminated
dubious
        Test returned status 0 (wstat 9, 0x9)
DIED. FAILED tests 1-18
        Failed 18/18 tests, 0.00% okay
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
local/http.t      0     9    18   18 100.00%  1-18
robot/ua.t                    7    5  71.43%  1-3, 5, 7
Failed 2/2 test scripts, 0.00% okay. 23/25 subtests failed, 8.00% okay.

In robot/ua the daemon port number shows up as zero, which is a little
strange. No wonder the client has problems talking to it.
If I modify local/http to print out the result obtained by the client

print "Bad request...\n";
$req = new HTTP::Request GET => url("/not_found", $base);
$req->header(X_Foo => "Bar");
$res = $ua->request($req);
print $res->as_string;

I get
D:\w3mir\libwww-perl-5.36\t>perl test -v local/http
local/http..........1..18
Will access HTTP server at http://www.*-*-*.com/
Bad request...
500 (Internal Server Error) Can't connect to stsk.hhs.se:80 (Unknown
error), <DAE
MON> chunk 1.

It seems that the daemon is living on a non-standard port although no
port number is reported by $d->url.

So I add an explicit port number in both test scripts;

    my $d = new HTTP::Daemon Timeout => 10, LocalPort => 80;

and I get

D:\w3mir\libwww-perl-5.36\t>perl test -v robot/ua local/http
robot/ua............1..7
Will access HTTP server at http://www.*-*-*.com/ :0/
not ok 1
not ok 2
not ok 3
ok 4
Terminating server...
not ok 5
ok 6
not ok 7
HTTP Server terminated
FAILED tests 1-3, 5, 7
        Failed 5/7 tests, 28.57% okay
local/http..........1..18
Will access HTTP server at http://www.*-*-*.com/
Bad request...
ok 1
ok 2
Simple echo...
ok 3
ok 4
Send file...
ok 5
ok 6
ok 7
Check redirect...
not ok 8
ok 9
not ok 10
not ok 11
Check basic authorization...
ok 12
ok 13
ok 14
ok 15
Check proxy...
ok 16
Check POSTing...
ok 17
Terminating server...
ok 18
FAILED tests 8, 10-11
        Failed 3/18 tests, 83.33% okay
Failed Test  Status Wstat Total Fail  Failed  List of failed
------------------------------------------------------------------------
local/http.t                 18    3  16.67%  8, 10-11
robot/ua.t                    7    5  71.43%  1-3, 5, 7
Failed 2/2 test scripts, 0.00% okay. 8/25 subtests failed, 68.00% okay.

local/http now works except for the redirection, but the robot/ua daemon
still thinks it lives on port zero. So I change the port number to 80
for the clients

print "Will access HTTP server at $base\n";
$base =~ s!:\d+/$!:80/!; print "$base\n";

With the result

D:\w3mir\libwww-perl-5.36\t>perl test -v robot/ua
robot/ua............1..7
Will access HTTP server at http://www.*-*-*.com/ :0/
http://www.*-*-*.com/ :80/
ok 1
ok 2
ok 3
ok 4
Terminating server...
ok 5
Can't locate object method "netloc" via package " http://www.*-*-*.com/ :80/"
at robot
/ua.t line 129, <DAEMON> chunk 1.
dubious
        Test returned status 0 (wstat 9, 0x9)
DIED. FAILED tests 6-7
        Failed 2/7 tests, 71.43% okay
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
robot/ua.t        0     9     7    2  28.57%  6-7
Failed 1/1 test scripts, 0.00% okay. 2/7 subtests failed, 71.43% okay.

Better, but far from good.

I'm stumped! Any idea what the problem is?

/Sune
--

Stockholm School of Economics      | Phone: + 46 8 736 92 39
Box 6501, 113 83 Stockholm, Sweden | http://www.*-*-*.com/
http://www.*-*-*.com/ ;          | http://www.*-*-*.com/



Sat, 14 Apr 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. What port number is used when using POST

2. getting a free port number?

3. perl to get port number

4. how to test for available port in perl ?

5. tests failing on HP720 port

6. Testing open ports

7. need help in sockets - test a port is all

8. lwp: number of connections & timeout

9. LWP::UserAgent install ONE test failure in html/form

10. My solution to LWP robot/ua make test failure

11. LWP fails tests (perl5.8.0/OS X)

12. "make test" problem in LWP (libwww)

 

 
Powered by phpBB® Forum Software