changeset 26824:30db531e4146 stable

largefiles: test coverage of error handling from putlfile This reveals a wrong and unhelpful 'unexpected putlfile response'.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 23 Oct 2015 21:27:29 +0200
parents 45e8bd2f36f0
children 78539633acf3
files tests/test-largefiles-cache.t
diffstat 1 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-largefiles-cache.t	Fri Oct 23 21:27:29 2015 +0200
+++ b/tests/test-largefiles-cache.t	Fri Oct 23 21:27:29 2015 +0200
@@ -200,3 +200,34 @@
   ! 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