@matheusbsbs / matheus-bagliano / commits / 240ba7f235
Fork 0

t9400: Add some basic pserver tests

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> Signed-off-by: Junio C Hamano <junkio@cox.net>

Frank Lichtenheld committed May 21, 2007 at 00:31 UTC 240ba7f235c9b946678bd6d34826fb73ea8fd90e
1 file changed +34
t/t9400-git-cvsserver-server.sh
+34
@@ -47,6 +47,40 @@ test_expect_success 'basic checkout' \
47 'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
48 test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5))" = "empty/1.1/"'
49
50 +#------------------------
51 +# PSERVER AUTHENTICATION
52 +#------------------------
53 +
54 +cat >request-anonymous <<EOF
55 +BEGIN AUTH REQUEST
56 +$SERVERDIR
57 +anonymous
58 +
59 +END AUTH REQUEST
60 +EOF
61 +
62 +cat >request-git <<EOF
63 +BEGIN AUTH REQUEST
64 +$SERVERDIR
65 +git
66 +
67 +END AUTH REQUEST
68 +EOF
69 +
70 +test_expect_success 'pserver authentication' \
71 + 'cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
72 + tail -n1 log | grep -q "^I LOVE YOU$"'
73 +
74 +test_expect_success 'pserver authentication failure (non-anonymous user)' \
75 + 'if cat request-git | git-cvsserver pserver >log 2>&1
76 + then
77 + false
78 + else
79 + true
80 + fi &&
81 + tail -n1 log | grep -q "^I HATE YOU$"'
82 +
83 +
84 #--------------
85 # CONFIG TESTS
86 #--------------