git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] t9400: Add some basic pserver tests

From
Frank Lichtenheld <frank@lichtenheld.de>
Date
May 20, 2007, 22:31 UTC
Message-ID
<11797003193447-git-send-email-frank@lichtenheld.de>
In-Reply-To
<11797003191512-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/t9400-git-cvsserver-server.sh |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index e42943e..7f9c6e2 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -47,6 +47,40 @@ test_expect_success 'basic checkout' \
   'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5))" = "empty/1.1/"'
 
+#------------------------
+# PSERVER AUTHENTICATION
+#------------------------
+
+cat >request-anonymous  <<EOF
+BEGIN AUTH REQUEST
+$SERVERDIR
+anonymous
+
+END AUTH REQUEST
+EOF
+
+cat >request-git  <<EOF
+BEGIN AUTH REQUEST
+$SERVERDIR
+git
+
+END AUTH REQUEST
+EOF
+
+test_expect_success 'pserver authentication' \
+  'cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
+   tail -n1 log | grep -q "^I LOVE YOU$"'
+
+test_expect_success 'pserver authentication failure (non-anonymous user)' \
+  'if cat request-git | git-cvsserver pserver >log 2>&1
+   then
+       false
+   else
+       true
+   fi &&
+   tail -n1 log | grep -q "^I HATE YOU$"'
+
+
 #--------------
 # CONFIG TESTS
 #--------------
-- 
1.5.2-rc3.GIT
Previous: Frank LichtenheldNext: Junio C Hamano
Message 3 of 7 in “t9400: Add test cases for config file handling”
  1. 1/3 t9400: Add test cases for config file handlingFrank Lichtenheld, May 20, 2007
  2. 2/3 t9400: Add some more cvs update testsFrank Lichtenheld, May 20, 2007
  3. 3/3 t9400: Add some basic pserver testsFrank Lichtenheld, May 20, 2007
  4. Junio C HamanoMay 21, 2007
  5. Frank LichtenheldMay 21, 2007
  6. Junio C HamanoMay 21, 2007
  7. Frank LichtenheldMay 21, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.