git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Lichtenheld <frank@lichtenheld.de>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org, Frank Lichtenheld <frank@lichtenheld.de>
Subject: [PATCH] cvsserver: Add some basic pserver tests
Date: Sun, 13 May 2007 19:49:26 +0200	[thread overview]
Message-ID: <11790785662928-git-send-email-frank@lichtenheld.de> (raw)
In-Reply-To: <1179078566806-git-send-email-frank@lichtenheld.de>

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@lichtenheld.de>
---
 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

  reply	other threads:[~2007-05-13 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-13 17:49 [PATCH] t9400: Add some more cvs update tests Frank Lichtenheld
2007-05-13 17:49 ` Frank Lichtenheld [this message]
2007-05-13 18:38   ` [PATCH] cvsserver: Add some basic pserver tests Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11790785662928-git-send-email-frank@lichtenheld.de \
    --to=frank@lichtenheld.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).