Skip Menu |

This queue is for tickets about the Apache-Test CPAN distribution.

Report information
The Basics
Id: 41239
Status: resolved
Priority: 0/
Queue: Apache-Test

People
Owner: Nobody in particular
Requestors: alessio.palma [...] staff.dada.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: t/TEST -ping does not return a valid return code to the calling shell
"t/TEST -start" does not pass a return code to the calling shell. I mean: $ t/TEST -ping ... [warning] no server is running on localhost:18529 $ echo $? 0 $ t/TEST -start && t/TEST -ping ... [warning] server localhost:18529 running (pid=2639, version=Apache/2.0.58) $ echo $? 0 What about this ? 1174 else { 1175 warning "no server is running on $name"; - - - - - - - 8< - - - - - - +1176 exit_perl 0; - - - - - - - - - - - - - - - - - 1177 } ...
Can you post a more complete patch so I can understand exactly what you are asking for here? I was able to replicate your examples here but I'm not sure what you are suggesting as a fix, and why it is needed. On Wed Nov 26 08:46:26 2008, ozw1z5rd wrote: Show quoted text
> "t/TEST -start" does not pass a return code to the calling shell. > I mean: > > $ t/TEST -ping > ... > [warning] no server is running on localhost:18529 > > $ echo $? > 0 > > $ t/TEST -start && t/TEST -ping > ... > > [warning] server localhost:18529 running (pid=2639, version=Apache/2.0.58) > > $ echo $? > 0 > > What about this ? > > 1174 else { > 1175 warning "no server is running on $name"; > - - - - - - - 8< - - - - - - > +1176 exit_perl 0; > - - - - - - - - - - - - - - - - - > 1177 } > ... >
Without the patch I'm showing you, it's not possible to detect if the server is running or it is not just using t/TEST -ping from a sh script. The return code is always set to zero. --- lib/Apache/TestRun.pm 2007-11-14 07:44:36.000000000 +0100 +++ lib/Apache/TestRun.pm.2 2009-04-20 09:58:24.000000000 +0200 @@ -1173,6 +1173,7 @@ } else { warning "no server is running on $name"; + exit_perl 0; } return $exit; #means call exit() if true Using this I have: $ t/TEST -start [warning] setting ulimit to allow core files ... server localhost:8529 started $ t/TEST -ping ... $ echo $? 0 (it's running) $ t/TEST -stop ... [warning] server localhost:8529 shutdown $ t/TEST -ping ... $ echo $? 1 (it's not running)
Fix applied, revision 757344. Next release 1.31 will contain this fix.