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