summaryrefslogtreecommitdiff
path: root/git.liw.fi.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git.liw.fi.sh')
-rw-r--r--git.liw.fi.sh25
1 files changed, 24 insertions, 1 deletions
diff --git a/git.liw.fi.sh b/git.liw.fi.sh
index b064ad5..8e3ecd0 100644
--- a/git.liw.fi.sh
+++ b/git.liw.fi.sh
@@ -10,6 +10,20 @@ die()
}
+# Attempt to run something, which may fail. Store the stdout,
+# stderr, and exit code in $DATADIR.
+
+attempt()
+{
+ if "$@" > "$DATADIR/attempt.stdout" 2> "$DATADIR/attempt.stderr"
+ then
+ echo 0 > "$DATADIR/attempt.exit"
+ else
+ echo $? > "$DATADIR/attempt.exit"
+ fi
+}
+
+
# Run gitano on the server using a desired ssh key. The key is
# either the admin key (i.e., they key of whoever invoked the
# test suite), or a test key we've created in $DATADIR.
@@ -23,7 +37,7 @@ run_gitano_as()
ssh "$GITANO@$GITHOST" "$@"
else
SSH_AUTH_SOCK= ssh -F "ssh.conf" -i "$DATADIR/$keyname.key" \
- "$GITANO@GITHOST" "$@"
+ "$GITANO@$GITHOST" "$@"
fi
}
@@ -36,6 +50,15 @@ user_exists()
}
+# Create a user, including setting their ssh key.
+
+user_add()
+{
+ run_gitano_as "$1" user add "$2" name foo@example.com
+ run_gitano_as "$1" as "$2" sshkey add somekey < "$DATADIR/$2.key.pub"
+}
+
+
# Remove a user from the server. This is a two-step process.
user_del()