Mercurial > hg
comparison tests/test-lfs-test-server.t @ 37153:f51c2780db3a
test-lfs-test-server: add a testcase for `hg serve`
I haven't figured out yet how to make the authentication checks work for a
specific list of users, so the 'web.allow-push' list is wildcarded. (It appears
that the client doesn't react to a 401 by sending authentication data, which may
be caused in part by not having all of the headers in httpbasicauthhandler's
http_error_auth_reqed(), compared to a run of test-http.t. But in any case, we
should probably have a separate set of tests for various authentication
scenarios. As it is, without the wildcard, no push access is granted.)
There are several deviations from the `lfs-test-server` case:
- `hg serve` emits a Server header. I think Gregory indicated that this isn't
easily suppressed.
- `hg serve` names the "basic" transfer handler in the Batch API response. Not
having to specify it was for backwards compatability, so this seems like the
right thing to do. (`lfs-test-server` doesn't name it, whether it was
explicitly requested by the client or not.)
- PUT status for a newly created file is 201, per RFC-2616 [1]. The Basic
Transfer API [2] shows an example upload transcript with a 200 response. It
doesn't make much sense to re-upload a file (unless it is corrupt) in an
example, but I wouldn't be surprised if some other implementations also
expect 200 because of this. But the RFC says MUST use 201 for creation.
- The Content-Type for the file transfers is "application/octet-stream", like
the sample transcript (though I don't see it explicitly called out in the
text elsewhere). Using "text/plain" seems clearly wrong.
- `lfs-test-server` isn't removing the action property and sending back an
error code like the spec calls out when a file is missing or corrupt. Doing
so on the `hg serve` side reveals a bug in our client code when handling the
response- it indicates the remote file is missing instead of corrupt around
line 452.
I'll probably glob over the Content-Length differences once this settles down.
Prior to the recent hgweb refactoring, the Batch API response was using chunked
encodings instead.
Back to the RFC, I have no idea if the python framework handles the "MUST NOT
ignore any Content-* (e.g. Content-Range) headers that it does not understand or
implement and MUST return a 501" for a PUT request.
[1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6
[2] https://github.com/git-lfs/git-lfs/blob/master/docs/api/basic-transfers.md#uploads
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 17 Mar 2018 02:37:46 -0400 |
parents | c37c47e47a95 |
children | 67db84842356 |
comparison
equal
deleted
inserted
replaced
37152:0348c778bf70 | 37153:f51c2780db3a |
---|---|
1 #testcases git-server hg-server | |
2 | |
3 #if git-server | |
1 #require lfs-test-server | 4 #require lfs-test-server |
2 | 5 #else |
6 #require serve | |
7 #endif | |
8 | |
9 #if git-server | |
3 $ LFS_LISTEN="tcp://:$HGPORT" | 10 $ LFS_LISTEN="tcp://:$HGPORT" |
4 $ LFS_HOST="localhost:$HGPORT" | 11 $ LFS_HOST="localhost:$HGPORT" |
5 $ LFS_PUBLIC=1 | 12 $ LFS_PUBLIC=1 |
6 $ export LFS_LISTEN LFS_HOST LFS_PUBLIC | 13 $ export LFS_LISTEN LFS_HOST LFS_PUBLIC |
7 #if no-windows | 14 #else |
15 $ LFS_HOST="localhost:$HGPORT/.git/info/lfs" | |
16 #endif | |
17 | |
18 #if no-windows git-server | |
8 $ lfs-test-server &> lfs-server.log & | 19 $ lfs-test-server &> lfs-server.log & |
9 $ echo $! >> $DAEMON_PIDS | 20 $ echo $! >> $DAEMON_PIDS |
10 #else | 21 #endif |
22 | |
23 #if windows git-server | |
11 $ cat >> $TESTTMP/spawn.py <<EOF | 24 $ cat >> $TESTTMP/spawn.py <<EOF |
12 > import os | 25 > import os |
13 > import subprocess | 26 > import subprocess |
14 > import sys | 27 > import sys |
15 > | 28 > |
27 | 40 |
28 $ cat >> $HGRCPATH <<EOF | 41 $ cat >> $HGRCPATH <<EOF |
29 > [extensions] | 42 > [extensions] |
30 > lfs= | 43 > lfs= |
31 > [lfs] | 44 > [lfs] |
32 > url=http://foo:bar@$LFS_HOST/ | 45 > url=http://foo:bar@$LFS_HOST |
33 > track=all() | 46 > track=all() |
47 > [web] | |
48 > push_ssl = False | |
49 > allow-push = * | |
34 > EOF | 50 > EOF |
51 | |
52 Use a separate usercache, otherwise the server sees what the client commits, and | |
53 never requests a transfer. | |
54 | |
55 #if hg-server | |
56 $ hg init server | |
57 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server serve -d \ | |
58 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log | |
59 $ cat hg.pid >> $DAEMON_PIDS | |
60 #endif | |
35 | 61 |
36 $ hg init repo1 | 62 $ hg init repo1 |
37 $ cd repo1 | 63 $ cd repo1 |
38 $ echo THIS-IS-LFS > a | 64 $ echo THIS-IS-LFS > a |
39 $ hg commit -m a -A a | 65 $ hg commit -m a -A a |
53 listing keys for "phases" | 79 listing keys for "phases" |
54 checking for updated bookmarks | 80 checking for updated bookmarks |
55 listing keys for "bookmarks" | 81 listing keys for "bookmarks" |
56 lfs: computing set of blobs to upload | 82 lfs: computing set of blobs to upload |
57 Status: 200 | 83 Status: 200 |
58 Content-Length: 309 | 84 Content-Length: 309 (git-server !) |
59 Content-Type: application/vnd.git-lfs+json | 85 Content-Length: 350 (hg-server !) |
60 Date: $HTTP_DATE$ | 86 Content-Type: application/vnd.git-lfs+json |
87 Date: $HTTP_DATE$ | |
88 Server: testing stub value (hg-server !) | |
61 { | 89 { |
62 "objects": [ | 90 "objects": [ |
63 { | 91 { |
64 "actions": { | 92 "actions": { |
65 "upload": { | 93 "upload": { |
66 "expires_at": "$ISO_8601_DATE_TIME$" | 94 "expires_at": "$ISO_8601_DATE_TIME$" |
67 "header": { | 95 "header": { |
68 "Accept": "application/vnd.git-lfs" | 96 "Accept": "application/vnd.git-lfs" |
69 } | 97 } |
70 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 98 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (git-server !) |
99 "href": "http://localhost:$HGPORT/.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (hg-server !) | |
71 } | 100 } |
72 } | 101 } |
73 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 102 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" |
74 "size": 12 | 103 "size": 12 |
75 } | 104 } |
76 ] | 105 ] |
106 "transfer": "basic" (hg-server !) | |
77 } | 107 } |
78 lfs: uploading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) | 108 lfs: uploading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) |
79 Status: 200 | 109 Status: 200 (git-server !) |
110 Status: 201 (hg-server !) | |
80 Content-Length: 0 | 111 Content-Length: 0 |
81 Content-Type: text/plain; charset=utf-8 | 112 Content-Type: text/plain; charset=utf-8 |
82 Date: $HTTP_DATE$ | 113 Date: $HTTP_DATE$ |
114 Server: testing stub value (hg-server !) | |
83 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b | 115 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b |
84 lfs: uploaded 1 files (12 bytes) | 116 lfs: uploaded 1 files (12 bytes) |
85 1 changesets found | 117 1 changesets found |
86 list of changesets: | 118 list of changesets: |
87 99a7098854a3984a5c9eab0fc7a2906697b7cb5c | 119 99a7098854a3984a5c9eab0fc7a2906697b7cb5c |
123 http auth: user foo, password *** | 155 http auth: user foo, password *** |
124 resolving manifests | 156 resolving manifests |
125 branchmerge: False, force: False, partial: False | 157 branchmerge: False, force: False, partial: False |
126 ancestor: 000000000000, local: 000000000000+, remote: 99a7098854a3 | 158 ancestor: 000000000000, local: 000000000000+, remote: 99a7098854a3 |
127 Status: 200 | 159 Status: 200 |
128 Content-Length: 311 | 160 Content-Length: 311 (git-server !) |
129 Content-Type: application/vnd.git-lfs+json | 161 Content-Length: 352 (hg-server !) |
130 Date: $HTTP_DATE$ | 162 Content-Type: application/vnd.git-lfs+json |
131 { | 163 Date: $HTTP_DATE$ |
132 "objects": [ | 164 Server: testing stub value (hg-server !) |
133 { | 165 { |
134 "actions": { | 166 "objects": [ |
135 "download": { | 167 { |
136 "expires_at": "$ISO_8601_DATE_TIME$" | 168 "actions": { |
137 "header": { | 169 "download": { |
138 "Accept": "application/vnd.git-lfs" | 170 "expires_at": "$ISO_8601_DATE_TIME$" |
139 } | 171 "header": { |
140 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 172 "Accept": "application/vnd.git-lfs" |
173 } | |
174 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob) | |
141 } | 175 } |
142 } | 176 } |
143 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 177 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" |
144 "size": 12 | 178 "size": 12 |
145 } | 179 } |
146 ] | 180 ] |
181 "transfer": "basic" (hg-server !) | |
147 } | 182 } |
148 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) | 183 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) |
149 Status: 200 | 184 Status: 200 |
150 Content-Length: 12 | 185 Content-Length: 12 |
151 Content-Type: text/plain; charset=utf-8 | 186 Content-Type: text/plain; charset=utf-8 (git-server !) |
152 Date: $HTTP_DATE$ | 187 Content-Type: application/octet-stream (hg-server !) |
188 Date: $HTTP_DATE$ | |
189 Server: testing stub value (hg-server !) | |
153 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache | 190 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache |
154 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b | 191 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b |
155 a: remote created -> g | 192 a: remote created -> g |
156 getting a | 193 getting a |
157 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | 194 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 195 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
159 | 196 |
160 When the server has some blobs already | 197 When the server has some blobs already. `hg serve` doesn't offer to upload |
198 blobs that it already knows about. Note that lfs-test-server is simply | |
199 toggling the action to 'download'. The Batch API spec says it should omit the | |
200 actions property completely. | |
161 | 201 |
162 $ hg mv a b | 202 $ hg mv a b |
163 $ echo ANOTHER-LARGE-FILE > c | 203 $ echo ANOTHER-LARGE-FILE > c |
164 $ echo ANOTHER-LARGE-FILE2 > d | 204 $ echo ANOTHER-LARGE-FILE2 > d |
165 $ hg commit -m b-and-c -A b c d | 205 $ hg commit -m b-and-c -A b c d |
174 checking for updated bookmarks | 214 checking for updated bookmarks |
175 listing keys for "bookmarks" | 215 listing keys for "bookmarks" |
176 listing keys for "bookmarks" | 216 listing keys for "bookmarks" |
177 lfs: computing set of blobs to upload | 217 lfs: computing set of blobs to upload |
178 Status: 200 | 218 Status: 200 |
179 Content-Length: 901 | 219 Content-Length: 901 (git-server !) |
180 Content-Type: application/vnd.git-lfs+json | 220 Content-Length: 755 (hg-server !) |
181 Date: $HTTP_DATE$ | 221 Content-Type: application/vnd.git-lfs+json |
182 { | 222 Date: $HTTP_DATE$ |
183 "objects": [ | 223 Server: testing stub value (hg-server !) |
184 { | 224 { |
185 "actions": { | 225 "objects": [ |
186 "download": { | 226 { |
187 "expires_at": "$ISO_8601_DATE_TIME$" | 227 "actions": { (git-server !) |
188 "header": { | 228 "download": { (git-server !) |
189 "Accept": "application/vnd.git-lfs" | 229 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !) |
190 } | 230 "header": { (git-server !) |
191 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 231 "Accept": "application/vnd.git-lfs" (git-server !) |
192 } | 232 } (git-server !) |
193 } | 233 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (git-server !) |
234 } (git-server !) | |
235 } (git-server !) | |
194 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 236 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" |
195 "size": 12 | 237 "size": 12 |
196 } | 238 } |
197 { | 239 { |
198 "actions": { | 240 "actions": { |
199 "upload": { | 241 "upload": { |
200 "expires_at": "$ISO_8601_DATE_TIME$" | 242 "expires_at": "$ISO_8601_DATE_TIME$" |
201 "header": { | 243 "header": { |
202 "Accept": "application/vnd.git-lfs" | 244 "Accept": "application/vnd.git-lfs" |
203 } | 245 } |
204 "href": "http://localhost:$HGPORT/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" | 246 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob) |
205 } | 247 } |
206 } | 248 } |
207 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" | 249 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" |
208 "size": 20 | 250 "size": 20 |
209 } | 251 } |
212 "upload": { | 254 "upload": { |
213 "expires_at": "$ISO_8601_DATE_TIME$" | 255 "expires_at": "$ISO_8601_DATE_TIME$" |
214 "header": { | 256 "header": { |
215 "Accept": "application/vnd.git-lfs" | 257 "Accept": "application/vnd.git-lfs" |
216 } | 258 } |
217 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 259 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) |
218 } | 260 } |
219 } | 261 } |
220 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 262 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" |
221 "size": 19 | 263 "size": 19 |
222 } | 264 } |
223 ] | 265 ] |
266 "transfer": "basic" (hg-server !) | |
224 } | 267 } |
225 lfs: need to transfer 2 objects (39 bytes) | 268 lfs: need to transfer 2 objects (39 bytes) |
226 lfs: uploading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) | 269 lfs: uploading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) |
227 Status: 200 | 270 Status: 200 (git-server !) |
271 Status: 201 (hg-server !) | |
228 Content-Length: 0 | 272 Content-Length: 0 |
229 Content-Type: text/plain; charset=utf-8 | 273 Content-Type: text/plain; charset=utf-8 |
230 Date: $HTTP_DATE$ | 274 Date: $HTTP_DATE$ |
275 Server: testing stub value (hg-server !) | |
231 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 | 276 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 |
232 lfs: uploading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | 277 lfs: uploading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
233 Status: 200 | 278 Status: 200 (git-server !) |
279 Status: 201 (hg-server !) | |
234 Content-Length: 0 | 280 Content-Length: 0 |
235 Content-Type: text/plain; charset=utf-8 | 281 Content-Type: text/plain; charset=utf-8 |
236 Date: $HTTP_DATE$ | 282 Date: $HTTP_DATE$ |
283 Server: testing stub value (hg-server !) | |
237 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 284 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
238 lfs: uploaded 2 files (39 bytes) | 285 lfs: uploaded 2 files (39 bytes) |
239 1 changesets found | 286 1 changesets found |
240 list of changesets: | 287 list of changesets: |
241 dfca2c9e2ef24996aa61ba2abd99277d884b3d63 | 288 dfca2c9e2ef24996aa61ba2abd99277d884b3d63 |
279 http auth: user foo, password *** | 326 http auth: user foo, password *** |
280 resolving manifests | 327 resolving manifests |
281 branchmerge: False, force: False, partial: False | 328 branchmerge: False, force: False, partial: False |
282 ancestor: 99a7098854a3, local: 99a7098854a3+, remote: dfca2c9e2ef2 | 329 ancestor: 99a7098854a3, local: 99a7098854a3+, remote: dfca2c9e2ef2 |
283 Status: 200 | 330 Status: 200 |
284 Content-Length: 608 | 331 Content-Length: 608 (git-server !) |
285 Content-Type: application/vnd.git-lfs+json | 332 Content-Length: 670 (hg-server !) |
286 Date: $HTTP_DATE$ | 333 Content-Type: application/vnd.git-lfs+json |
287 { | 334 Date: $HTTP_DATE$ |
288 "objects": [ | 335 Server: testing stub value (hg-server !) |
289 { | 336 { |
290 "actions": { | 337 "objects": [ |
291 "download": { | 338 { |
292 "expires_at": "$ISO_8601_DATE_TIME$" | 339 "actions": { |
293 "header": { | 340 "download": { |
294 "Accept": "application/vnd.git-lfs" | 341 "expires_at": "$ISO_8601_DATE_TIME$" |
295 } | 342 "header": { |
296 "href": "http://localhost:$HGPORT/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" | 343 "Accept": "application/vnd.git-lfs" |
344 } | |
345 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob) | |
297 } | 346 } |
298 } | 347 } |
299 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" | 348 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" |
300 "size": 20 | 349 "size": 20 |
301 } | 350 } |
304 "download": { | 353 "download": { |
305 "expires_at": "$ISO_8601_DATE_TIME$" | 354 "expires_at": "$ISO_8601_DATE_TIME$" |
306 "header": { | 355 "header": { |
307 "Accept": "application/vnd.git-lfs" | 356 "Accept": "application/vnd.git-lfs" |
308 } | 357 } |
309 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 358 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) |
310 } | 359 } |
311 } | 360 } |
312 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 361 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" |
313 "size": 19 | 362 "size": 19 |
314 } | 363 } |
315 ] | 364 ] |
365 "transfer": "basic" (hg-server !) | |
316 } | 366 } |
317 lfs: need to transfer 2 objects (39 bytes) | 367 lfs: need to transfer 2 objects (39 bytes) |
318 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) | 368 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) |
319 Status: 200 | 369 Status: 200 |
320 Content-Length: 20 | 370 Content-Length: 20 |
321 Content-Type: text/plain; charset=utf-8 | 371 Content-Type: text/plain; charset=utf-8 (git-server !) |
322 Date: $HTTP_DATE$ | 372 Content-Type: application/octet-stream (hg-server !) |
373 Date: $HTTP_DATE$ | |
374 Server: testing stub value (hg-server !) | |
323 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache | 375 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache |
324 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 | 376 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 |
325 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | 377 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
326 Status: 200 | 378 Status: 200 |
327 Content-Length: 19 | 379 Content-Length: 19 |
328 Content-Type: text/plain; charset=utf-8 | 380 Content-Type: text/plain; charset=utf-8 (git-server !) |
329 Date: $HTTP_DATE$ | 381 Content-Type: application/octet-stream (hg-server !) |
382 Date: $HTTP_DATE$ | |
383 Server: testing stub value (hg-server !) | |
330 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache | 384 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache |
331 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 385 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
332 b: remote created -> g | 386 b: remote created -> g |
333 getting b | 387 getting b |
334 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | 388 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
339 getting d | 393 getting d |
340 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store | 394 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store |
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | 395 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
342 | 396 |
343 Test a corrupt file download, but clear the cache first to force a download. | 397 Test a corrupt file download, but clear the cache first to force a download. |
398 `hg serve` indicates a corrupt file without transferring it, unlike | |
399 lfs-test-server. | |
344 | 400 |
345 $ rm -rf `hg config lfs.usercache` | 401 $ rm -rf `hg config lfs.usercache` |
402 #if git-server | |
346 $ cp $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob | 403 $ cp $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob |
347 $ echo 'damage' > $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 404 $ echo 'damage' > $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
405 #else | |
406 $ cp $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob | |
407 $ echo 'damage' > $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
408 #endif | |
348 $ rm ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 409 $ rm ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
349 $ rm ../repo1/* | 410 $ rm ../repo1/* |
411 | |
412 TODO: give the proper error indication from `hg serve` | |
350 | 413 |
351 $ hg --repo ../repo1 update -C tip --debug | 414 $ hg --repo ../repo1 update -C tip --debug |
352 http auth: user foo, password *** | 415 http auth: user foo, password *** |
353 resolving manifests | 416 resolving manifests |
354 branchmerge: False, force: True, partial: False | 417 branchmerge: False, force: True, partial: False |
355 ancestor: dfca2c9e2ef2+, local: dfca2c9e2ef2+, remote: dfca2c9e2ef2 | 418 ancestor: dfca2c9e2ef2+, local: dfca2c9e2ef2+, remote: dfca2c9e2ef2 |
356 Status: 200 | 419 Status: 200 |
357 Content-Length: 311 | 420 Content-Length: 311 (git-server !) |
358 Content-Type: application/vnd.git-lfs+json | 421 Content-Length: 183 (hg-server !) |
359 Date: $HTTP_DATE$ | 422 Content-Type: application/vnd.git-lfs+json |
360 { | 423 Date: $HTTP_DATE$ |
361 "objects": [ | 424 Server: testing stub value (hg-server !) |
362 { | 425 { |
363 "actions": { | 426 "objects": [ |
364 "download": { | 427 { |
365 "expires_at": "$ISO_8601_DATE_TIME$" | 428 "actions": { (git-server !) |
366 "header": { | 429 "download": { (git-server !) |
367 "Accept": "application/vnd.git-lfs" | 430 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !) |
368 } | 431 "header": { (git-server !) |
369 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 432 "Accept": "application/vnd.git-lfs" (git-server !) |
370 } | 433 } (git-server !) |
434 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (git-server !) | |
435 } (git-server !) | |
436 "error": { (hg-server !) | |
437 "code": 422 (hg-server !) | |
438 "message": "The object is corrupt" (hg-server !) | |
371 } | 439 } |
372 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 440 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" |
373 "size": 19 | 441 "size": 19 |
374 } | 442 } |
375 ] | 443 ] |
376 } | 444 "transfer": "basic" (hg-server !) |
377 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | 445 } |
378 Status: 200 | 446 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) (git-server !) |
379 Content-Length: 7 | 447 Status: 200 (git-server !) |
380 Content-Type: text/plain; charset=utf-8 | 448 Content-Length: 7 (git-server !) |
381 Date: $HTTP_DATE$ | 449 Content-Type: text/plain; charset=utf-8 (git-server !) |
382 abort: corrupt remote lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 450 Date: $HTTP_DATE$ (git-server !) |
451 abort: corrupt remote lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (git-server !) | |
452 abort: LFS server error. Remote object for "c" not found: *! (glob) (hg-server !) | |
383 [255] | 453 [255] |
384 | 454 |
385 The corrupted blob is not added to the usercache or local store | 455 The corrupted blob is not added to the usercache or local store |
386 | 456 |
387 $ test -f ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 457 $ test -f ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
388 [1] | 458 [1] |
389 $ test -f `hg config lfs.usercache`/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 459 $ test -f `hg config lfs.usercache`/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
390 [1] | 460 [1] |
461 #if git-server | |
391 $ cp blob $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 462 $ cp blob $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
463 #else | |
464 $ cp blob $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
465 #endif | |
392 | 466 |
393 Test a corrupted file upload | 467 Test a corrupted file upload |
394 | 468 |
395 $ echo 'another lfs blob' > b | 469 $ echo 'another lfs blob' > b |
396 $ hg ci -m 'another blob' | 470 $ hg ci -m 'another blob' |
406 checking for updated bookmarks | 480 checking for updated bookmarks |
407 listing keys for "bookmarks" | 481 listing keys for "bookmarks" |
408 listing keys for "bookmarks" | 482 listing keys for "bookmarks" |
409 lfs: computing set of blobs to upload | 483 lfs: computing set of blobs to upload |
410 Status: 200 | 484 Status: 200 |
411 Content-Length: 309 | 485 Content-Length: 309 (git-server !) |
412 Content-Type: application/vnd.git-lfs+json | 486 Content-Length: 350 (hg-server !) |
413 Date: $HTTP_DATE$ | 487 Content-Type: application/vnd.git-lfs+json |
488 Date: $HTTP_DATE$ | |
489 Server: testing stub value (hg-server !) | |
414 { | 490 { |
415 "objects": [ | 491 "objects": [ |
416 { | 492 { |
417 "actions": { | 493 "actions": { |
418 "upload": { | 494 "upload": { |
419 "expires_at": "$ISO_8601_DATE_TIME$" | 495 "expires_at": "$ISO_8601_DATE_TIME$" |
420 "header": { | 496 "header": { |
421 "Accept": "application/vnd.git-lfs" | 497 "Accept": "application/vnd.git-lfs" |
422 } | 498 } |
423 "href": "http://localhost:$HGPORT/objects/e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0" | 499 "href": "http://localhost:$HGPORT/*/e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0" (glob) |
424 } | 500 } |
425 } | 501 } |
426 "oid": "e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0" | 502 "oid": "e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0" |
427 "size": 17 | 503 "size": 17 |
428 } | 504 } |
429 ] | 505 ] |
506 "transfer": "basic" (hg-server !) | |
430 } | 507 } |
431 lfs: uploading e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (17 bytes) | 508 lfs: uploading e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (17 bytes) |
432 abort: detected corrupt lfs object: e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 | 509 abort: detected corrupt lfs object: e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 |
433 (run hg verify) | 510 (run hg verify) |
434 [255] | 511 [255] |
437 | 514 |
438 $ rm -rf .hg/store/lfs `hg config lfs.usercache` | 515 $ rm -rf .hg/store/lfs `hg config lfs.usercache` |
439 $ hg archive --debug -r 1 ../archive | 516 $ hg archive --debug -r 1 ../archive |
440 http auth: user foo, password *** | 517 http auth: user foo, password *** |
441 Status: 200 | 518 Status: 200 |
442 Content-Length: 905 | 519 Content-Length: 905 (git-server !) |
443 Content-Type: application/vnd.git-lfs+json | 520 Content-Length: 988 (hg-server !) |
444 Date: $HTTP_DATE$ | 521 Content-Type: application/vnd.git-lfs+json |
445 { | 522 Date: $HTTP_DATE$ |
446 "objects": [ | 523 Server: testing stub value (hg-server !) |
447 { | 524 { |
448 "actions": { | 525 "objects": [ |
449 "download": { | 526 { |
450 "expires_at": "$ISO_8601_DATE_TIME$" | 527 "actions": { |
451 "header": { | 528 "download": { |
452 "Accept": "application/vnd.git-lfs" | 529 "expires_at": "$ISO_8601_DATE_TIME$" |
453 } | 530 "header": { |
454 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 531 "Accept": "application/vnd.git-lfs" |
532 } | |
533 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob) | |
455 } | 534 } |
456 } | 535 } |
457 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 536 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" |
458 "size": 12 | 537 "size": 12 |
459 } | 538 } |
462 "download": { | 541 "download": { |
463 "expires_at": "$ISO_8601_DATE_TIME$" | 542 "expires_at": "$ISO_8601_DATE_TIME$" |
464 "header": { | 543 "header": { |
465 "Accept": "application/vnd.git-lfs" | 544 "Accept": "application/vnd.git-lfs" |
466 } | 545 } |
467 "href": "http://localhost:$HGPORT/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" | 546 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob) |
468 } | 547 } |
469 } | 548 } |
470 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" | 549 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" |
471 "size": 20 | 550 "size": 20 |
472 } | 551 } |
475 "download": { | 554 "download": { |
476 "expires_at": "$ISO_8601_DATE_TIME$" | 555 "expires_at": "$ISO_8601_DATE_TIME$" |
477 "header": { | 556 "header": { |
478 "Accept": "application/vnd.git-lfs" | 557 "Accept": "application/vnd.git-lfs" |
479 } | 558 } |
480 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 559 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) |
481 } | 560 } |
482 } | 561 } |
483 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 562 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" |
484 "size": 19 | 563 "size": 19 |
485 } | 564 } |
486 ] | 565 ] |
566 "transfer": "basic" (hg-server !) | |
487 } | 567 } |
488 lfs: need to transfer 3 objects (51 bytes) | 568 lfs: need to transfer 3 objects (51 bytes) |
489 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) | 569 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) |
490 Status: 200 | 570 Status: 200 |
491 Content-Length: 12 | 571 Content-Length: 12 |
492 Content-Type: text/plain; charset=utf-8 | 572 Content-Type: text/plain; charset=utf-8 (git-server !) |
493 Date: $HTTP_DATE$ | 573 Content-Type: application/octet-stream (hg-server !) |
574 Date: $HTTP_DATE$ | |
575 Server: testing stub value (hg-server !) | |
494 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache | 576 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache |
495 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b | 577 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b |
496 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) | 578 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) |
497 Status: 200 | 579 Status: 200 |
498 Content-Length: 20 | 580 Content-Length: 20 |
499 Content-Type: text/plain; charset=utf-8 | 581 Content-Type: text/plain; charset=utf-8 (git-server !) |
500 Date: $HTTP_DATE$ | 582 Content-Type: application/octet-stream (hg-server !) |
583 Date: $HTTP_DATE$ | |
584 Server: testing stub value (hg-server !) | |
501 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache | 585 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache |
502 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 | 586 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 |
503 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | 587 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
504 Status: 200 | 588 Status: 200 |
505 Content-Length: 19 | 589 Content-Length: 19 |
506 Content-Type: text/plain; charset=utf-8 | 590 Content-Type: text/plain; charset=utf-8 (git-server !) |
507 Date: $HTTP_DATE$ | 591 Content-Type: application/octet-stream (hg-server !) |
592 Date: $HTTP_DATE$ | |
593 Server: testing stub value (hg-server !) | |
508 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache | 594 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache |
509 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 595 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
510 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | 596 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
511 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | 597 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
512 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store | 598 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store |
523 | 609 |
524 $ rm -rf .hg/store/lfs `hg config lfs.usercache` | 610 $ rm -rf .hg/store/lfs `hg config lfs.usercache` |
525 $ hg cat --debug -r 1 a b c | 611 $ hg cat --debug -r 1 a b c |
526 http auth: user foo, password *** | 612 http auth: user foo, password *** |
527 Status: 200 | 613 Status: 200 |
528 Content-Length: 608 | 614 Content-Length: 608 (git-server !) |
529 Content-Type: application/vnd.git-lfs+json | 615 Content-Length: 670 (hg-server !) |
530 Date: $HTTP_DATE$ | 616 Content-Type: application/vnd.git-lfs+json |
531 { | 617 Date: $HTTP_DATE$ |
532 "objects": [ | 618 Server: testing stub value (hg-server !) |
533 { | 619 { |
534 "actions": { | 620 "objects": [ |
535 "download": { | 621 { |
536 "expires_at": "$ISO_8601_DATE_TIME$" | 622 "actions": { |
537 "header": { | 623 "download": { |
538 "Accept": "application/vnd.git-lfs" | 624 "expires_at": "$ISO_8601_DATE_TIME$" |
539 } | 625 "header": { |
540 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 626 "Accept": "application/vnd.git-lfs" |
627 } | |
628 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob) | |
541 } | 629 } |
542 } | 630 } |
543 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 631 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" |
544 "size": 12 | 632 "size": 12 |
545 } | 633 } |
548 "download": { | 636 "download": { |
549 "expires_at": "$ISO_8601_DATE_TIME$" | 637 "expires_at": "$ISO_8601_DATE_TIME$" |
550 "header": { | 638 "header": { |
551 "Accept": "application/vnd.git-lfs" | 639 "Accept": "application/vnd.git-lfs" |
552 } | 640 } |
553 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 641 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) |
554 } | 642 } |
555 } | 643 } |
556 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 644 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" |
557 "size": 19 | 645 "size": 19 |
558 } | 646 } |
559 ] | 647 ] |
648 "transfer": "basic" (hg-server !) | |
560 } | 649 } |
561 lfs: need to transfer 2 objects (31 bytes) | 650 lfs: need to transfer 2 objects (31 bytes) |
562 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) | 651 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) |
563 Status: 200 | 652 Status: 200 |
564 Content-Length: 12 | 653 Content-Length: 12 |
565 Content-Type: text/plain; charset=utf-8 | 654 Content-Type: text/plain; charset=utf-8 (git-server !) |
566 Date: $HTTP_DATE$ | 655 Content-Type: application/octet-stream (hg-server !) |
656 Date: $HTTP_DATE$ | |
657 Server: testing stub value (hg-server !) | |
567 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache | 658 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache |
568 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b | 659 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b |
569 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | 660 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
570 Status: 200 | 661 Status: 200 |
571 Content-Length: 19 | 662 Content-Length: 19 |
572 Content-Type: text/plain; charset=utf-8 | 663 Content-Type: text/plain; charset=utf-8 (git-server !) |
573 Date: $HTTP_DATE$ | 664 Content-Type: application/octet-stream (hg-server !) |
665 Date: $HTTP_DATE$ | |
666 Server: testing stub value (hg-server !) | |
574 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache | 667 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache |
575 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 668 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
576 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | 669 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
577 THIS-IS-LFS | 670 THIS-IS-LFS |
578 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | 671 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
590 adding a | 683 adding a |
591 reverting b | 684 reverting b |
592 reverting c | 685 reverting c |
593 reverting d | 686 reverting d |
594 Status: 200 | 687 Status: 200 |
595 Content-Length: 905 | 688 Content-Length: 905 (git-server !) |
596 Content-Type: application/vnd.git-lfs+json | 689 Content-Length: 988 (hg-server !) |
597 Date: $HTTP_DATE$ | 690 Content-Type: application/vnd.git-lfs+json |
598 { | 691 Date: $HTTP_DATE$ |
599 "objects": [ | 692 Server: testing stub value (hg-server !) |
600 { | 693 { |
601 "actions": { | 694 "objects": [ |
602 "download": { | 695 { |
603 "expires_at": "$ISO_8601_DATE_TIME$" | 696 "actions": { |
604 "header": { | 697 "download": { |
605 "Accept": "application/vnd.git-lfs" | 698 "expires_at": "$ISO_8601_DATE_TIME$" |
606 } | 699 "header": { |
607 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 700 "Accept": "application/vnd.git-lfs" |
701 } | |
702 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob) | |
608 } | 703 } |
609 } | 704 } |
610 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" | 705 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" |
611 "size": 12 | 706 "size": 12 |
612 } | 707 } |
615 "download": { | 710 "download": { |
616 "expires_at": "$ISO_8601_DATE_TIME$" | 711 "expires_at": "$ISO_8601_DATE_TIME$" |
617 "header": { | 712 "header": { |
618 "Accept": "application/vnd.git-lfs" | 713 "Accept": "application/vnd.git-lfs" |
619 } | 714 } |
620 "href": "http://localhost:$HGPORT/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" | 715 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob) |
621 } | 716 } |
622 } | 717 } |
623 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" | 718 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" |
624 "size": 20 | 719 "size": 20 |
625 } | 720 } |
628 "download": { | 723 "download": { |
629 "expires_at": "$ISO_8601_DATE_TIME$" | 724 "expires_at": "$ISO_8601_DATE_TIME$" |
630 "header": { | 725 "header": { |
631 "Accept": "application/vnd.git-lfs" | 726 "Accept": "application/vnd.git-lfs" |
632 } | 727 } |
633 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 728 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) |
634 } | 729 } |
635 } | 730 } |
636 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" | 731 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" |
637 "size": 19 | 732 "size": 19 |
638 } | 733 } |
639 ] | 734 ] |
735 "transfer": "basic" (hg-server !) | |
640 } | 736 } |
641 lfs: need to transfer 3 objects (51 bytes) | 737 lfs: need to transfer 3 objects (51 bytes) |
642 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) | 738 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) |
643 Status: 200 | 739 Status: 200 |
644 Content-Length: 12 | 740 Content-Length: 12 |
645 Content-Type: text/plain; charset=utf-8 | 741 Content-Type: text/plain; charset=utf-8 (git-server !) |
646 Date: $HTTP_DATE$ | 742 Content-Type: application/octet-stream (hg-server !) |
743 Date: $HTTP_DATE$ | |
744 Server: testing stub value (hg-server !) | |
647 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache | 745 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache |
648 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b | 746 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b |
649 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) | 747 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) |
650 Status: 200 | 748 Status: 200 |
651 Content-Length: 20 | 749 Content-Length: 20 |
652 Content-Type: text/plain; charset=utf-8 | 750 Content-Type: text/plain; charset=utf-8 (git-server !) |
653 Date: $HTTP_DATE$ | 751 Content-Type: application/octet-stream (hg-server !) |
752 Date: $HTTP_DATE$ | |
753 Server: testing stub value (hg-server !) | |
654 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache | 754 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache |
655 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 | 755 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 |
656 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | 756 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
657 Status: 200 | 757 Status: 200 |
658 Content-Length: 19 | 758 Content-Length: 19 |
659 Content-Type: text/plain; charset=utf-8 | 759 Content-Type: text/plain; charset=utf-8 (git-server !) |
660 Date: $HTTP_DATE$ | 760 Content-Type: application/octet-stream (hg-server !) |
761 Date: $HTTP_DATE$ | |
762 Server: testing stub value (hg-server !) | |
661 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache | 763 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache |
662 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | 764 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
663 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | 765 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
664 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store | 766 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store |
665 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store | 767 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store |
677 http auth: user foo, password *** | 779 http auth: user foo, password *** |
678 resolving manifests | 780 resolving manifests |
679 branchmerge: False, force: True, partial: False | 781 branchmerge: False, force: True, partial: False |
680 ancestor: 62fdbaf221c6+, local: 62fdbaf221c6+, remote: ef0564edf47e | 782 ancestor: 62fdbaf221c6+, local: 62fdbaf221c6+, remote: ef0564edf47e |
681 Status: 200 | 783 Status: 200 |
682 Content-Length: 308 | 784 Content-Length: 308 (git-server !) |
683 Content-Type: application/vnd.git-lfs+json | 785 Content-Length: 186 (hg-server !) |
684 Date: $HTTP_DATE$ | 786 Content-Type: application/vnd.git-lfs+json |
685 { | 787 Date: $HTTP_DATE$ |
686 "objects": [ | 788 Server: testing stub value (hg-server !) |
687 { | 789 { |
688 "actions": { | 790 "objects": [ |
689 "upload": { | 791 { |
690 "expires_at": "$ISO_8601_DATE_TIME$" | 792 "actions": { (git-server !) |
691 "header": { | 793 "upload": { (git-server !) |
692 "Accept": "application/vnd.git-lfs" | 794 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !) |
693 } | 795 "header": { (git-server !) |
694 "href": "http://localhost:$HGPORT/objects/8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13" | 796 "Accept": "application/vnd.git-lfs" (git-server !) |
695 } | 797 } (git-server !) |
798 "href": "http://localhost:$HGPORT/objects/8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13" (git-server !) | |
799 } (git-server !) | |
800 "error": { (hg-server !) | |
801 "code": 404 (hg-server !) | |
802 "message": "The object does not exist" (hg-server !) | |
696 } | 803 } |
697 "oid": "8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13" | 804 "oid": "8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13" |
698 "size": 6 | 805 "size": 6 |
699 } | 806 } |
700 ] | 807 ] |
808 "transfer": "basic" (hg-server !) | |
701 } | 809 } |
702 abort: LFS server error. Remote object for "b" not found:(.*)! (re) | 810 abort: LFS server error. Remote object for "b" not found:(.*)! (re) |
703 [255] | 811 [255] |
704 | 812 |
705 Check error message when object does not exist: | 813 Check error message when object does not exist: |
724 $ rm -rf `hg config lfs.usercache` | 832 $ rm -rf `hg config lfs.usercache` |
725 | 833 |
726 (Restart the server in a different location so it no longer has the content) | 834 (Restart the server in a different location so it no longer has the content) |
727 | 835 |
728 $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS | 836 $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
837 | |
838 #if hg-server | |
839 $ cat $TESTTMP/access.log $TESTTMP/errors.log | |
840 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
841 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 201 - (glob) | |
842 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
843 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob) | |
844 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
845 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 201 - (glob) | |
846 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 201 - (glob) | |
847 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
848 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob) | |
849 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob) | |
850 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
851 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
852 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
853 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob) | |
854 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob) | |
855 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob) | |
856 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
857 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob) | |
858 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob) | |
859 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
860 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob) | |
861 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob) | |
862 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob) | |
863 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) | |
864 #endif | |
865 | |
729 $ rm $DAEMON_PIDS | 866 $ rm $DAEMON_PIDS |
730 $ mkdir $TESTTMP/lfs-server2 | 867 $ mkdir $TESTTMP/lfs-server2 |
731 $ cd $TESTTMP/lfs-server2 | 868 $ cd $TESTTMP/lfs-server2 |
732 #if no-windows | 869 #if no-windows git-server |
733 $ lfs-test-server &> lfs-server.log & | 870 $ lfs-test-server &> lfs-server.log & |
734 $ echo $! >> $DAEMON_PIDS | 871 $ echo $! >> $DAEMON_PIDS |
735 #else | 872 #endif |
873 | |
874 #if windows git-server | |
736 $ $PYTHON $TESTTMP/spawn.py >> $DAEMON_PIDS | 875 $ $PYTHON $TESTTMP/spawn.py >> $DAEMON_PIDS |
876 #endif | |
877 | |
878 #if hg-server | |
879 $ hg init server2 | |
880 $ hg --config "lfs.usercache=$TESTTMP/servercache2" -R server2 serve -d \ | |
881 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log | |
882 $ cat hg.pid >> $DAEMON_PIDS | |
737 #endif | 883 #endif |
738 | 884 |
739 $ cd $TESTTMP | 885 $ cd $TESTTMP |
740 $ hg --debug clone test test2 | 886 $ hg --debug clone test test2 |
741 http auth: user foo, password *** | 887 http auth: user foo, password *** |
744 updating to branch default | 890 updating to branch default |
745 resolving manifests | 891 resolving manifests |
746 branchmerge: False, force: False, partial: False | 892 branchmerge: False, force: False, partial: False |
747 ancestor: 000000000000, local: 000000000000+, remote: d2a338f184a8 | 893 ancestor: 000000000000, local: 000000000000+, remote: d2a338f184a8 |
748 Status: 200 | 894 Status: 200 |
749 Content-Length: 308 | 895 Content-Length: 308 (git-server !) |
750 Content-Type: application/vnd.git-lfs+json | 896 Content-Length: 186 (hg-server !) |
751 Date: $HTTP_DATE$ | 897 Content-Type: application/vnd.git-lfs+json |
752 { | 898 Date: $HTTP_DATE$ |
753 "objects": [ | 899 Server: testing stub value (hg-server !) |
754 { | 900 { |
755 "actions": { | 901 "objects": [ |
756 "upload": { | 902 { |
757 "expires_at": "$ISO_8601_DATE_TIME$" | 903 "actions": { (git-server !) |
758 "header": { | 904 "upload": { (git-server !) |
759 "Accept": "application/vnd.git-lfs" | 905 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !) |
760 } | 906 "header": { (git-server !) |
761 "href": "http://localhost:$HGPORT/objects/bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a" | 907 "Accept": "application/vnd.git-lfs" (git-server !) |
762 } | 908 } (git-server !) |
909 "href": "http://localhost:$HGPORT/objects/bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a" (git-server !) | |
910 } (git-server !) | |
911 "error": { (hg-server !) | |
912 "code": 404 (hg-server !) | |
913 "message": "The object does not exist" (hg-server !) | |
763 } | 914 } |
764 "oid": "bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a" | 915 "oid": "bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a" |
765 "size": 6 | 916 "size": 6 |
766 } | 917 } |
767 ] | 918 ] |
919 "transfer": "basic" (hg-server !) | |
768 } | 920 } |
769 abort: LFS server error. Remote object for "a" not found:(.*)! (re) | 921 abort: LFS server error. Remote object for "a" not found:(.*)! (re) |
770 [255] | 922 [255] |
771 | 923 |
772 $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS | 924 $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |