diff tests/test-bad-pull.t @ 23048:ee5f834077be stable

merge default into stable for 3.2 freeze
author Matt Mackall <mpm@selenic.com>
date Sat, 18 Oct 2014 18:04:31 -0500
parents 10116463b0b1
children 4d2b9b304ad0
line wrap: on
line diff
--- a/tests/test-bad-pull.t	Fri Oct 10 11:38:00 2014 -0500
+++ b/tests/test-bad-pull.t	Sat Oct 18 18:04:31 2014 -0500
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" serve || exit 80
+#require serve killdaemons
 
 #if windows
   $ hg clone http://localhost:$HGPORT/ copy
@@ -13,21 +13,9 @@
   $ test -d copy
   [1]
 
-  $ cat > dumb.py <<EOF
-  > import BaseHTTPServer, SimpleHTTPServer, os, signal
-  > def run(server_class=BaseHTTPServer.HTTPServer,
-  >         handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
-  >     server_address = ('localhost', int(os.environ['HGPORT']))
-  >     httpd = server_class(server_address, handler_class)
-  >     open("listening", "w")
-  >     httpd.handle_request()
-  > run()
-  > EOF
-
-  $ python dumb.py 2> log &
-  $ P=$!
-  $ while [ ! -f listening ]; do sleep 0; done
+  $ python "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid
+  $ cat dumb.pid >> $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/foo copy2
   abort: HTTP Error 404: * (glob)
   [255]
-  $ wait $P
+  $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS