[PATCH 3 of 4 stable] largefiles: test coverage of error handling from putlfile

Mads Kiilerich mads at kiilerich.com
Wed Oct 21 14:16:06 CDT 2015


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1445454338 -7200
#      Wed Oct 21 21:05:38 2015 +0200
# Branch stable
# Node ID 45a74ff314b78e2539049bbf3e90d59e9a6c90dd
# Parent  a7c4f137d713879f180d036bab3cf8786b7cf45e
largefiles: test coverage of error handling from putlfile

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,33 @@ 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
+
+  $ 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


More information about the Mercurial-devel mailing list