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