tests/test-lfs-serve-access.t
changeset 46116 17a695357270
parent 45906 95c4cca641f6
child 46314 95a615dd77bf
equal deleted inserted replaced
46115:be3d8178251e 46116:17a695357270
    30   $ hg -R client push http://localhost:$HGPORT
    30   $ hg -R client push http://localhost:$HGPORT
    31   pushing to http://localhost:$HGPORT/
    31   pushing to http://localhost:$HGPORT/
    32   searching for changes
    32   searching for changes
    33   abort: LFS HTTP error: HTTP Error 400: no such method: .git
    33   abort: LFS HTTP error: HTTP Error 400: no such method: .git
    34   (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "upload" is supported)
    34   (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "upload" is supported)
    35   [255]
    35   [50]
    36 
    36 
    37 ... so do a local push to make the data available.  Remove the blob from the
    37 ... so do a local push to make the data available.  Remove the blob from the
    38 default cache, so it attempts to download.
    38 default cache, so it attempts to download.
    39   $ hg --config "lfs.usercache=$TESTTMP/servercache" \
    39   $ hg --config "lfs.usercache=$TESTTMP/servercache" \
    40   >    --config "lfs.url=null://" \
    40   >    --config "lfs.url=null://" \
    52   added 1 changesets with 1 changes to 1 files
    52   added 1 changesets with 1 changes to 1 files
    53   new changesets 525251863cad
    53   new changesets 525251863cad
    54   updating to branch default
    54   updating to branch default
    55   abort: LFS HTTP error: HTTP Error 400: no such method: .git
    55   abort: LFS HTTP error: HTTP Error 400: no such method: .git
    56   (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "download" is supported)
    56   (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "download" is supported)
    57   [255]
    57   [50]
    58 
    58 
    59   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
    59   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
    60 
    60 
    61   $ cat $TESTTMP/access.log $TESTTMP/errors.log
    61   $ cat $TESTTMP/access.log $TESTTMP/errors.log
    62   $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
    62   $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
    78 Reasonable hint for a misconfigured blob server
    78 Reasonable hint for a misconfigured blob server
    79 
    79 
    80   $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT/missing
    80   $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT/missing
    81   abort: LFS HTTP error: HTTP Error 404: Not Found
    81   abort: LFS HTTP error: HTTP Error 404: Not Found
    82   (the "lfs.url" config may be used to override http://localhost:$HGPORT/missing)
    82   (the "lfs.url" config may be used to override http://localhost:$HGPORT/missing)
    83   [255]
    83   [50]
    84 
    84 
    85   $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT2/missing
    85   $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT2/missing
    86   abort: LFS error: *onnection *refused* (glob) (?)
    86   abort: LFS error: *onnection *refused* (glob) (?)
    87   abort: LFS error: $EADDRNOTAVAIL$ (glob) (?)
    87   abort: LFS error: $EADDRNOTAVAIL$ (glob) (?)
    88   abort: LFS error: No route to host (?)
    88   abort: LFS error: No route to host (?)
    89   (the "lfs.url" config may be used to override http://localhost:$HGPORT2/missing)
    89   (the "lfs.url" config may be used to override http://localhost:$HGPORT2/missing)
    90   [255]
    90   [50]
    91 
    91 
    92 Blob URIs are correct when --prefix is used
    92 Blob URIs are correct when --prefix is used
    93 
    93 
    94   $ hg clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2
    94   $ hg clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2
    95   using http://localhost:$HGPORT/subdir/mount/point
    95   using http://localhost:$HGPORT/subdir/mount/point
   265   adding file changes
   265   adding file changes
   266   added 1 changesets with 1 changes to 1 files
   266   added 1 changesets with 1 changes to 1 files
   267   new changesets 525251863cad
   267   new changesets 525251863cad
   268   updating to branch default
   268   updating to branch default
   269   abort: LFS server error for "lfs.bin": Internal server error
   269   abort: LFS server error for "lfs.bin": Internal server error
   270   [255]
   270   [50]
   271 
   271 
   272 Test an I/O error in localstore.verify() (Batch API) with PUT
   272 Test an I/O error in localstore.verify() (Batch API) with PUT
   273 
   273 
   274   $ echo foo > client/lfs.bin
   274   $ echo foo > client/lfs.bin
   275   $ hg -R client ci -m 'mod lfs'
   275   $ hg -R client ci -m 'mod lfs'
   276   $ hg -R client push http://localhost:$HGPORT1
   276   $ hg -R client push http://localhost:$HGPORT1
   277   pushing to http://localhost:$HGPORT1/
   277   pushing to http://localhost:$HGPORT1/
   278   searching for changes
   278   searching for changes
   279   abort: LFS server error for "unknown": Internal server error
   279   abort: LFS server error for "unknown": Internal server error
   280   [255]
   280   [50]
   281 TODO: figure out how to associate the file name in the error above
   281 TODO: figure out how to associate the file name in the error above
   282 
   282 
   283 Test a bad checksum sent by the client in the transfer API
   283 Test a bad checksum sent by the client in the transfer API
   284 
   284 
   285   $ hg -R client push http://localhost:$HGPORT1
   285   $ hg -R client push http://localhost:$HGPORT1
   286   pushing to http://localhost:$HGPORT1/
   286   pushing to http://localhost:$HGPORT1/
   287   searching for changes
   287   searching for changes
   288   abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)
   288   abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)
   289   [255]
   289   [50]
   290 
   290 
   291   $ echo 'test lfs file' > server/lfs3.bin
   291   $ echo 'test lfs file' > server/lfs3.bin
   292   $ hg --config experimental.lfs.disableusercache=True \
   292   $ hg --config experimental.lfs.disableusercache=True \
   293   >    -R server ci -Aqm 'another lfs file'
   293   >    -R server ci -Aqm 'another lfs file'
   294   $ hg -R client pull -q http://localhost:$HGPORT1
   294   $ hg -R client pull -q http://localhost:$HGPORT1
   296 Test an I/O error during the processing of the GET request
   296 Test an I/O error during the processing of the GET request
   297 
   297 
   298   $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
   298   $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
   299   >    -R client update -r tip
   299   >    -R client update -r tip
   300   abort: LFS HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)
   300   abort: LFS HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)
   301   [255]
   301   [50]
   302 
   302 
   303 Test a checksum failure during the processing of the GET request
   303 Test a checksum failure during the processing of the GET request
   304 
   304 
   305   $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
   305   $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
   306   >    -R client update -r tip
   306   >    -R client update -r tip
   307   abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)
   307   abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)
   308   [255]
   308   [50]
   309 
   309 
   310   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
   310   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
   311 
   311 
   312   $ cat $TESTTMP/access.log
   312   $ cat $TESTTMP/access.log
   313   $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
   313   $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
   451   $ hg -R auth_clone push --config extensions.x=use_digests.py
   451   $ hg -R auth_clone push --config extensions.x=use_digests.py
   452   pushing to http://localhost:$HGPORT1/
   452   pushing to http://localhost:$HGPORT1/
   453   searching for changes
   453   searching for changes
   454   abort: LFS HTTP error: HTTP Error 401: the server must support Basic Authentication
   454   abort: LFS HTTP error: HTTP Error 401: the server must support Basic Authentication
   455   (api=http://localhost:$HGPORT1/.git/info/lfs/objects/batch, action=upload)
   455   (api=http://localhost:$HGPORT1/.git/info/lfs/objects/batch, action=upload)
   456   [255]
   456   [50]
   457 
   457 
   458   $ hg -R auth_clone --debug push | egrep '^[{}]|  '
   458   $ hg -R auth_clone --debug push | egrep '^[{}]|  '
   459   {
   459   {
   460     "objects": [
   460     "objects": [
   461       {
   461       {