##// END OF EJS Templates
test-push-http: include exit status of hg push
Yuya Nishihara -
r17455:2212af23 default
parent child Browse files
Show More
@@ -1,123 +1,130 b''
1 1 $ "$TESTDIR/hghave" serve || exit 80
2 2
3 3 $ hg init test
4 4 $ cd test
5 5 $ echo a > a
6 6 $ hg ci -Ama
7 7 adding a
8 8 $ cd ..
9 9 $ hg clone test test2
10 10 updating to branch default
11 11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 12 $ cd test2
13 13 $ echo a >> a
14 14 $ hg ci -mb
15 15 $ req() {
16 16 > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
17 17 > cat hg.pid >> $DAEMON_PIDS
18 18 > hg --cwd ../test2 push http://localhost:$HGPORT/
19 > exitstatus=$?
19 20 > "$TESTDIR/killdaemons.py"
20 21 > echo % serve errors
21 22 > cat errors.log
23 > return $exitstatus
22 24 > }
23 25 $ cd ../test
24 26
25 27 expect ssl error
26 28
27 29 $ req
28 30 pushing to http://localhost:$HGPORT/
29 31 searching for changes
30 32 remote: ssl required
31 33 remote: ssl required
32 34 updating cb9a9f314b8b to public failed!
33 35 % serve errors
36 [1]
34 37
35 38 expect authorization error
36 39
37 40 $ echo '[web]' > .hg/hgrc
38 41 $ echo 'push_ssl = false' >> .hg/hgrc
39 42 $ req
40 43 pushing to http://localhost:$HGPORT/
41 44 searching for changes
42 45 abort: authorization failed
43 46 % serve errors
47 [255]
44 48
45 49 expect authorization error: must have authorized user
46 50
47 51 $ echo 'allow_push = unperson' >> .hg/hgrc
48 52 $ req
49 53 pushing to http://localhost:$HGPORT/
50 54 searching for changes
51 55 abort: authorization failed
52 56 % serve errors
57 [255]
53 58
54 59 expect success
55 60
56 61 $ echo 'allow_push = *' >> .hg/hgrc
57 62 $ echo '[hooks]' >> .hg/hgrc
58 63 $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc
59 64 $ req
60 65 pushing to http://localhost:$HGPORT/
61 66 searching for changes
62 67 remote: adding changesets
63 68 remote: adding manifests
64 69 remote: adding file changes
65 70 remote: added 1 changesets with 1 changes to 1 files
66 71 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob)
67 72 % serve errors
68 73 $ hg rollback
69 74 repository tip rolled back to revision 0 (undo serve)
70 75
71 76 expect success, server lacks the httpheader capability
72 77
73 78 $ CAP=httpheader
74 79 $ . "$TESTDIR/notcapable"
75 80 $ req
76 81 pushing to http://localhost:$HGPORT/
77 82 searching for changes
78 83 remote: adding changesets
79 84 remote: adding manifests
80 85 remote: adding file changes
81 86 remote: added 1 changesets with 1 changes to 1 files
82 87 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob)
83 88 % serve errors
84 89 $ hg rollback
85 90 repository tip rolled back to revision 0 (undo serve)
86 91
87 92 expect success, server lacks the unbundlehash capability
88 93
89 94 $ CAP=unbundlehash
90 95 $ . "$TESTDIR/notcapable"
91 96 $ req
92 97 pushing to http://localhost:$HGPORT/
93 98 searching for changes
94 99 remote: adding changesets
95 100 remote: adding manifests
96 101 remote: adding file changes
97 102 remote: added 1 changesets with 1 changes to 1 files
98 103 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob)
99 104 % serve errors
100 105 $ hg rollback
101 106 repository tip rolled back to revision 0 (undo serve)
102 107
103 108 expect authorization error: all users denied
104 109
105 110 $ echo '[web]' > .hg/hgrc
106 111 $ echo 'push_ssl = false' >> .hg/hgrc
107 112 $ echo 'deny_push = *' >> .hg/hgrc
108 113 $ req
109 114 pushing to http://localhost:$HGPORT/
110 115 searching for changes
111 116 abort: authorization failed
112 117 % serve errors
118 [255]
113 119
114 120 expect authorization error: some users denied, users must be authenticated
115 121
116 122 $ echo 'deny_push = unperson' >> .hg/hgrc
117 123 $ req
118 124 pushing to http://localhost:$HGPORT/
119 125 searching for changes
120 126 abort: authorization failed
121 127 % serve errors
128 [255]
122 129
123 130 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now