largefiles: test coverage of error handling from putlfile

This reveals a wrong and unhelpful 'unexpected putlfile response'.
This commit is contained in:
Mads Kiilerich 2015-10-23 21:27:29 +02:00
parent 24ee58b9f9
commit d6bc0b0c94

View File

@ -200,3 +200,34 @@ Inject corruption into the largefiles store and see how update handles that:
! 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