t9400: Add some more cvs update tests
PATCH 1/1 t9400: Add some more cvs update tests
Add some cvs update tests that include various merge situations. Also add a basic test for update -C since it fits so well in there.
--- t/t9400-git-cvsserver-server.sh | 66 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-)
t/t9400-git-cvsserver-server.sh +66 -0
@@ -123,4 +123,70 @@ test_expect_success 'cvs update (re-add deleted file)' \ test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" && diff -q testfile1 ../testfile1' +cd "$WORKDIR" +test_expect_success 'cvs update (merge)' \ + 'echo Line 0 >expected && + for i in 1 2 3 4 5 6 7 + do + echo Line $i >>merge + echo Line $i >>expected + done && + echo Line 8 >>expected && + git add merge && + git commit -q -m "Merge test (pre-merge)" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" && + diff -q merge ../merge && + ( echo Line 0; cat merge ) >merge.tmp && + mv merge.tmp merge && + cd "$WORKDIR" && + echo Line 8 >>merge && + git add merge && + git commit -q -m "Merge test (merge)" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + diff -q merge ../expected' + +cd "$WORKDIR" +test_expect_success 'cvs update (conflict merge)' \ + '( echo LINE 0; cat merge ) >merge.tmp && + mv merge.tmp merge && + cat >expected.C <<EOF && +<<<<<<< merge.mine +Line 0 +======= +LINE 0 +>>>>>>> merge.3 +EOF + for i in 1 2 3 4 5 6 7 8 + do + echo Line $i >>expected.C + done && + git add merge && + git commit -q -m "Merge test (conflict)" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + diff -q merge ../expected.C' + +cd "$WORKDIR" +test_expect_success 'cvs update (-C)' \ + 'cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update -C && + diff -q merge ../merge' + +cd "$WORKDIR" +test_expect_success 'cvs update (merge no-op)' \ + 'echo Line 9 >>merge && + cp merge cvswork/merge && + git add merge && + git commit -q -m "Merge test (no-op)" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + diff -q merge ../merge' + test_done
Signature · 1 line
1.5.1.4
PATCH 1/1 cvsserver: 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.
--- t/t9410-git-cvsserver-pserver.sh | 53 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 t/t9410-git-cvsserver-pserver.sh
t/t9410-git-cvsserver-pserver.sh new file +53 -0
@@ -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
Signature · 1 line
1.5.1.4
Re: [PATCH] cvsserver: Add some basic pserver tests
Quoted 8 lines · Frank Lichtenheld
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 <[email protected]>...
t/t9410-git-cvsserver-pserver.sh line 35
Quoted 9 lines
t/t9410-git-cvsserver-pserver.sh new file +9
-0+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$"'
In the past, some people with non-bash shells had trouble with here text (i.e. <<HERE) inside our test scripts Either our use of eval to run the test in test_expect_success is not kosher, or their implementation of eval was slightly broken --- I do not recall if we ever dug down to the bottom of the problem. That is why most tests have here-text to prepare test vectors outside of tests themselves.