diff options
authorLars Wirzenius <>2013-10-09 07:58:19 +0100
committerLars Wirzenius <>2013-10-09 07:58:19 +0100
commitb483769217555fadce5dc461d7fbf991b156c772 (patch)
parent1e69db8e6e7f17c1278e170bd1410e9fb18210eb (diff)
Test that admin can push to master in public repo
1 files changed, 53 insertions, 0 deletions
diff --git a/ b/
index 5c662ee..33f93f3 100644
--- a/
+++ b/
@@ -101,6 +101,16 @@ be able to remove the repository.
FINALLY remove repository tstrepo on server
AND remove user tstusr on server
+The admin should should be able to push to any branch in a public
+ SCENARIO admin can push to public repository
+ WHEN admin creates repository tstrepo
+ AND admin clones tstrepo over ssh
+ AND admin makes change to master in tstrepo
+ THEN admin can push master in tstrepo
+ FINALLY remove repository tstrepo on server
Implementation sections
@@ -279,6 +289,10 @@ We also need to be able to check we can't clone.
die "$MATCH_1 can clone $MATCH_2 over ssh, but shouldn't"
+More variants of cloning: this is a WHEN rather than THEN.
+ IMPLEMENTS WHEN (\S+) clones (\S+) over ssh
+ clone_with_ssh "$MATCH_1" "$MATCH_2"
Repository removal
@@ -302,6 +316,45 @@ can try.
IMPLEMENTS WHEN (\S+) attempts to remove repository (\S+)
attempt destroy_repo "$MATCH_1" "$MATCH_2"
+Repository changes
+Make a change to a given branch, in a repository cloned by a specific
+user. We don't really care about what the change is, just that it's
+there. We also commit the change. If the branch doesn't exist yet, we
+create it (dealing with empty repos without branches while doing so).
+ IMPLEMENTS WHEN (\S+) makes change to (\S+) in (\S+)
+ # Create master if it doesn't exist.
+ if ! git branch | grep .
+ then
+ touch file.txt
+ git add file.txt
+ git commit -m "Initial commit"
+ fi
+ # Create wanted branch, if missing, and change to it.
+ if ! git checkout "$MATCH_2"
+ then
+ git checkout -b "$MATCH_2"
+ fi
+ date >> file.txt
+ git add file.txt
+ git commit -m "A change to file.txt"
+Repository pushing
+A named user pushes a branch to a repository.
+ IMPLEMENTS THEN (\S+) can push (\S+) in (\S+)
+ git checkout "$MATCH_2"
+ git push origin HEAD
Cgit access