diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | testing/02-commands-rsync.yarn | 26 | ||||
-rw-r--r-- | testing/gitano-test-tool.in | 4 | ||||
-rw-r--r-- | testing/library.yarn | 12 |
4 files changed, 43 insertions, 1 deletions
@@ -34,7 +34,7 @@ TESTS := 01-basics 02-commands-as 02-commands-config 02-commands-copy \ 02-commands-count-objects 02-commands-create 02-commands-destroy \ 02-commands-fsck 02-commands-gc 02-commands-graveyard \ 02-commands-git-upload-archive 02-commands-group 02-commands-help \ - 02-commands-ls 02-commands-readme 02-commands-rename \ + 02-commands-ls 02-commands-readme 02-commands-rename 02-commands-rsync \ 02-commands-sshkey 02-commands-user 02-commands-whoami 03-cgit-support diff --git a/testing/02-commands-rsync.yarn b/testing/02-commands-rsync.yarn new file mode 100644 index 0000000..83ee30c --- /dev/null +++ b/testing/02-commands-rsync.yarn @@ -0,0 +1,26 @@ +<!-- -*- markdown -*- --> + +rsync - Access per-repository rsync space +========================================= + +Gitano will accept rsync server commands when the rsync plugin is enabled. + + SCENARIO rsync + +Files may be copied into this space with +`rsync filename gituser@gitanoserver:repository/filename`. + + GIVEN a standard instance + AND testfile contains foo + WHEN testinstance adminkey rsync's testfile to gitano-admin.git + +This copies into the `rsync` directory in the git repository on the server. + + THEN server-side gitano-admin.git file rsync/testfile contains foo + +Files may be copied back out again as you normally would with rsync +i.e. `rsync gituser@gitanoserver:repository/filename filename`. + + GIVEN testfile contains bar + WHEN testinstance adminkey rsync's testfile from gitano-admin.git + THEN testfile contains foo diff --git a/testing/gitano-test-tool.in b/testing/gitano-test-tool.in index 3fc6599..8ed7546 100644 --- a/testing/gitano-test-tool.in +++ b/testing/gitano-test-tool.in @@ -187,6 +187,10 @@ function cmd_runcommand(user, key, ...) run_program(cmdline) end +function cmd_rsh(user, key, dummy, ...) + return cmd_runcommand(user, key, ...) +end + function cmd_clonelocation(user, localname) print(user_home(user) .. "/" .. localname) end diff --git a/testing/library.yarn b/testing/library.yarn index edd659b..bda2aa5 100644 --- a/testing/library.yarn +++ b/testing/library.yarn @@ -68,6 +68,15 @@ Clone manipulation mkdir -p "$DATADIR/$MATCH_5" $GTT gitarchive $MATCH_1 $MATCH_2 $MATCH_3 $MATCH_4 | tar -C "$DATADIR/$MATCH_5" -x +rsync manipulation +------------------ + + IMPLEMENTS WHEN ([a-z][a-z0-9]*) ([a-z][a-z0-9]*) rsync'?s (.*) to (.*) + rsync -I --rsh="$GTT rsh $MATCH_1 $MATCH_2" "$DATADIR/$MATCH_3" "dummy:$MATCH_4/$MATCH_3" + + IMPLEMENTS WHEN ([a-z][a-z0-9]*) ([a-z][a-z0-9]*) rsync'?s (.*) from (.*) + rsync -I --rsh="$GTT rsh $MATCH_1 $MATCH_2" "dummy:$MATCH_4/$MATCH_3" "$DATADIR/$MATCH_3" + Admin repo manipulation ----------------------- @@ -93,6 +102,9 @@ Generic utility methods false fi + IMPLEMENTS GIVEN ([^ ]+) contains (.+) + printf %s "$MATCH_2" >"$DATADIR/$MATCH_1" + IMPLEMENTS THEN ([^ ]+) contains (.+) grep -q "$MATCH_2" $DATADIR/"$MATCH_1" |