diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2016-01-05 15:34:12 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2016-01-05 15:35:23 +0000 |
commit | 777046e0b2d5451a47536d7c5c5e71ebea1f1e26 (patch) | |
tree | b4e27993e2af04b9a2af0d122144f9acaae95d5a | |
parent | 922cd6f69e3c765d1a2c341313dedb1e4a153ede (diff) | |
download | gitano-yarns.tar.bz2 |
yarns: Test basic server side copy behaviouryarns
-rw-r--r-- | testing/02-commands-copy.yarn | 24 | ||||
-rw-r--r-- | testing/library.yarn | 10 |
2 files changed, 32 insertions, 2 deletions
diff --git a/testing/02-commands-copy.yarn b/testing/02-commands-copy.yarn index f282cb0..ee5c48f 100644 --- a/testing/02-commands-copy.yarn +++ b/testing/02-commands-copy.yarn @@ -1 +1,25 @@ <!-- -*- markdown -*- --> + +You may want to copy a repository from one place on the server +to another place on the same server, +since access control is repository based +and another user of the server may want to push their own branches. + +This can be accomplished by: + +1. Creating the destination repository. +2. Cloning the source repository locally. +3. Pushing the local clone to the destination repository. + +This requires many round trips +and sending the entire repository's contents across the internet twice, +so there's use for server-side clone operation. + + SCENARIO server-side clone + GIVEN a standard instance + +Users may copy repositories they can read to paths they can write to. + + WHEN testinstance adminkey runs copy gitano-admin public/testrepo + THEN server-side public/testrepo has identical refs to gitano-admin + AND server-side public/testrepo has no missing objects diff --git a/testing/library.yarn b/testing/library.yarn index bda2aa5..a0bb6e2 100644 --- a/testing/library.yarn +++ b/testing/library.yarn @@ -40,10 +40,16 @@ Repository access Server-side repository checking for behind-the-scenes work ---------------------------------------------------------- - IMPLEMENTS THEN server-side ([^ ]+) file ([^ ]+) contains (.+) - cd "$($GTT serverlocation $MATCH_1)" + IMPLEMENTS THEN server-side ([^ ]+) file ([^ ]+) contains (.+) + cd "$($GTT serverlocation $MATCH_1)" grep -q "$MATCH_3" "$MATCH_2" + IMPLEMENTS THEN server-side ([^ ]+) has identical refs to ([^ ]+) + bash -c 'diff -u <(git ls-remote -ht "$($GTT serverlocation "$MATCH_1")" | sort -k2) <(git ls-remote -ht "$($GTT serverlocation "$MATCH_2")" | sort -k2)' + + IMPLEMENTS THEN server-side ([^ ]+) has no missing objects + cd "$($GTT serverlocation $MATCH_1)".git + git fsck Clone manipulation ------------------ |