##// END OF EJS Templates
tests: fix shutdown race in test-hgweb-raw
Matt Mackall -
r16298:0eefd118 stable
parent child Browse files
Show More
@@ -1,59 +1,58
1 1 $ "$TESTDIR/hghave" serve || exit 80
2 2
3 3 Test raw style of hgweb
4 4
5 5 $ hg init test
6 6 $ cd test
7 7 $ mkdir sub
8 8 $ cat >'sub/some "text".txt' <<ENDSOME
9 9 > This is just some random text
10 10 > that will go inside the file and take a few lines.
11 11 > It is very boring to read, but computers don't
12 12 > care about things like that.
13 13 > ENDSOME
14 14 $ hg add 'sub/some "text".txt'
15 15 warning: filename contains '"', which is reserved on Windows: 'sub/some "text".txt'
16 16 $ hg commit -d "1 0" -m "Just some text"
17 17
18 18 $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
19 19
20 20 $ cat hg.pid >> $DAEMON_PIDS
21 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
22 $ sleep 5
23 $ kill `cat hg.pid`
24 $ sleep 1 # wait for server to scream and die
21 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt
22
23 $ while kill `cat hg.pid` 2>/dev/null; do true; done
24
25 25 $ cat getoutput.txt
26 26 200 Script output follows
27 27 content-type: application/binary
28 28 content-length: 157
29 29 content-disposition: inline; filename="some \"text\".txt"
30 30
31 31 This is just some random text
32 32 that will go inside the file and take a few lines.
33 33 It is very boring to read, but computers don't
34 34 care about things like that.
35 35 $ cat access.log error.log
36 36 127.0.0.1 - - [*] "GET /?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw HTTP/1.1" 200 - (glob)
37 37
38 38 $ rm access.log error.log
39 39 $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid \
40 40 > --config web.guessmime=True
41 41
42 42 $ cat hg.pid >> $DAEMON_PIDS
43 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
44 $ sleep 5
45 $ kill `cat hg.pid`
46 $ sleep 1 # wait for server to scream and die
43 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt
44 $ while kill `cat hg.pid` 2>/dev/null; do true; done
45
47 46 $ cat getoutput.txt
48 47 200 Script output follows
49 48 content-type: text/plain; charset="ascii"
50 49 content-length: 157
51 50 content-disposition: inline; filename="some \"text\".txt"
52 51
53 52 This is just some random text
54 53 that will go inside the file and take a few lines.
55 54 It is very boring to read, but computers don't
56 55 care about things like that.
57 56 $ cat access.log error.log
58 57 127.0.0.1 - - [*] "GET /?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw HTTP/1.1" 200 - (glob)
59 58
General Comments 0
You need to be logged in to leave comments. Login now