Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/librumphijack Make httpd create a pid file and use...



details:   https://anonhg.NetBSD.org/src/rev/cef66c50224f
branches:  trunk
changeset: 763641:cef66c50224f
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Tue Mar 29 15:43:45 2011 +0000

description:
Make httpd create a pid file and use that to kill the server in a controlled
manner (instead of indirectly through rump.halt).  Suggested by pooka@.

diffstat:

 tests/lib/librumphijack/t_tcpip.sh |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r f0a0121c663a -r cef66c50224f tests/lib/librumphijack/t_tcpip.sh
--- a/tests/lib/librumphijack/t_tcpip.sh        Tue Mar 29 13:55:37 2011 +0000
+++ b/tests/lib/librumphijack/t_tcpip.sh        Tue Mar 29 15:43:45 2011 +0000
@@ -1,4 +1,4 @@
-#       $NetBSD: t_tcpip.sh,v 1.8 2011/03/22 17:07:11 pooka Exp $
+#       $NetBSD: t_tcpip.sh,v 1.9 2011/03/29 15:43:45 jmmv Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,12 +38,10 @@
 {
 
        atf_check -s exit:0 ${rumpnetsrv} ${RUMP_SERVER}
-       # make sure clients die after we nuke the server
-       export RUMPHIJACK_RETRYCONNECT='die'
 
        # start bozo in daemon mode
        atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
-           /usr/libexec/httpd -b -s $(atf_get_srcdir)
+           /usr/libexec/httpd -P ./httpd.pid -b -s $(atf_get_srcdir)
 
        atf_check -s exit:0 -o file:"$(atf_get_srcdir)/netstat.expout" \
            rump.netstat -a
@@ -62,6 +60,11 @@
 http_cleanup()
 {
        rump.halt
+
+       if [ -f httpd.pid ]; then
+               kill -9 "$(cat httpd.pid)"
+               rm -f httpd.pid
+       fi
 }
 
 #



Home | Main Index | Thread Index | Old Index