##// END OF EJS Templates
test-push-http: use killdaemons.py instead of kill to avoid test unreliability
Gilles Moris -
r13449:8b1125eb stable
parent child Browse files
Show More
@@ -1,87 +1,87 b''
1
1
2 $ hg init test
2 $ hg init test
3 $ cd test
3 $ cd test
4 $ echo a > a
4 $ echo a > a
5 $ hg ci -Ama
5 $ hg ci -Ama
6 adding a
6 adding a
7 $ cd ..
7 $ cd ..
8 $ hg clone test test2
8 $ hg clone test test2
9 updating to branch default
9 updating to branch default
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 $ cd test2
11 $ cd test2
12 $ echo a >> a
12 $ echo a >> a
13 $ hg ci -mb
13 $ hg ci -mb
14 $ req() {
14 $ req() {
15 > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
15 > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
16 > cat hg.pid >> $DAEMON_PIDS
16 > cat hg.pid >> $DAEMON_PIDS
17 > hg --cwd ../test2 push http://localhost:$HGPORT/
17 > hg --cwd ../test2 push http://localhost:$HGPORT/
18 > kill `cat hg.pid`
18 > "$TESTDIR/killdaemons.py"
19 > echo % serve errors
19 > echo % serve errors
20 > cat errors.log
20 > cat errors.log
21 > }
21 > }
22 $ cd ../test
22 $ cd ../test
23
23
24 expect ssl error
24 expect ssl error
25
25
26 $ req
26 $ req
27 pushing to http://localhost:$HGPORT/
27 pushing to http://localhost:$HGPORT/
28 searching for changes
28 searching for changes
29 remote: ssl required
29 remote: ssl required
30 % serve errors
30 % serve errors
31
31
32 expect authorization error
32 expect authorization error
33
33
34 $ echo '[web]' > .hg/hgrc
34 $ echo '[web]' > .hg/hgrc
35 $ echo 'push_ssl = false' >> .hg/hgrc
35 $ echo 'push_ssl = false' >> .hg/hgrc
36 $ req
36 $ req
37 pushing to http://localhost:$HGPORT/
37 pushing to http://localhost:$HGPORT/
38 searching for changes
38 searching for changes
39 abort: authorization failed
39 abort: authorization failed
40 % serve errors
40 % serve errors
41
41
42 expect authorization error: must have authorized user
42 expect authorization error: must have authorized user
43
43
44 $ echo 'allow_push = unperson' >> .hg/hgrc
44 $ echo 'allow_push = unperson' >> .hg/hgrc
45 $ req
45 $ req
46 pushing to http://localhost:$HGPORT/
46 pushing to http://localhost:$HGPORT/
47 searching for changes
47 searching for changes
48 abort: authorization failed
48 abort: authorization failed
49 % serve errors
49 % serve errors
50
50
51 expect success
51 expect success
52
52
53 $ echo 'allow_push = *' >> .hg/hgrc
53 $ echo 'allow_push = *' >> .hg/hgrc
54 $ echo '[hooks]' >> .hg/hgrc
54 $ echo '[hooks]' >> .hg/hgrc
55 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup 0' >> .hg/hgrc
55 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup 0' >> .hg/hgrc
56 $ req
56 $ req
57 pushing to http://localhost:$HGPORT/
57 pushing to http://localhost:$HGPORT/
58 searching for changes
58 searching for changes
59 remote: adding changesets
59 remote: adding changesets
60 remote: adding manifests
60 remote: adding manifests
61 remote: adding file changes
61 remote: adding file changes
62 remote: added 1 changesets with 1 changes to 1 files
62 remote: added 1 changesets with 1 changes to 1 files
63 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob)
63 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob)
64 % serve errors
64 % serve errors
65 $ hg rollback
65 $ hg rollback
66 repository tip rolled back to revision 0 (undo serve)
66 repository tip rolled back to revision 0 (undo serve)
67 working directory now based on revision 0
67 working directory now based on revision 0
68
68
69 expect authorization error: all users denied
69 expect authorization error: all users denied
70
70
71 $ echo '[web]' > .hg/hgrc
71 $ echo '[web]' > .hg/hgrc
72 $ echo 'push_ssl = false' >> .hg/hgrc
72 $ echo 'push_ssl = false' >> .hg/hgrc
73 $ echo 'deny_push = *' >> .hg/hgrc
73 $ echo 'deny_push = *' >> .hg/hgrc
74 $ req
74 $ req
75 pushing to http://localhost:$HGPORT/
75 pushing to http://localhost:$HGPORT/
76 searching for changes
76 searching for changes
77 abort: authorization failed
77 abort: authorization failed
78 % serve errors
78 % serve errors
79
79
80 expect authorization error: some users denied, users must be authenticated
80 expect authorization error: some users denied, users must be authenticated
81
81
82 $ echo 'deny_push = unperson' >> .hg/hgrc
82 $ echo 'deny_push = unperson' >> .hg/hgrc
83 $ req
83 $ req
84 pushing to http://localhost:$HGPORT/
84 pushing to http://localhost:$HGPORT/
85 searching for changes
85 searching for changes
86 abort: authorization failed
86 abort: authorization failed
87 % serve errors
87 % serve errors
General Comments 0
You need to be logged in to leave comments. Login now