From e529aacf9e05d4196f02d5b4e9cf9317d00924f0 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 9 Oct 2013 09:59:31 +0100 Subject: Test that non-admin can't push to master --- git.liw.fi.yarn | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/git.liw.fi.yarn b/git.liw.fi.yarn index 0337dc7..69758a3 100644 --- a/git.liw.fi.yarn +++ b/git.liw.fi.yarn @@ -119,6 +119,21 @@ repo. FINALLY remove repository tstrepo on server +Non-admin, however, shouldn't be able to push to master. + + SCENARIO non-admin cannot push to master + ASSUMING no tstusr user exists on server + GIVEN an ssh key for tstusr + + WHEN admin creates user tstusr + AND admin creates repository tstrepo + AND tstusr clones tstrepo over ssh + AND tstusr makes change to master in tstrepo + WHEN tstusr attempts to push master in tstrepo + THEN attempt failed with error matching "FIXME" + + FINALLY remove repository tstrepo on server + Implementation sections ======================= @@ -132,6 +147,7 @@ intentionally named to be quite generic so we don't need to have multiple "foo failed with error..." steps. IMPLEMENTS THEN attempt failed with error matching "(.*)" + echo "stderr of attempted command:" cat "$DATADIR/attempt.stderr" grep "$MATCH_1" "$DATADIR/attempt.stderr" @@ -376,6 +392,13 @@ Push with tags. git checkout "$MATCH_2" git push --tags origin HEAD +Attempt to push, when the outcome may be uncertain. + + IMPLEMENTS WHEN (\S+) attempts to push (\S+) in (\S+) + cd "$DATADIR/$MATCH_1/$MATCH_3" + git checkout "$MATCH_2" + attempt git push origin HEAD + Cgit access ----------- -- cgit v1.2.1