config: unify code paths to get global config paths
[git] / t / t9400-git-cvsserver-server.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2007 Frank Lichtenheld
4 #
5
6 test_description='git-cvsserver access
7
8 tests read access to a git repository with the
9 cvs CLI client via git-cvsserver server'
10
11 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
12 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
13
14 . ./test-lib.sh
15
16 if ! test_have_prereq PERL; then
17         skip_all='skipping git cvsserver tests, perl not available'
18         test_done
19 fi
20 cvs >/dev/null 2>&1
21 if test $? -ne 1
22 then
23     skip_all='skipping git-cvsserver tests, cvs not found'
24     test_done
25 fi
26 perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
27     skip_all='skipping git-cvsserver tests, Perl SQLite interface unavailable'
28     test_done
29 }
30
31 WORKDIR=$PWD
32 SERVERDIR=$PWD/gitcvs.git
33 git_config="$SERVERDIR/config"
34 CVSROOT=":fork:$SERVERDIR"
35 CVSWORK="$PWD/cvswork"
36 CVS_SERVER=git-cvsserver
37 export CVSROOT CVS_SERVER
38
39 rm -rf "$CVSWORK" "$SERVERDIR"
40 test_expect_success 'setup' '
41   git config push.default matching &&
42   echo >empty &&
43   git add empty &&
44   git commit -q -m "First Commit" &&
45   mkdir secondroot &&
46   ( cd secondroot &&
47   git init &&
48   touch secondrootfile &&
49   git add secondrootfile &&
50   git commit -m "second root") &&
51   git fetch secondroot main &&
52   git merge --allow-unrelated-histories FETCH_HEAD &&
53   git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
54   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
55   GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" &&
56   GIT_DIR="$SERVERDIR" git config gitcvs.authdb "$SERVERDIR/auth.db" &&
57   echo cvsuser:cvGVEarMLnhlA > "$SERVERDIR/auth.db"
58 '
59
60 # note that cvs doesn't accept absolute pathnames
61 # as argument to co -d
62 test_expect_success 'basic checkout' \
63   'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
64    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
65    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"'
66
67 #------------------------
68 # PSERVER AUTHENTICATION
69 #------------------------
70
71 cat >request-anonymous  <<EOF
72 BEGIN AUTH REQUEST
73 $SERVERDIR
74 anonymous
75
76 END AUTH REQUEST
77 EOF
78
79 cat >request-git  <<EOF
80 BEGIN AUTH REQUEST
81 $SERVERDIR
82 git
83
84 END AUTH REQUEST
85 EOF
86
87 cat >login-anonymous <<EOF
88 BEGIN VERIFICATION REQUEST
89 $SERVERDIR
90 anonymous
91
92 END VERIFICATION REQUEST
93 EOF
94
95 cat >login-git <<EOF
96 BEGIN VERIFICATION REQUEST
97 $SERVERDIR
98 git
99
100 END VERIFICATION REQUEST
101 EOF
102
103 cat >login-git-ok <<EOF
104 BEGIN VERIFICATION REQUEST
105 $SERVERDIR
106 cvsuser
107 Ah<Z:yZZ30 e
108 END VERIFICATION REQUEST
109 EOF
110
111 test_expect_success 'pserver authentication' \
112   'cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
113    sed -ne \$p log | grep "^I LOVE YOU\$"'
114
115 test_expect_success 'pserver authentication failure (non-anonymous user)' \
116   'if cat request-git | git-cvsserver pserver >log 2>&1
117    then
118        false
119    else
120        true
121    fi &&
122    sed -ne \$p log | grep "^I HATE YOU\$"'
123
124 test_expect_success 'pserver authentication success (non-anonymous user with password)' \
125   'cat login-git-ok | git-cvsserver pserver >log 2>&1 &&
126    sed -ne \$p log | grep "^I LOVE YOU\$"'
127
128 test_expect_success 'pserver authentication (login)' \
129   'cat login-anonymous | git-cvsserver pserver >log 2>&1 &&
130    sed -ne \$p log | grep "^I LOVE YOU\$"'
131
132 test_expect_success 'pserver authentication failure (login/non-anonymous user)' \
133   'if cat login-git | git-cvsserver pserver >log 2>&1
134    then
135        false
136    else
137        true
138    fi &&
139    sed -ne \$p log | grep "^I HATE YOU\$"'
140
141
142 # misuse pserver authentication for testing of req_Root
143
144 cat >request-relative  <<EOF
145 BEGIN AUTH REQUEST
146 gitcvs.git
147 anonymous
148
149 END AUTH REQUEST
150 EOF
151
152 cat >request-conflict  <<EOF
153 BEGIN AUTH REQUEST
154 $SERVERDIR
155 anonymous
156
157 END AUTH REQUEST
158 Root $WORKDIR
159 EOF
160
161 test_expect_success 'req_Root failure (relative pathname)' \
162   'if cat request-relative | git-cvsserver pserver >log 2>&1
163    then
164        echo unexpected success
165        false
166    else
167        true
168    fi &&
169    tail log | grep "^error 1 Root must be an absolute pathname$"'
170
171 test_expect_success 'req_Root failure (conflicting roots)' \
172   'cat request-conflict | git-cvsserver pserver >log 2>&1 &&
173    tail log | grep "^error 1 Conflicting roots specified$"'
174
175 test_expect_success 'req_Root (strict paths)' \
176   'cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 &&
177    sed -ne \$p log | grep "^I LOVE YOU\$"'
178
179 test_expect_success 'req_Root failure (strict-paths)' '
180     ! cat request-anonymous |
181     git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1
182 '
183
184 test_expect_success 'req_Root (w/o strict-paths)' \
185   'cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 &&
186    sed -ne \$p log | grep "^I LOVE YOU\$"'
187
188 test_expect_success 'req_Root failure (w/o strict-paths)' '
189     ! cat request-anonymous |
190     git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1
191 '
192
193 cat >request-base  <<EOF
194 BEGIN AUTH REQUEST
195 /gitcvs.git
196 anonymous
197
198 END AUTH REQUEST
199 Root /gitcvs.git
200 EOF
201
202 test_expect_success 'req_Root (base-path)' \
203   'cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
204    sed -ne \$p log | grep "^I LOVE YOU\$"'
205
206 test_expect_success 'req_Root failure (base-path)' '
207     ! cat request-anonymous |
208     git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1
209 '
210
211 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false || exit 1
212
213 test_expect_success 'req_Root (export-all)' \
214   'cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
215    sed -ne \$p log | grep "^I LOVE YOU\$"'
216
217 test_expect_success 'req_Root failure (export-all w/o whitelist)' \
218   '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'
219
220 test_expect_success 'req_Root (everything together)' \
221   'cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
222    sed -ne \$p log | grep "^I LOVE YOU\$"'
223
224 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1
225
226 #--------------
227 # CONFIG TESTS
228 #--------------
229
230 test_expect_success 'gitcvs.enabled = false' \
231   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
232    if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
233    then
234      echo unexpected cvs success
235      false
236    else
237      true
238    fi &&
239    grep "GITCVS emulation disabled" cvs.log &&
240    test ! -d cvswork2'
241
242 rm -fr cvswork2
243 test_expect_success 'gitcvs.ext.enabled = true' \
244   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
245    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
246    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
247    test_cmp cvswork cvswork2'
248
249 rm -fr cvswork2
250 test_expect_success 'gitcvs.ext.enabled = false' \
251   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
252    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
253    if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
254    then
255      echo unexpected cvs success
256      false
257    else
258      true
259    fi &&
260    grep "GITCVS emulation disabled" cvs.log &&
261    test ! -d cvswork2'
262
263 rm -fr cvswork2
264 test_expect_success 'gitcvs.dbname' \
265   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
266    GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
267    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
268    test_cmp cvswork cvswork2 &&
269    test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
270    cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"'
271
272 rm -fr cvswork2
273 test_expect_success 'gitcvs.ext.dbname' \
274   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
275    GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
276    GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
277    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
278    test_cmp cvswork cvswork2 &&
279    test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
280    test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
281    cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"'
282
283
284 #------------
285 # CVS UPDATE
286 #------------
287
288 rm -fr "$SERVERDIR"
289 cd "$WORKDIR" &&
290 git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
291 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
292 GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
293 exit 1
294
295 test_expect_success 'cvs update (create new file)' \
296   'echo testfile1 >testfile1 &&
297    git add testfile1 &&
298    git commit -q -m "Add testfile1" &&
299    git push gitcvs.git >/dev/null &&
300    cd cvswork &&
301    GIT_CONFIG="$git_config" cvs -Q update &&
302    test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
303    test_cmp testfile1 ../testfile1'
304
305 cd "$WORKDIR"
306 test_expect_success 'cvs update (update existing file)' \
307   'echo line 2 >>testfile1 &&
308    git add testfile1 &&
309    git commit -q -m "Append to testfile1" &&
310    git push gitcvs.git >/dev/null &&
311    cd cvswork &&
312    GIT_CONFIG="$git_config" cvs -Q update &&
313    test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
314    test_cmp testfile1 ../testfile1'
315
316 cd "$WORKDIR"
317 #TODO: cvsserver doesn't support update w/o -d
318 test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" '
319    mkdir test &&
320    echo >test/empty &&
321    git add test &&
322    git commit -q -m "Single Subdirectory" &&
323    git push gitcvs.git >/dev/null &&
324    cd cvswork &&
325    GIT_CONFIG="$git_config" cvs -Q update &&
326    test ! -d test
327 '
328
329 cd "$WORKDIR"
330 test_expect_success 'cvs update (subdirectories)' \
331   '(for dir in A A/B A/B/C A/D E; do
332       mkdir $dir &&
333       echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")"  &&
334       git add $dir
335    done) &&
336    git commit -q -m "deep sub directory structure" &&
337    git push gitcvs.git >/dev/null &&
338    cd cvswork &&
339    GIT_CONFIG="$git_config" cvs -Q update -d &&
340    (for dir in A A/B A/B/C A/D E; do
341       filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
342       if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
343         test_cmp "$dir/$filename" "../$dir/$filename"; then
344         :
345       else
346         echo >failure
347       fi
348     done) &&
349    test ! -f failure'
350
351 cd "$WORKDIR"
352 test_expect_success 'cvs update (delete file)' \
353   'git rm testfile1 &&
354    git commit -q -m "Remove testfile1" &&
355    git push gitcvs.git >/dev/null &&
356    cd cvswork &&
357    GIT_CONFIG="$git_config" cvs -Q update &&
358    test -z "$(grep testfile1 CVS/Entries)" &&
359    test ! -f testfile1'
360
361 cd "$WORKDIR"
362 test_expect_success 'cvs update (re-add deleted file)' \
363   'echo readded testfile >testfile1 &&
364    git add testfile1 &&
365    git commit -q -m "Re-Add testfile1" &&
366    git push gitcvs.git >/dev/null &&
367    cd cvswork &&
368    GIT_CONFIG="$git_config" cvs -Q update &&
369    test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
370    test_cmp testfile1 ../testfile1'
371
372 cd "$WORKDIR"
373 test_expect_success 'cvs update (merge)' \
374   'echo Line 0 >expected &&
375    for i in 1 2 3 4 5 6 7
376    do
377      echo Line $i >>merge &&
378      echo Line $i >>expected
379    done &&
380    echo Line 8 >>expected &&
381    git add merge &&
382    git commit -q -m "Merge test (pre-merge)" &&
383    git push gitcvs.git >/dev/null &&
384    cd cvswork &&
385    GIT_CONFIG="$git_config" cvs -Q update &&
386    test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
387    test_cmp merge ../merge &&
388    ( echo Line 0 && cat merge ) >merge.tmp &&
389    mv merge.tmp merge &&
390    cd "$WORKDIR" &&
391    echo Line 8 >>merge &&
392    git add merge &&
393    git commit -q -m "Merge test (merge)" &&
394    git push gitcvs.git >/dev/null &&
395    cd cvswork &&
396    sleep 1 && touch merge &&
397    GIT_CONFIG="$git_config" cvs -Q update &&
398    test_cmp merge ../expected'
399
400 cd "$WORKDIR"
401
402 cat >expected.C <<EOF
403 <<<<<<< merge.mine
404 Line 0
405 =======
406 LINE 0
407 >>>>>>> merge.1.3
408 EOF
409
410 for i in 1 2 3 4 5 6 7 8
411 do
412   echo Line $i >>expected.C
413 done
414
415 test_expect_success 'cvs update (conflict merge)' \
416   '( echo LINE 0 && cat merge ) >merge.tmp &&
417    mv merge.tmp merge &&
418    git add merge &&
419    git commit -q -m "Merge test (conflict)" &&
420    git push gitcvs.git >/dev/null &&
421    cd cvswork &&
422    GIT_CONFIG="$git_config" cvs -Q update &&
423    test_cmp merge ../expected.C'
424
425 cd "$WORKDIR"
426 test_expect_success 'cvs update (-C)' \
427   'cd cvswork &&
428    GIT_CONFIG="$git_config" cvs -Q update -C &&
429    test_cmp merge ../merge'
430
431 cd "$WORKDIR"
432 test_expect_success 'cvs update (merge no-op)' \
433    'echo Line 9 >>merge &&
434     cp merge cvswork/merge &&
435     git add merge &&
436     git commit -q -m "Merge test (no-op)" &&
437     git push gitcvs.git >/dev/null &&
438     cd cvswork &&
439     sleep 1 && touch merge &&
440     GIT_CONFIG="$git_config" cvs -Q update &&
441     test_cmp merge ../merge'
442
443 cd "$WORKDIR"
444 test_expect_success 'cvs update (-p)' '
445     touch really-empty &&
446     echo Line 1 > no-lf &&
447     printf "Line 2" >> no-lf &&
448     git add really-empty no-lf &&
449     git commit -q -m "Update -p test" &&
450     git push gitcvs.git >/dev/null &&
451     cd cvswork &&
452     GIT_CONFIG="$git_config" cvs update &&
453     for i in merge no-lf empty really-empty; do
454         GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out &&
455         test_cmp $i.out ../$i || return 1
456     done
457 '
458
459 cd "$WORKDIR"
460 test_expect_success 'cvs update (module list supports packed refs)' '
461     GIT_DIR="$SERVERDIR" git pack-refs --all &&
462     GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
463     grep "cvs update: New directory \`main'\''" < out
464 '
465
466 #------------
467 # CVS STATUS
468 #------------
469
470 cd "$WORKDIR"
471 test_expect_success 'cvs status' '
472     mkdir status.dir &&
473     echo Line > status.dir/status.file &&
474     echo Line > status.file &&
475     git add status.dir status.file &&
476     git commit -q -m "Status test" &&
477     git push gitcvs.git >/dev/null &&
478     cd cvswork &&
479     GIT_CONFIG="$git_config" cvs update &&
480     GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
481     test_line_count = 2 ../out
482 '
483
484 cd "$WORKDIR"
485 test_expect_success 'cvs status (nonrecursive)' '
486     cd cvswork &&
487     GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
488     test_line_count = 1 ../out
489 '
490
491 cd "$WORKDIR"
492 test_expect_success 'cvs status (no subdirs in header)' '
493     cd cvswork &&
494     GIT_CONFIG="$git_config" cvs status | grep ^File: >../out &&
495     ! grep / <../out
496 '
497
498 #------------
499 # CVS CHECKOUT
500 #------------
501
502 cd "$WORKDIR"
503 test_expect_success 'cvs co -c (shows module database)' '
504     GIT_CONFIG="$git_config" cvs co -c > out &&
505     grep "^main[         ][     ]*main$" <out &&
506     ! grep -v "^main[    ][     ]*main$" <out
507 '
508
509 #------------
510 # CVS LOG
511 #------------
512
513 # Known issues with git-cvsserver current log output:
514 #  - Hard coded "lines: +2 -3" placeholder, instead of real numbers.
515 #  - CVS normally does not internally add a blank first line
516 #    or a last line with nothing but a space to log messages.
517 #  - The latest cvs 1.12.x server sends +0000 timezone (with some hidden "MT"
518 #    tagging in the protocol), and if cvs 1.12.x client sees the MT tags,
519 #    it converts to local time zone.  git-cvsserver doesn't do the +0000
520 #    or the MT tags...
521 #  - The latest 1.12.x releases add a "commitid:" field on to the end of the
522 #    "date:" line (after "lines:").  Maybe we could stick git's commit id
523 #    in it?  Or does CVS expect a certain number of bits (too few for
524 #    a full sha1)?
525 #
526 # Given the above, expect the following test to break if git-cvsserver's
527 # log output is improved.  The test is just to ensure it doesn't
528 # accidentally get worse.
529
530 sed -e 's/^x//' -e 's/SP$/ /' > "$WORKDIR/expect" <<EOF
531 x
532 xRCS file: $WORKDIR/gitcvs.git/main/merge,v
533 xWorking file: merge
534 xhead: 1.4
535 xbranch:
536 xlocks: strict
537 xaccess list:
538 xsymbolic names:
539 xkeyword substitution: kv
540 xtotal revisions: 4;    selected revisions: 4
541 xdescription:
542 x----------------------------
543 xrevision 1.4
544 xdate: __DATE__;  author: author;  state: Exp;  lines: +2 -3
545 x
546 xMerge test (no-op)
547 xSP
548 x----------------------------
549 xrevision 1.3
550 xdate: __DATE__;  author: author;  state: Exp;  lines: +2 -3
551 x
552 xMerge test (conflict)
553 xSP
554 x----------------------------
555 xrevision 1.2
556 xdate: __DATE__;  author: author;  state: Exp;  lines: +2 -3
557 x
558 xMerge test (merge)
559 xSP
560 x----------------------------
561 xrevision 1.1
562 xdate: __DATE__;  author: author;  state: Exp;  lines: +2 -3
563 x
564 xMerge test (pre-merge)
565 xSP
566 x=============================================================================
567 EOF
568 expectStat="$?"
569
570 cd "$WORKDIR"
571 test_expect_success 'cvs log' '
572     cd cvswork &&
573     test x"$expectStat" = x"0" &&
574     GIT_CONFIG="$git_config" cvs log merge >../out &&
575     sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
576     test_cmp ../expect ../actual
577 '
578
579 #------------
580 # CVS ANNOTATE
581 #------------
582
583 cd "$WORKDIR"
584 test_expect_success 'cvs annotate' '
585     cd cvswork &&
586     GIT_CONFIG="$git_config" cvs annotate merge >../out &&
587     sed -e "s/ .*//" ../out >../actual &&
588     for i in 3 1 1 1 1 1 1 1 2 4; do echo 1.$i; done >../expect &&
589     test_cmp ../expect ../actual
590 '
591
592 #------------
593 # running via git-shell
594 #------------
595
596 cd "$WORKDIR"
597
598 test_expect_success 'create remote-cvs helper' '
599         write_script remote-cvs <<-\EOF
600         exec git shell -c "cvs server"
601         EOF
602 '
603
604 test_expect_success 'cvs server does not run with vanilla git-shell' '
605         (
606                 cd cvswork &&
607                 CVS_SERVER=$WORKDIR/remote-cvs &&
608                 export CVS_SERVER &&
609                 ! cvs log merge
610         )
611 '
612
613 test_expect_success 'configure git shell to run cvs server' '
614         mkdir "$HOME"/git-shell-commands &&
615
616         write_script "$HOME"/git-shell-commands/cvs <<-\EOF &&
617         if ! test $# = 1 && test "$1" = "server"
618         then
619                 echo >&2 "git-cvsserver only handles \"server\""
620                 exit 1
621         fi
622         exec git cvsserver server
623         EOF
624
625         # Should not be used, but part of the recommended setup
626         write_script "$HOME"/git-shell-commands/no-interactive-login <<-\EOF
627         echo Interactive login forbidden
628         EOF
629 '
630
631 test_expect_success 'cvs server can run with recommended config' '
632         (
633                 cd cvswork &&
634                 CVS_SERVER=$WORKDIR/remote-cvs &&
635                 export CVS_SERVER &&
636                 cvs log merge
637         )
638 '
639
640 test_done