# HG changeset patch # User Mads Kiilerich # Date 2015-10-23 19:27:29 # Node ID 30db531e4146750fe8f65ec5976a248259dbf0c2 # Parent 45e8bd2f36f0c350fd91d10b39c3bff38ca44c38 largefiles: test coverage of error handling from putlfile This reveals a wrong and unhelpful 'unexpected putlfile response'. diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t --- a/tests/test-largefiles-cache.t +++ b/tests/test-largefiles-cache.t @@ -200,3 +200,34 @@ Inject corruption into the largefiles st ! large ? z $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 + +#if serve + +Test coverage of error handling from putlfile: + + $ mkdir $TESTTMP/mirrorcache + $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache + $ cat hg.pid >> $DAEMON_PIDS + +(the following push fails but doesn't show why) + $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache + pushing to http://localhost:$HGPORT1/ + searching for changes + unexpected putlfile response: None + abort: remotestore: could not put $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 to remote store http://localhost:$HGPORT1/ + [255] + + $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 + +Test coverage of 'missing from store': + + $ hg serve -R ../mirror -d -p $HGPORT2 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache --config "web.allow_push=*" --config web.push_ssl=no + $ cat hg.pid >> $DAEMON_PIDS + + $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache + pushing to http://localhost:$HGPORT2/ + searching for changes + abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded) + [255] + +#endif