Re: perl-framework server startup

2002-01-17 Thread Stas Bekman
On Wed, 16 Jan 2002, Rodent of Unusual Size wrote:

> Stas Bekman wrote:
> > 
> > But which bit is safe to OR with? 0x10 or 0x1000 as you've suggested?
> 
> I would say 0x?000 -- values in the 0x01-0xff range get set from signals
> and errno, n'est-çe pas?

I've played with the returned status, so here is what I saw. 

If you want to tell shell that the program has failed, you must return a
status with at least one bit in the 0x01-0xff range set. But if you set
any bits on the higher bits, it seems that shell masks these off. So I'm
not sure if you ever get to see them.

Assuming that modperl/readline test fails (without setting $? from the 
test, so the default 1 is applied) and I run:

  % t/TEST -v modperl/readline || echo "Failed $?"

I get:

Failed 1

and no high bits here. This is with the patch below. Please play with this 
patch and tell me whether it does what you want, and if not how we should 
change it.

Index: Apache-Test/lib/Apache/TestRun.pm
===
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.85
diff -u -r1.85 TestRun.pm
--- Apache-Test/lib/Apache/TestRun.pm   16 Jan 2002 17:05:20 -  1.85
+++ Apache-Test/lib/Apache/TestRun.pm   17 Jan 2002 03:34:05 -
@@ -258,11 +258,17 @@
 
 my($server, $opts) = ($self->{server}, $self->{opts});
 
+# this handler gets usually invoked when one or more tests fail
+# in Test::Harness::runtests()
 $SIG{__DIE__} = sub {
 return unless $_[0] =~ /^Failed/i; #dont catch Test::ok failures
 $server->stop(1) if $opts->{'start-httpd'};
 $server->failed_msg("error running tests");
-exit_perl 0;
+
+# logically OR 0x1000 to the status, so we can distinguish
+# harness failure from tests failure. it's possible that the
+# failing test won't set a proper $?
+exit_shell ( $? || 1 ) | 0x1000 ;
 };
 
 $SIG{INT} = sub {

_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Re: What makes the server die with 255?

2002-01-17 Thread Doug MacEachern
On Wed, 16 Jan 2002, Sander Temme wrote:

> Hi all, 
> 
> Built and ran HEAD on Darwin 5.2, and ran the httpd-test perl-framework.
> This dies with the following protest:
> 
> server has died with status 255 (please examine t/logs/error_log)
> Terminated
> 
> The log says:
> 
> [batmobile:perl-framework] sctemme$cat t/logs/error_log
> [Wed Jan 16 15:44:04 2002] [notice] Digest: generating secret for digest
> authentication ...
> [Wed Jan 16 15:44:04 2002] [notice] Digest: done

sounds like mod_auth_digest is broken.  trying building httpd with
--disable-auth_digest and see if things are happier.





Re: What makes the server die with 255?

2002-01-17 Thread Dirk-Willem van Gulik


On Wed, 16 Jan 2002, Sander Temme wrote:

> server has died with status 255 (please examine t/logs/error_log)
> Terminated

Might be an exit(-1) you are looking for - rather than an exit(255).

Dw



Re: What makes the server die with 255?

2002-01-17 Thread Sander Temme
Here, let me commit the faux pas of answering myself:

> server has died with status 255 (please examine t/logs/error_log)
> Terminated

Infuriatingly, the server runs and does answer requests.

And, 

% t/TEST -run-tests

Works fine (aside from failing a few tests). As long as it doesn't need to
start the server, the test harness seems fine. Where shall I start looking?

S.

-- 
Covalent Technologies [EMAIL PROTECTED]
Engineering groupVoice: (415) 536 5214
645 Howard St. Fax: (415) 536 5210
San Francisco CA 94105

   PGP Fingerprint: 1E74 4E58 DFAC 2CF5 6A03  5531 AFB1 96AF B584 0AB1

===
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message
===