##// END OF EJS Templates
py3: conditionalize some LFS test output...
Matt Harbison -
r41477:080a5c83 default
parent child Browse files
Show More
@@ -1,481 +1,481 b''
1 1 #require serve no-reposimplestore no-chg
2 2
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > lfs=
6 6 > [lfs]
7 7 > track=all()
8 8 > [web]
9 9 > push_ssl = False
10 10 > allow-push = *
11 11 > EOF
12 12
13 13 Serving LFS files can experimentally be turned off. The long term solution is
14 14 to support the 'verify' action in both client and server, so that the server can
15 15 tell the client to store files elsewhere.
16 16
17 17 $ hg init server
18 18 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
19 19 > --config experimental.lfs.serve=False -R server serve -d \
20 20 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
21 21 $ cat hg.pid >> $DAEMON_PIDS
22 22
23 23 Uploads fail...
24 24
25 25 $ hg init client
26 26 $ echo 'this-is-an-lfs-file' > client/lfs.bin
27 27 $ hg -R client ci -Am 'initial commit'
28 28 adding lfs.bin
29 29 $ hg -R client push http://localhost:$HGPORT
30 30 pushing to http://localhost:$HGPORT/
31 31 searching for changes
32 32 abort: LFS HTTP error: HTTP Error 400: no such method: .git!
33 33 (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "upload" is supported)
34 34 [255]
35 35
36 36 ... so do a local push to make the data available. Remove the blob from the
37 37 default cache, so it attempts to download.
38 38 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
39 39 > --config "lfs.url=null://" \
40 40 > -R client push -q server
41 41 $ mv `hg config lfs.usercache` $TESTTMP/servercache
42 42
43 43 Downloads fail...
44 44
45 45 $ hg clone http://localhost:$HGPORT httpclone
46 46 (remote is using large file support (lfs); lfs will be enabled for this repository)
47 47 requesting all changes
48 48 adding changesets
49 49 adding manifests
50 50 adding file changes
51 51 added 1 changesets with 1 changes to 1 files
52 52 new changesets 525251863cad
53 53 updating to branch default
54 54 abort: LFS HTTP error: HTTP Error 400: no such method: .git!
55 55 (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "download" is supported)
56 56 [255]
57 57
58 58 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
59 59
60 60 $ cat $TESTTMP/access.log $TESTTMP/errors.log
61 61 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
62 62 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D525251863cad618e55d483555f3d00a2ca99597e x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
63 63 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
64 64 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
65 65 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob)
66 66 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
67 67 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
68 68 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
69 69 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob)
70 70
71 71 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
72 72 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server serve -d \
73 73 > -p $HGPORT --pid-file=hg.pid --prefix=subdir/mount/point \
74 74 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
75 75 $ cat hg.pid >> $DAEMON_PIDS
76 76
77 77 Reasonable hint for a misconfigured blob server
78 78
79 79 $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT/missing
80 80 abort: LFS HTTP error: HTTP Error 404: Not Found!
81 81 (the "lfs.url" config may be used to override http://localhost:$HGPORT/missing)
82 82 [255]
83 83
84 84 $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT2/missing
85 85 abort: LFS error: *onnection *refused*! (glob) (?)
86 86 abort: LFS error: $EADDRNOTAVAIL$! (glob) (?)
87 87 (the "lfs.url" config may be used to override http://localhost:$HGPORT2/missing)
88 88 [255]
89 89
90 90 Blob URIs are correct when --prefix is used
91 91
92 92 $ hg clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2
93 93 using http://localhost:$HGPORT/subdir/mount/point
94 94 sending capabilities command
95 95 (remote is using large file support (lfs); lfs will be enabled for this repository)
96 96 query 1; heads
97 97 sending batch command
98 98 requesting all changes
99 99 sending getbundle command
100 100 bundle2-input-bundle: with-transaction
101 101 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
102 102 adding changesets
103 103 add changeset 525251863cad
104 104 adding manifests
105 105 adding file changes
106 106 adding lfs.bin revisions
107 107 added 1 changesets with 1 changes to 1 files
108 108 bundle2-input-part: total payload size 648
109 109 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
110 110 bundle2-input-part: "phase-heads" supported
111 111 bundle2-input-part: total payload size 24
112 112 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
113 113 bundle2-input-part: total payload size 39
114 114 bundle2-input-bundle: 3 parts total
115 115 checking for updated bookmarks
116 116 updating the branch cache
117 117 new changesets 525251863cad
118 118 updating to branch default
119 119 resolving manifests
120 120 branchmerge: False, force: False, partial: False
121 121 ancestor: 000000000000, local: 000000000000+, remote: 525251863cad
122 122 lfs: assuming remote store: http://localhost:$HGPORT/subdir/mount/point/.git/info/lfs
123 123 Status: 200
124 124 Content-Length: 371
125 125 Content-Type: application/vnd.git-lfs+json
126 126 Date: $HTTP_DATE$
127 127 Server: testing stub value
128 128 {
129 129 "objects": [
130 130 {
131 131 "actions": {
132 132 "download": {
133 133 "expires_at": "$ISO_8601_DATE_TIME$"
134 134 "header": {
135 135 "Accept": "application/vnd.git-lfs"
136 136 }
137 137 "href": "http://localhost:$HGPORT/subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
138 138 }
139 139 }
140 140 "oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
141 141 "size": 20
142 142 }
143 143 ]
144 144 "transfer": "basic"
145 145 }
146 146 lfs: downloading f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e (20 bytes)
147 147 Status: 200
148 148 Content-Length: 20
149 149 Content-Type: application/octet-stream
150 150 Date: $HTTP_DATE$
151 151 Server: testing stub value
152 152 lfs: adding f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e to the usercache
153 153 lfs: processed: f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
154 154 lfs: downloaded 1 files (20 bytes)
155 155 lfs.bin: remote created -> g
156 156 getting lfs.bin
157 157 lfs: found f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e in the local lfs store
158 158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 159 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
160 160
161 161 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
162 162
163 163 $ cat $TESTTMP/access.log $TESTTMP/errors.log
164 164 $LOCALIP - - [$LOGDATE$] "POST /missing/objects/batch HTTP/1.1" 404 - (glob)
165 165 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=capabilities HTTP/1.1" 200 - (glob)
166 166 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
167 167 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
168 168 $LOCALIP - - [$LOGDATE$] "POST /subdir/mount/point/.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
169 169 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e HTTP/1.1" 200 - (glob)
170 170
171 171 Blobs that already exist in the usercache are linked into the repo store, even
172 172 though the client doesn't send the blob.
173 173
174 174 $ hg init server2
175 175 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server2 serve -d \
176 176 > -p $HGPORT --pid-file=hg.pid \
177 177 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
178 178 $ cat hg.pid >> $DAEMON_PIDS
179 179
180 180 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R cloned2 --debug \
181 181 > push http://localhost:$HGPORT | grep '^[{} ]'
182 182 {
183 183 "objects": [
184 184 {
185 185 "oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
186 186 "size": 20
187 187 }
188 188 ]
189 189 "transfer": "basic"
190 190 }
191 191 $ find server2/.hg/store/lfs/objects | sort
192 192 server2/.hg/store/lfs/objects
193 193 server2/.hg/store/lfs/objects/f0
194 194 server2/.hg/store/lfs/objects/f0/3217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
195 195 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
196 196 $ cat $TESTTMP/errors.log
197 197
198 198 $ cat >> $TESTTMP/lfsstoreerror.py <<EOF
199 199 > import errno
200 200 > from hgext.lfs import blobstore
201 201 >
202 202 > _numverifies = 0
203 203 > _readerr = True
204 204 >
205 205 > def reposetup(ui, repo):
206 206 > # Nothing to do with a remote repo
207 207 > if not repo.local():
208 208 > return
209 209 >
210 210 > store = repo.svfs.lfslocalblobstore
211 211 > class badstore(store.__class__):
212 212 > def download(self, oid, src):
213 213 > '''Called in the server to handle reading from the client in a
214 214 > PUT request.'''
215 215 > origread = src.read
216 216 > def _badread(nbytes):
217 217 > # Simulate bad data/checksum failure from the client
218 218 > return b'0' * len(origread(nbytes))
219 219 > src.read = _badread
220 220 > super(badstore, self).download(oid, src)
221 221 >
222 222 > def _read(self, vfs, oid, verify):
223 223 > '''Called in the server to read data for a GET request, and then
224 224 > calls self._verify() on it before returning.'''
225 225 > global _readerr
226 226 > # One time simulation of a read error
227 227 > if _readerr:
228 228 > _readerr = False
229 229 > raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8"))
230 230 > # Simulate corrupt content on client download
231 231 > blobstore._verify(oid, b'dummy content')
232 232 >
233 233 > def verify(self, oid):
234 234 > '''Called in the server to populate the Batch API response,
235 235 > letting the client re-upload if the file is corrupt.'''
236 236 > # Fail verify in Batch API for one clone command and one push
237 237 > # command with an IOError. Then let it through to access other
238 238 > # functions. Checksum failure is tested elsewhere.
239 239 > global _numverifies
240 240 > _numverifies += 1
241 241 > if _numverifies <= 2:
242 242 > raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8"))
243 243 > return super(badstore, self).verify(oid)
244 244 >
245 245 > store.__class__ = badstore
246 246 > EOF
247 247
248 248 $ rm -rf `hg config lfs.usercache`
249 249 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
250 250 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
251 251 > --config extensions.lfsstoreerror=$TESTTMP/lfsstoreerror.py \
252 252 > -R server serve -d \
253 253 > -p $HGPORT1 --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
254 254 $ cat hg.pid >> $DAEMON_PIDS
255 255
256 256 Test an I/O error in localstore.verify() (Batch API) with GET
257 257
258 258 $ hg clone http://localhost:$HGPORT1 httpclone2
259 259 (remote is using large file support (lfs); lfs will be enabled for this repository)
260 260 requesting all changes
261 261 adding changesets
262 262 adding manifests
263 263 adding file changes
264 264 added 1 changesets with 1 changes to 1 files
265 265 new changesets 525251863cad
266 266 updating to branch default
267 267 abort: LFS server error for "lfs.bin": Internal server error!
268 268 [255]
269 269
270 270 Test an I/O error in localstore.verify() (Batch API) with PUT
271 271
272 272 $ echo foo > client/lfs.bin
273 273 $ hg -R client ci -m 'mod lfs'
274 274 $ hg -R client push http://localhost:$HGPORT1
275 275 pushing to http://localhost:$HGPORT1/
276 276 searching for changes
277 277 abort: LFS server error for "unknown": Internal server error!
278 278 [255]
279 279 TODO: figure out how to associate the file name in the error above
280 280
281 281 Test a bad checksum sent by the client in the transfer API
282 282
283 283 $ hg -R client push http://localhost:$HGPORT1
284 284 pushing to http://localhost:$HGPORT1/
285 285 searching for changes
286 286 abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)!
287 287 [255]
288 288
289 289 $ echo 'test lfs file' > server/lfs3.bin
290 290 $ hg --config experimental.lfs.disableusercache=True \
291 291 > -R server ci -Aqm 'another lfs file'
292 292 $ hg -R client pull -q http://localhost:$HGPORT1
293 293
294 294 Test an I/O error during the processing of the GET request
295 295
296 296 $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
297 297 > -R client update -r tip
298 298 abort: LFS HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
299 299 [255]
300 300
301 301 Test a checksum failure during the processing of the GET request
302 302
303 303 $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
304 304 > -R client update -r tip
305 305 abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
306 306 [255]
307 307
308 308 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
309 309
310 310 $ cat $TESTTMP/access.log
311 311 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
312 312 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
313 313 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
314 314 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
315 315 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
316 316 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
317 317 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
318 318 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
319 319 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
320 320 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
321 321 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
322 322 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
323 323 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
324 324 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
325 325 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
326 326 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
327 327 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
328 328 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
329 329 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c HTTP/1.1" 422 - (glob)
330 330 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
331 331 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
332 332 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=525251863cad618e55d483555f3d00a2ca99597e&heads=506bf3d83f78c54b89e81c6411adee19fdf02156+525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
333 333 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
334 334 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 500 - (glob)
335 335 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
336 336 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 422 - (glob)
337 337
338 338 $ grep -v ' File "' $TESTTMP/errors.log
339 339 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.git/info/lfs/objects/batch': (glob)
340 340 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
341 341 $LOCALIP - - [$ERRDATE$] HG error: verifies = store.verify(oid) (glob)
342 342 $LOCALIP - - [$ERRDATE$] HG error: raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8")) (glob)
343 $LOCALIP - - [$ERRDATE$] HG error: IOError: [Errno 5] f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error (glob)
343 $LOCALIP - - [$ERRDATE$] HG error: *Error: [Errno 5] f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error (glob)
344 344 $LOCALIP - - [$ERRDATE$] HG error: (glob)
345 345 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.git/info/lfs/objects/batch': (glob)
346 346 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
347 347 $LOCALIP - - [$ERRDATE$] HG error: verifies = store.verify(oid) (glob)
348 348 $LOCALIP - - [$ERRDATE$] HG error: raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8")) (glob)
349 $LOCALIP - - [$ERRDATE$] HG error: IOError: [Errno 5] b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error (glob)
349 $LOCALIP - - [$ERRDATE$] HG error: *Error: [Errno 5] b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error (glob)
350 350 $LOCALIP - - [$ERRDATE$] HG error: (glob)
351 351 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c': (glob)
352 352 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
353 353 $LOCALIP - - [$ERRDATE$] HG error: localstore.download(oid, req.bodyfh) (glob)
354 354 $LOCALIP - - [$ERRDATE$] HG error: super(badstore, self).download(oid, src) (glob)
355 355 $LOCALIP - - [$ERRDATE$] HG error: % oid) (glob)
356 356 $LOCALIP - - [$ERRDATE$] HG error: LfsCorruptionError: corrupt remote lfs object: b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c (glob)
357 357 $LOCALIP - - [$ERRDATE$] HG error: (glob)
358 358 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob)
359 359 Traceback (most recent call last):
360 360 self.do_write()
361 361 self.do_hgweb()
362 362 for chunk in self.server.application(env, self._start_response):
363 363 for r in self._runwsgi(req, res, repo):
364 364 rctx, req, res, self.check_perm)
365 return func(*(args + a), **kw)
365 return func(*(args + a), **kw) (no-py3 !)
366 366 lambda perm:
367 367 res.setbodybytes(localstore.read(oid))
368 368 blob = self._read(self.vfs, oid, verify)
369 369 raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8"))
370 IOError: [Errno 5] 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error
370 *Error: [Errno 5] 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error (glob)
371 371
372 372 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob)
373 373 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
374 374 $LOCALIP - - [$ERRDATE$] HG error: res.setbodybytes(localstore.read(oid)) (glob)
375 375 $LOCALIP - - [$ERRDATE$] HG error: blob = self._read(self.vfs, oid, verify) (glob)
376 376 $LOCALIP - - [$ERRDATE$] HG error: blobstore._verify(oid, b'dummy content') (glob)
377 377 $LOCALIP - - [$ERRDATE$] HG error: hint=_(b'run hg verify')) (glob)
378 378 $LOCALIP - - [$ERRDATE$] HG error: LfsCorruptionError: detected corrupt lfs object: 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d (glob)
379 379 $LOCALIP - - [$ERRDATE$] HG error: (glob)
380 380
381 381 Basic Authorization headers are returned by the Batch API, and sent back with
382 382 the GET/PUT request.
383 383
384 384 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
385 385
386 386 $ cat >> $HGRCPATH << EOF
387 387 > [experimental]
388 388 > lfs.disableusercache = True
389 389 > [auth]
390 390 > l.schemes=http
391 391 > l.prefix=lo
392 392 > l.username=user
393 393 > l.password=pass
394 394 > EOF
395 395
396 396 $ cat << EOF > userpass.py
397 397 > import base64
398 398 > from mercurial.hgweb import common
399 399 > def perform_authentication(hgweb, req, op):
400 400 > auth = req.headers.get(b'Authorization')
401 401 > if not auth:
402 402 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
403 403 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
404 404 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user',
405 405 > b'pass']:
406 406 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
407 407 > def extsetup(ui):
408 408 > common.permhooks.insert(0, perform_authentication)
409 409 > EOF
410 410
411 411 $ hg --config extensions.x=$TESTTMP/userpass.py \
412 412 > -R server serve -d -p $HGPORT1 --pid-file=hg.pid \
413 413 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
414 414 $ mv hg.pid $DAEMON_PIDS
415 415
416 416 $ hg clone --debug http://localhost:$HGPORT1 auth_clone | egrep '^[{}]| '
417 417 {
418 418 "objects": [
419 419 {
420 420 "actions": {
421 421 "download": {
422 422 "expires_at": "$ISO_8601_DATE_TIME$"
423 423 "header": {
424 424 "Accept": "application/vnd.git-lfs"
425 425 "Authorization": "Basic dXNlcjpwYXNz"
426 426 }
427 427 "href": "http://localhost:$HGPORT1/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d"
428 428 }
429 429 }
430 430 "oid": "276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d"
431 431 "size": 14
432 432 }
433 433 ]
434 434 "transfer": "basic"
435 435 }
436 436
437 437 $ echo 'another blob' > auth_clone/lfs.blob
438 438 $ hg -R auth_clone ci -Aqm 'add blob'
439 439 $ hg -R auth_clone --debug push | egrep '^[{}]| '
440 440 {
441 441 "objects": [
442 442 {
443 443 "actions": {
444 444 "upload": {
445 445 "expires_at": "$ISO_8601_DATE_TIME$"
446 446 "header": {
447 447 "Accept": "application/vnd.git-lfs"
448 448 "Authorization": "Basic dXNlcjpwYXNz"
449 449 }
450 450 "href": "http://localhost:$HGPORT1/.hg/lfs/objects/df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3"
451 451 }
452 452 }
453 453 "oid": "df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3"
454 454 "size": 13
455 455 }
456 456 ]
457 457 "transfer": "basic"
458 458 }
459 459
460 460 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
461 461
462 462 $ cat $TESTTMP/access.log $TESTTMP/errors.log
463 463 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 401 - (glob)
464 464 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
465 465 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
466 466 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=506bf3d83f78c54b89e81c6411adee19fdf02156+525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
467 467 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 401 - (glob)
468 468 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
469 469 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 200 - (glob)
470 470 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 401 - (glob)
471 471 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
472 472 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D525251863cad618e55d483555f3d00a2ca99597e+4d9397055dc0c205f3132f331f36353ab1a525a3 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
473 473 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
474 474 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
475 475 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
476 476 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
477 477 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 401 - (glob)
478 478 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
479 479 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3 HTTP/1.1" 201 - (glob)
480 480 $LOCALIP - - [$LOGDATE$] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
481 481 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
General Comments 0
You need to be logged in to leave comments. Login now