##// END OF EJS Templates
tests: use killdaemons in hgweb tests...
Mads Kiilerich -
r7428:fdcde929 default
parent child Browse files
Show More
@@ -1,44 +1,44 b''
1 1 #!/bin/sh
2 2 # Some tests for hgweb. Tests static files, plain files and different 404's.
3 3
4 4 hg init test
5 5 cd test
6 6 mkdir da
7 7 echo foo > da/foo
8 8 echo foo > foo
9 9 hg ci -Ambase -d '0 0'
10 10 hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
11 11 cat hg.pid >> $DAEMON_PIDS
12 12 echo % manifest
13 13 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw')
14 14 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/da?style=raw')
15 15
16 16 echo % plain file
17 17 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?style=raw'
18 18
19 19 echo % should give a 404 - static file that does not exist
20 20 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/bogus'
21 21
22 22 echo % should give a 404 - bad revision
23 23 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/spam/foo?style=raw'
24 24
25 25 echo % should give a 400 - bad command
26 26 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?cmd=spam&style=raw' | sed 's/400.*/400/'
27 27
28 28 echo % should give a 404 - file does not exist
29 29 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork?style=raw'
30 30 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork'
31 31 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/bork?style=raw'
32 32
33 33 echo % stop and restart
34 kill `cat hg.pid`
34 "$TESTDIR/killdaemons.py"
35 35 hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
36 36 cat hg.pid >> $DAEMON_PIDS
37 37 # Test the access/error files are opened in append mode
38 38 python -c "print len(file('access.log').readlines()), 'log lines written'"
39 39
40 40 echo % static file
41 41 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/style-gitweb.css'
42 42
43 43 echo % errors
44 44 cat errors.log
@@ -1,34 +1,34 b''
1 1 echo % setting up repo
2 2 hg init test
3 3 cd test
4 4 echo a > a
5 5 echo b > b
6 6 hg ci -Ama
7 7
8 8 echo % change permissions for git diffs
9 9 chmod 755 a
10 10 hg ci -Amb
11 11
12 12 echo % set up hgweb
13 13 hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
14 14 cat hg.pid >> $DAEMON_PIDS
15 15
16 16 echo % revision
17 17 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
18 18
19 19 echo % diff removed file
20 20 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
21 21
22 22 echo % set up hgweb with git diffs
23 kill `cat hg.pid`
23 "$TESTDIR/killdaemons.py"
24 24 hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
25 25 cat hg.pid >> $DAEMON_PIDS
26 26
27 27 echo % revision
28 28 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
29 29
30 30 echo % diff removed file
31 31 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
32 32
33 33 echo % errors
34 34 cat errors.log
General Comments 0
You need to be logged in to leave comments. Login now