comparison tests/test-push-http @ 6167:f53b9a383476

tests: easier hg serve error diagnosis
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sat, 23 Feb 2008 11:18:34 +0100
parents 8051549afb32
children 6c82beaaa11a
comparison
equal deleted inserted replaced
6166:f857eac30cd5 6167:f53b9a383476
11 hg clone test test2 11 hg clone test test2
12 cd test2 12 cd test2
13 echo a >> a 13 echo a >> a
14 hg ci -mb -d '0 0' 14 hg ci -mb -d '0 0'
15 15
16 req() {
17 hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
18 cat hg.pid >> $DAEMON_PIDS
19 hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
20 kill `cat hg.pid`
21 echo % serve errors
22 cat errors.log
23 }
24
16 cd ../test 25 cd ../test
17 26
18 echo % expect ssl error 27 echo % expect ssl error
19 hg serve -p $HGPORT -d --pid-file=hg.pid 28 req
20 cat hg.pid >> $DAEMON_PIDS
21 hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
22 kill `cat hg.pid`
23 29
24 echo % expect authorization error 30 echo % expect authorization error
25 echo '[web]' > .hg/hgrc 31 echo '[web]' > .hg/hgrc
26 echo 'push_ssl = false' >> .hg/hgrc 32 echo 'push_ssl = false' >> .hg/hgrc
27 hg serve -p $HGPORT -d --pid-file=hg.pid 33 req
28 cat hg.pid >> $DAEMON_PIDS
29 hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
30 kill `cat hg.pid`
31 34
32 echo % expect authorization error: must have authorized user 35 echo % expect authorization error: must have authorized user
33 echo 'allow_push = unperson' >> .hg/hgrc 36 echo 'allow_push = unperson' >> .hg/hgrc
34 hg serve -p $HGPORT -d --pid-file=hg.pid 37 req
35 cat hg.pid >> $DAEMON_PIDS
36 hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
37 kill `cat hg.pid`
38 38
39 echo % expect success 39 echo % expect success
40 echo 'allow_push = *' >> .hg/hgrc 40 echo 'allow_push = *' >> .hg/hgrc
41 echo '[hooks]' >> .hg/hgrc 41 echo '[hooks]' >> .hg/hgrc
42 echo 'changegroup = python ../printenv.py changegroup 0 ../urls' >> .hg/hgrc 42 echo 'changegroup = python ../printenv.py changegroup 0 ../urls' >> .hg/hgrc
43 hg serve -p $HGPORT -d --pid-file=hg.pid 43 req
44 cat hg.pid >> $DAEMON_PIDS
45 hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
46 kill `cat hg.pid`
47 hg rollback
48 44
49 cat ../urls 45 cat ../urls
50 46
47 hg rollback
51 echo % expect authorization error: all users denied 48 echo % expect authorization error: all users denied
52 echo '[web]' > .hg/hgrc 49 echo '[web]' > .hg/hgrc
53 echo 'push_ssl = false' >> .hg/hgrc 50 echo 'push_ssl = false' >> .hg/hgrc
54 echo 'deny_push = *' >> .hg/hgrc 51 echo 'deny_push = *' >> .hg/hgrc
55 hg serve -p $HGPORT -d --pid-file=hg.pid 52 req
56 cat hg.pid >> $DAEMON_PIDS
57 hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
58 kill `cat hg.pid`
59 53
60 echo % expect authorization error: some users denied, users must be authenticated 54 echo % expect authorization error: some users denied, users must be authenticated
61 echo 'deny_push = unperson' >> .hg/hgrc 55 echo 'deny_push = unperson' >> .hg/hgrc
62 hg serve -p $HGPORT -d --pid-file=hg.pid 56 req
63 cat hg.pid >> $DAEMON_PIDS
64 hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
65 kill `cat hg.pid`