From: Frank Lichtenheld <frank@lichtenheld.de>
To: git@vger.kernel.org
Cc: Junio C Hamano <junkio@cox.net>,
Martin Langhoff <martin.langhoff@gmail.com>,
Frank Lichtenheld <frank@lichtenheld.de>
Subject: [PATCH/RFC] git-cvsserver: Add a basic test file for cvsserver
Date: Sun, 29 Apr 2007 22:10:27 +0200 [thread overview]
Message-ID: <11778774271937-git-send-email-frank@lichtenheld.de> (raw)
Contains only one test (checkout) at this point and is
mostly indented to be used as a RFC to discuss
how to properly implement tests for git-cvsserver.
Currently the test uses netcat to run git-cvsserver
pserver on a unprivilegded port.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
t/t9400-git-cvsserver-read.sh | 56 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
create mode 100644 t/t9400-git-cvsserver-read.sh
Since this is my first test script for git I would welcome comments
and suggestions. Especially if someone has a simpler method of
testing it than the somewhat fragile netcat hack I used.
diff --git a/t/t9400-git-cvsserver-read.sh b/t/t9400-git-cvsserver-read.sh
new file mode 100644
index 0000000..311d6c5
--- /dev/null
+++ b/t/t9400-git-cvsserver-read.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Frank Lichtenheld
+#
+
+test_description='git-cvsserver read access
+
+tests read access to a git repository with the
+cvs CLI client via git-cvsserver pserver'
+
+. ./test-lib.sh
+
+cvs >/dev/null 2>&1
+if test $? -ne 1
+then
+ test_expect_success 'skipping git-cvsserver tests, cvs not found' :
+ test_done
+ exit
+fi
+netcat -h >/dev/null 2>&1
+if test $? -ne 1
+then
+ test_expect_success 'skipping git-cvsserver tests, netcat not found' :
+ test_done
+ exit
+fi
+
+unset GIT_DIR GIT_CONFIG
+WORKDIR=$(pwd)
+SERVERDIR=$(pwd)/gitcvs.git
+CVSROOT=":pserver:anonymous@localhost:12345$SERVERDIR"
+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
+
+start_pserver () {
+ netcat -l -p 12345 -c "git-cvsserver pserver" localhost &
+ echo $! >nc.pid
+}
+start_pserver
+
+# note that cvs doesn't accept absolute pathnames
+# as argument to co -d
+test_expect_success 'basic checkout' \
+ "cvs -Q co -d cvswork master"
+
+kill $(cat nc.pid) 2>/dev/null
+
+test_done
--
1.5.1.2
next reply other threads:[~2007-04-29 20:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-29 20:10 Frank Lichtenheld [this message]
2007-05-01 8:50 ` [PATCH/RFC] git-cvsserver: Add a basic test file for cvsserver Junio C Hamano
2007-05-01 11:29 ` Frank Lichtenheld
2007-05-02 0:45 ` [PATCH] cvsserver: Add test cases for git-cvsserver Frank Lichtenheld
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=11778774271937-git-send-email-frank@lichtenheld.de \
--to=frank@lichtenheld.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=martin.langhoff@gmail.com \
/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).