summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git.liw.fi.sh21
-rw-r--r--git.liw.fi.yarn18
2 files changed, 39 insertions, 0 deletions
diff --git a/git.liw.fi.sh b/git.liw.fi.sh
index 9f03ff3..6f20266 100644
--- a/git.liw.fi.sh
+++ b/git.liw.fi.sh
@@ -124,3 +124,24 @@ destroy_repo()
{
two_step run_gitano_as "$1" destroy "$2"
}
+
+
+# Does cgit show a repository?
+
+cgit_shows()
+{
+ local tempfile="$(mktemp)"
+ wget -q -O- "http://$GITHOST/cgi-bin/cgit/cgit.cgi/$1/" \
+ > "$tempfile" 2>&1
+ if grep 'Repository seems to be empty' "$tempfile"
+ then
+ ret=0
+ elif grep 'Commit message' "$tempfile"
+ then
+ ret=0
+ else
+ ret=1
+ fi
+ rm -f "$tempfile"
+ return $ret
+}
diff --git a/git.liw.fi.yarn b/git.liw.fi.yarn
index 1e009fb..5c662ee 100644
--- a/git.liw.fi.yarn
+++ b/git.liw.fi.yarn
@@ -85,6 +85,7 @@ be able to remove the repository.
AND admin can clone tstrepo using ssh
AND tstusr can see repository tstrepo
AND tstusr can clone tstrepo using ssh
+ AND cgit shows repository tstrepo
WHEN tstusr attempts to remove repository tstrepo
THEN attempt failed with error matching "You may not destroy repositories you do not own"
@@ -95,6 +96,7 @@ be able to remove the repository.
AND admin can't clone tstrepo using ssh
AND tstusr can't see repository tstrepo
AND tstusr can't clone tstrepo using ssh
+ AND cgit doesn't show repository tstrepo
FINALLY remove repository tstrepo on server
AND remove user tstusr on server
@@ -299,3 +301,19 @@ can try.
IMPLEMENTS WHEN (\S+) attempts to remove repository (\S+)
attempt destroy_repo "$MATCH_1" "$MATCH_2"
+
+Cgit access
+-----------
+
+Verify that cgit shows a repository.
+
+ IMPLEMENTS THEN cgit shows repository (\S+)
+ cgit_shows "$MATCH_1"
+
+Verify cgit doesn't show a repository.
+
+ IMPLEMENTS THEN cgit doesn't show repository (\S+)
+ if cgit_shows "$MATCH_1"
+ then
+ die "cgi shows $MATCH_1 but shouldn't"
+ fi