From b483769217555fadce5dc461d7fbf991b156c772 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 9 Oct 2013 07:58:19 +0100 Subject: Test that admin can push to master in public repo --- git.liw.fi.yarn | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/git.liw.fi.yarn b/git.liw.fi.yarn index 5c662ee..33f93f3 100644 --- a/git.liw.fi.yarn +++ b/git.liw.fi.yarn @@ -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 +repo. + + 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" fi +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+) + cd "$DATADIR/$MATCH_1/$MATCH_3" + + # 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+) + cd "$DATADIR/$MATCH_1/$MATCH_3" + git checkout "$MATCH_2" + git push origin HEAD + Cgit access ----------- -- cgit v1.2.1