##// END OF EJS Templates
tests: unify test-bad-pull
Martin Geisler -
r11859:f4817803 default
parent child Browse files
Show More
@@ -1,30 +1,34 b''
1 #!/bin/sh
1 $ hg clone http://localhost:$HGPORT/ copy
2
2 abort: error: Connection refused
3 hg clone http://localhost:$HGPORT/ copy
4 echo $?
5 test -d copy || echo copy: No such file or directory
6
3
7 cat > dumb.py <<EOF
4 $ echo $?
8 import BaseHTTPServer, SimpleHTTPServer, os, signal
5 0
9
6
10 def run(server_class=BaseHTTPServer.HTTPServer,
7 $ test -d copy || echo copy: No such file or directory
11 handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
8 copy: No such file or directory
12 server_address = ('localhost', int(os.environ['HGPORT']))
13 httpd = server_class(server_address, handler_class)
14 httpd.serve_forever()
15
9
16 signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
10 $ cat > dumb.py <<EOF
17 run()
11 > import BaseHTTPServer, SimpleHTTPServer, os, signal
18 EOF
12 > def run(server_class=BaseHTTPServer.HTTPServer,
19
13 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
20 python dumb.py 2>/dev/null &
14 > server_address = ('localhost', int(os.environ['HGPORT']))
21 echo $! >> $DAEMON_PIDS
15 > httpd = server_class(server_address, handler_class)
16 > httpd.serve_forever()
17 > signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
18 > run()
19 > EOF
22
20
23 # give the server some time to start running
21 $ python dumb.py 2>/dev/null &
24 sleep 1
22 $ echo $! >> $DAEMON_PIDS
23
24 give the server some time to start running
25
26 $ sleep 1
25
27
26 hg clone http://localhost:$HGPORT/foo copy2 2>&1 | \
28 $ hg clone http://localhost:$HGPORT/foo copy2 2>&1
27 sed -e 's/404.*/404/' -e 's/Date:.*/Date:/'
29 abort: HTTP Error 404: .*
28 echo $?
29
30
30 kill $!
31 $ echo $?
32 0
33
34 $ kill $!
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now