tests/test-lfs-test-server.t
changeset 35474 16660fd4428d
parent 35473 02f54a1ec9eb
child 35475 b0c01a5ee35c
equal deleted inserted replaced
35473:02f54a1ec9eb 35474:16660fd4428d
   103   lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache
   103   lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache
   104   lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
   104   lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
   105   lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store
   105   lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store
   106   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   106   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   107 
   107 
       
   108 Test a corrupt file download, but clear the cache first to force a download
       
   109 
       
   110 XXX: ideally, the validation would occur before polluting the usercache and
       
   111 local store, with a clearer error message.
       
   112 
       
   113   $ rm -rf `hg config lfs.usercache`
       
   114   $ cp $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob
       
   115   $ echo 'damage' > $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
       
   116   $ rm ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
       
   117   $ rm ../repo1/*
       
   118   $ hg --repo ../repo1 update -C tip -v
       
   119   resolving manifests
       
   120   getting a
       
   121   lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
       
   122   getting b
       
   123   lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
       
   124   getting c
       
   125   lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
       
   126   lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
       
   127   lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
       
   128   lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
       
   129   abort: integrity check failed on data/c.i:0!
       
   130   [255]
       
   131 
       
   132 BUG: the corrupted blob was added to the usercache and local store
       
   133 
       
   134   $ cat ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | $TESTDIR/f --sha256
       
   135   sha256=fa82ca222fc9813afad3559637960bf311170cdd80ed35287f4623eb2320a660
       
   136   $ cat `hg config lfs.usercache`/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | $TESTDIR/f --sha256
       
   137   sha256=fa82ca222fc9813afad3559637960bf311170cdd80ed35287f4623eb2320a660
       
   138   $ cp blob $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
       
   139 
       
   140 Test a corrupted file upload
       
   141 
       
   142   $ echo 'another lfs blob' > b
       
   143   $ hg ci -m 'another blob'
       
   144   $ echo 'damage' > .hg/store/lfs/objects/e6/59058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0
       
   145   $ hg push -v ../repo1
       
   146   pushing to ../repo1
       
   147   searching for changes
       
   148   lfs: uploading e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (17 bytes)
       
   149   lfs: failed: LfsRemoteError('HTTP error: HTTP Error 500: Internal Server Error (oid=e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0, action=upload)',) (remaining retry 5)
       
   150   lfs: failed: LfsRemoteError('HTTP error: HTTP Error 404: Not Found (oid=e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0, action=upload)',) (remaining retry 4)
       
   151   lfs: failed: LfsRemoteError('HTTP error: HTTP Error 404: Not Found (oid=e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0, action=upload)',) (remaining retry 3)
       
   152   lfs: failed: LfsRemoteError('HTTP error: HTTP Error 404: Not Found (oid=e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0, action=upload)',) (remaining retry 2)
       
   153   lfs: failed: LfsRemoteError('HTTP error: HTTP Error 404: Not Found (oid=e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0, action=upload)',) (remaining retry 1)
       
   154   abort: HTTP error: HTTP Error 404: Not Found (oid=e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0, action=upload)!
       
   155   [255]
       
   156 
   108 Check error message when the remote missed a blob:
   157 Check error message when the remote missed a blob:
   109 
   158 
   110   $ echo FFFFF > b
   159   $ echo FFFFF > b
   111   $ hg commit -m b -A b
   160   $ hg commit -m b -A b
   112   $ echo FFFFF >> b
   161   $ echo FFFFF >> b