[PATCH] cvsserver: Add some basic pserver tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While we can easily test the cvs <-> git-cvsserver
communication with :fork: and git-cvsserver server
there are some pserver specifics we should test, too.

Currently this are two tests of the pserver authentication.

Signed-off-by: Frank Lichtenheld <frank@xxxxxxxxxxxxxx>
---
 t/t9410-git-cvsserver-pserver.sh |   53 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)
 create mode 100644 t/t9410-git-cvsserver-pserver.sh

diff --git a/t/t9410-git-cvsserver-pserver.sh b/t/t9410-git-cvsserver-pserver.sh
new file mode 100644
index 0000000..1cf9bc7
--- /dev/null
+++ b/t/t9410-git-cvsserver-pserver.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+# 
+# Copyright (c) 2007 Frank Lichtenheld
+#
+
+test_description='git-cvsserver pserver access
+
+tests some pserver specific features (like
+authentication).'
+
+. ./test-lib.sh
+
+unset GIT_DIR GIT_CONFIG
+WORKDIR=$(pwd)
+SERVERDIR=$(pwd)/gitcvs.git
+CVSWORK=$(pwd)/cvswork
+export CVSROOT CVSWORK
+
+rm -rf "$CVSWORK" "$SERVERDIR"
+echo >empty &&
+  git add empty &&
+  git commit -q -m "First Commit" &&
+  git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
+  GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true ||
+  exit 1
+
+test_expect_success 'authentication' \
+  'cat <<EOF | git-cvsserver pserver >log 2>&1 &&
+BEGIN AUTH REQUEST
+$SERVERDIR
+anonymous
+
+END AUTH REQUEST
+EOF
+   tail -n1 log | grep -q "^I LOVE YOU$"'
+
+test_expect_success 'authentication failure (non-anonymous user)' \
+  'if cat <<EOF | git-cvsserver pserver >log 2>&1
+BEGIN AUTH REQUEST
+$SERVERDIR
+git
+
+END AUTH REQUEST
+EOF
+   then
+       false
+   else
+       true
+   fi &&
+   tail -n1 log | grep -q "^I HATE YOU$"'
+
+
+test_done
-- 
1.5.1.4

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux