Show More
@@ -1,203 +1,203 b'' | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | This test checks behavior related to bundle1 that changed or is likely |
|
4 | 4 | to change with bundle2. Feel free to factor out any part of the test |
|
5 | 5 | which does not need to exist to keep bundle1 working. |
|
6 | 6 | |
|
7 | 7 | $ cat << EOF >> $HGRCPATH |
|
8 | 8 | > [devel] |
|
9 | 9 | > # This test is dedicated to interaction through old bundle |
|
10 | 10 | > legacy.exchange = bundle1 |
|
11 | 11 | > EOF |
|
12 | 12 | |
|
13 | 13 | $ hg init test |
|
14 | 14 | $ cd test |
|
15 | 15 | $ echo a > a |
|
16 | 16 | $ hg ci -Ama |
|
17 | 17 | adding a |
|
18 | 18 | $ cd .. |
|
19 | 19 | $ hg clone test test2 |
|
20 | 20 | updating to branch default |
|
21 | 21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
22 | 22 | $ cd test2 |
|
23 | 23 | $ echo a >> a |
|
24 | 24 | $ hg ci -mb |
|
25 | 25 | $ req() { |
|
26 | 26 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
27 | 27 | > cat hg.pid >> $DAEMON_PIDS |
|
28 | 28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
29 | 29 | > exitstatus=$? |
|
30 | 30 | > killdaemons.py |
|
31 | 31 | > echo % serve errors |
|
32 | 32 | > cat errors.log |
|
33 | 33 | > return $exitstatus |
|
34 | 34 | > } |
|
35 | 35 | $ cd ../test |
|
36 | 36 | |
|
37 | 37 | expect ssl error |
|
38 | 38 | |
|
39 | 39 | $ req |
|
40 | 40 | pushing to http://localhost:$HGPORT/ |
|
41 | 41 | searching for changes |
|
42 | 42 | abort: HTTP Error 403: ssl required |
|
43 | 43 | % serve errors |
|
44 | 44 | [255] |
|
45 | 45 | |
|
46 | 46 | expect authorization error |
|
47 | 47 | |
|
48 | 48 | $ echo '[web]' > .hg/hgrc |
|
49 | 49 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
50 | 50 | $ req |
|
51 | 51 | pushing to http://localhost:$HGPORT/ |
|
52 | 52 | searching for changes |
|
53 | 53 | abort: authorization failed |
|
54 | 54 | % serve errors |
|
55 | 55 | [255] |
|
56 | 56 | |
|
57 | 57 | expect authorization error: must have authorized user |
|
58 | 58 | |
|
59 | 59 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
60 | 60 | $ req |
|
61 | 61 | pushing to http://localhost:$HGPORT/ |
|
62 | 62 | searching for changes |
|
63 | 63 | abort: authorization failed |
|
64 | 64 | % serve errors |
|
65 | 65 | [255] |
|
66 | 66 | |
|
67 | 67 | expect success |
|
68 | 68 | |
|
69 | 69 | $ cat >> .hg/hgrc <<EOF |
|
70 | 70 | > allow_push = * |
|
71 | 71 | > [hooks] |
|
72 | 72 | > changegroup = sh -c "printenv.py changegroup 0" |
|
73 | 73 | > pushkey = sh -c "printenv.py pushkey 0" |
|
74 | 74 | > EOF |
|
75 | 75 | $ req |
|
76 | 76 | pushing to http://localhost:$HGPORT/ |
|
77 | 77 | searching for changes |
|
78 | 78 | remote: adding changesets |
|
79 | 79 | remote: adding manifests |
|
80 | 80 | remote: adding file changes |
|
81 | 81 | remote: added 1 changesets with 1 changes to 1 files |
|
82 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
|
82 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
|
83 | 83 | % serve errors |
|
84 | 84 | $ hg rollback |
|
85 | 85 | repository tip rolled back to revision 0 (undo serve) |
|
86 | 86 | |
|
87 | 87 | expect success, server lacks the httpheader capability |
|
88 | 88 | |
|
89 | 89 | $ CAP=httpheader |
|
90 | 90 | $ . "$TESTDIR/notcapable" |
|
91 | 91 | $ req |
|
92 | 92 | pushing to http://localhost:$HGPORT/ |
|
93 | 93 | searching for changes |
|
94 | 94 | remote: adding changesets |
|
95 | 95 | remote: adding manifests |
|
96 | 96 | remote: adding file changes |
|
97 | 97 | remote: added 1 changesets with 1 changes to 1 files |
|
98 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
|
98 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
|
99 | 99 | % serve errors |
|
100 | 100 | $ hg rollback |
|
101 | 101 | repository tip rolled back to revision 0 (undo serve) |
|
102 | 102 | |
|
103 | 103 | expect success, server lacks the unbundlehash capability |
|
104 | 104 | |
|
105 | 105 | $ CAP=unbundlehash |
|
106 | 106 | $ . "$TESTDIR/notcapable" |
|
107 | 107 | $ req |
|
108 | 108 | pushing to http://localhost:$HGPORT/ |
|
109 | 109 | searching for changes |
|
110 | 110 | remote: adding changesets |
|
111 | 111 | remote: adding manifests |
|
112 | 112 | remote: adding file changes |
|
113 | 113 | remote: added 1 changesets with 1 changes to 1 files |
|
114 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
|
114 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
|
115 | 115 | % serve errors |
|
116 | 116 | $ hg rollback |
|
117 | 117 | repository tip rolled back to revision 0 (undo serve) |
|
118 | 118 | |
|
119 | 119 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but |
|
120 | 120 | has no parameter |
|
121 | 121 | |
|
122 | 122 | $ cat <<EOF > notcapable-unbundleparam.py |
|
123 | 123 | > from mercurial import extensions, httppeer |
|
124 | 124 | > def capable(orig, self, name): |
|
125 | 125 | > if name == 'unbundle': |
|
126 | 126 | > return True |
|
127 | 127 | > return orig(self, name) |
|
128 | 128 | > def uisetup(ui): |
|
129 | 129 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) |
|
130 | 130 | > EOF |
|
131 | 131 | $ cp $HGRCPATH $HGRCPATH.orig |
|
132 | 132 | $ cat <<EOF >> $HGRCPATH |
|
133 | 133 | > [extensions] |
|
134 | 134 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py |
|
135 | 135 | > EOF |
|
136 | 136 | $ req |
|
137 | 137 | pushing to http://localhost:$HGPORT/ |
|
138 | 138 | searching for changes |
|
139 | 139 | remote: adding changesets |
|
140 | 140 | remote: adding manifests |
|
141 | 141 | remote: adding file changes |
|
142 | 142 | remote: added 1 changesets with 1 changes to 1 files |
|
143 | 143 | remote: changegroup hook: * (glob) |
|
144 | 144 | % serve errors |
|
145 | 145 | $ hg rollback |
|
146 | 146 | repository tip rolled back to revision 0 (undo serve) |
|
147 | 147 | $ mv $HGRCPATH.orig $HGRCPATH |
|
148 | 148 | |
|
149 | 149 | expect push success, phase change failure |
|
150 | 150 | |
|
151 | 151 | $ cat > .hg/hgrc <<EOF |
|
152 | 152 | > [web] |
|
153 | 153 | > push_ssl = false |
|
154 | 154 | > allow_push = * |
|
155 | 155 | > [hooks] |
|
156 | 156 | > prepushkey = sh -c "printenv.py prepushkey 1" |
|
157 | 157 | > EOF |
|
158 | 158 | $ req |
|
159 | 159 | pushing to http://localhost:$HGPORT/ |
|
160 | 160 | searching for changes |
|
161 | 161 | remote: adding changesets |
|
162 | 162 | remote: adding manifests |
|
163 | 163 | remote: adding file changes |
|
164 | 164 | remote: added 1 changesets with 1 changes to 1 files |
|
165 | 165 | % serve errors |
|
166 | 166 | |
|
167 | 167 | expect phase change success |
|
168 | 168 | |
|
169 | 169 | $ cat >> .hg/hgrc <<EOF |
|
170 | 170 | > prepushkey = sh -c "printenv.py prepushkey 0" |
|
171 | 171 | > EOF |
|
172 | 172 | $ req |
|
173 | 173 | pushing to http://localhost:$HGPORT/ |
|
174 | 174 | searching for changes |
|
175 | 175 | no changes found |
|
176 | 176 | % serve errors |
|
177 | 177 | [1] |
|
178 | 178 | $ hg rollback |
|
179 | 179 | repository tip rolled back to revision 0 (undo serve) |
|
180 | 180 | |
|
181 | 181 | expect authorization error: all users denied |
|
182 | 182 | |
|
183 | 183 | $ echo '[web]' > .hg/hgrc |
|
184 | 184 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
185 | 185 | $ echo 'deny_push = *' >> .hg/hgrc |
|
186 | 186 | $ req |
|
187 | 187 | pushing to http://localhost:$HGPORT/ |
|
188 | 188 | searching for changes |
|
189 | 189 | abort: authorization failed |
|
190 | 190 | % serve errors |
|
191 | 191 | [255] |
|
192 | 192 | |
|
193 | 193 | expect authorization error: some users denied, users must be authenticated |
|
194 | 194 | |
|
195 | 195 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
196 | 196 | $ req |
|
197 | 197 | pushing to http://localhost:$HGPORT/ |
|
198 | 198 | searching for changes |
|
199 | 199 | abort: authorization failed |
|
200 | 200 | % serve errors |
|
201 | 201 | [255] |
|
202 | 202 | |
|
203 | 203 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now