author | Thomas Arendsen Hein <thomas@intevation.de> |
Mon, 17 Dec 2007 13:45:30 +0100 | |
changeset 5648 | 2079faccb408 |
parent 5580 | f429e0e067a8 |
child 5690 | 1b365c5723bc |
permissions | -rwxr-xr-x |
3942 | 1 |
#!/bin/sh |
5580
f429e0e067a8
Fix style nit and add some comments to tests.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5564
diff
changeset
|
2 |
# Some tests for hgweb. Tests static files, plain files and different 404's. |
3942 | 3 |
|
4 |
hg init test |
|
5 |
cd test |
|
6 |
mkdir da |
|
7 |
echo foo > da/foo |
|
8 |
echo foo > foo |
|
9 |
hg ci -Ambase -d '0 0' |
|
5384
e3a0c092b4e2
Allow tests to run in parallel.
Bryan O'Sullivan <bos@serpentine.com>
parents:
3942
diff
changeset
|
10 |
hg serve -p $HGPORT -d --pid-file=hg.pid |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
11 |
cat hg.pid >> $DAEMON_PIDS |
3942 | 12 |
echo % manifest |
5384
e3a0c092b4e2
Allow tests to run in parallel.
Bryan O'Sullivan <bos@serpentine.com>
parents:
3942
diff
changeset
|
13 |
("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw') |
e3a0c092b4e2
Allow tests to run in parallel.
Bryan O'Sullivan <bos@serpentine.com>
parents:
3942
diff
changeset
|
14 |
("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/da?style=raw') |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
15 |
|
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
16 |
echo % plain file |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
17 |
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?style=raw' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
18 |
|
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
19 |
echo % should give a 404 - static file that does not exist |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
20 |
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/bogus' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
21 |
|
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
22 |
echo % should give a 404 - bad revision |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
23 |
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/spam/foo?style=raw' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
24 |
|
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
25 |
echo % should give a 400 - bad command |
5564
b4af2dd9868a
hgweb: account for Python 2.4 in one test
Bryan O'Sullivan <bos@serpentine.com>
parents:
5561
diff
changeset
|
26 |
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?cmd=spam&style=raw' | sed 's/400.*/400/' |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
27 |
|
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
28 |
echo % should give a 404 - file does not exist |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
29 |
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork?style=raw' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
30 |
|
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
31 |
echo % static file |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
5384
diff
changeset
|
32 |
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/style-gitweb.css' |