summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2016-01-04 11:05:40 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2016-01-04 11:05:40 +0000
commit264e80751592d3c8b3aa4cf09bd71660f745f994 (patch)
treeb556e9584c61882e75d8dcca4acf6d96c10ab559
parent515369fa2d90d4cb45dabf76254e29b9ae548b3b (diff)
parent3789d955ef6f3d752f93db610a7de2c33851863b (diff)
downloadgitano-264e80751592d3c8b3aa4cf09bd71660f745f994.tar.bz2
Merge remote-tracking branch 'rmaw/yarns'
Reviewed and ok.
-rw-r--r--Makefile9
-rw-r--r--skel/gitano-admin/rules/defines.lace2
-rw-r--r--testing/02-commands-config.yarn18
-rw-r--r--testing/02-commands-rsync.yarn26
-rw-r--r--testing/02-commands-set-description.yarn1
-rw-r--r--testing/02-commands-set-head.yarn1
-rw-r--r--testing/02-commands-set-owner.yarn1
-rw-r--r--testing/gitano-test-tool.in4
-rw-r--r--testing/library.yarn12
9 files changed, 65 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 3b789fc..d82eec1 100644
--- a/Makefile
+++ b/Makefile
@@ -32,11 +32,10 @@ TEST_BIN_NAMES := gitano-test-tool
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-set-description 02-commands-set-head \
- 02-commands-set-owner 02-commands-sshkey 02-commands-user \
- 02-commands-whoami 03-cgit-support
+ 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-rsync \
+ 02-commands-sshkey 02-commands-user 02-commands-whoami 03-cgit-support
MODS := gitano \
diff --git a/skel/gitano-admin/rules/defines.lace b/skel/gitano-admin/rules/defines.lace
index 95e729e..5dbfa4d 100644
--- a/skel/gitano-admin/rules/defines.lace
+++ b/skel/gitano-admin/rules/defines.lace
@@ -2,7 +2,7 @@
# User/group related
define is_admin group gitano-admin
-define is_owner owner ${user}
+define is_owner config/project/owner ${user}
define if_asanother as_user ~.
diff --git a/testing/02-commands-config.yarn b/testing/02-commands-config.yarn
index fb8f61f..17436cd 100644
--- a/testing/02-commands-config.yarn
+++ b/testing/02-commands-config.yarn
@@ -44,6 +44,24 @@ for it.
THEN stderr is empty
AND stdout contains project.head: refs/heads/trunk
+When we create a repository it is owned by the creator,
+but we can change this after it has been created.
+
+<!-- TODO: config set project.owner shouldn't let you change the user if it
+ doesn't exist yet, so when it does we need to add:
+
+> GIVEN a unix user called alice
+> AND alice has keys called main
+> WHEN testinstance, using adminkey, adds user alice, using alice main
+
+> WHEN testinstance adminkey, expecting failure, runs config testrepo set project.owner alice
+> THEN stderr contains Unknown user: alice
+-->
+
+ WHEN testinstance adminkey runs config testrepo set project.owner alice
+ AND testinstance adminkey runs config testrepo show
+ THEN stdout contains project.owner: alice
+
Changes to `HEAD` and description hit the filesystem
----------------------------------------------------
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/02-commands-set-description.yarn b/testing/02-commands-set-description.yarn
deleted file mode 100644
index f282cb0..0000000
--- a/testing/02-commands-set-description.yarn
+++ /dev/null
@@ -1 +0,0 @@
-<!-- -*- markdown -*- -->
diff --git a/testing/02-commands-set-head.yarn b/testing/02-commands-set-head.yarn
deleted file mode 100644
index f282cb0..0000000
--- a/testing/02-commands-set-head.yarn
+++ /dev/null
@@ -1 +0,0 @@
-<!-- -*- markdown -*- -->
diff --git a/testing/02-commands-set-owner.yarn b/testing/02-commands-set-owner.yarn
deleted file mode 100644
index f282cb0..0000000
--- a/testing/02-commands-set-owner.yarn
+++ /dev/null
@@ -1 +0,0 @@
-<!-- -*- markdown -*- -->
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"