Skip to content

Commit a78d925

Browse files
avargitster
authored andcommitted
cvs tests: skip tests that call "cvs commit" when running as root
Change the tests that fail to when we run the test suite as root, due to calling "cvs commit". The GNU cvs package has an optional compile-time CVS_BADROOT flag. When compiled with this flag "cvs commit" will refuse to commit anything as root. On my Debian box this isn't compiled in[1] in, but on CentOS it is. I've run all the t/t*cvs*.sh tests, and these are the only two that fail. For some reason e.g. t9402-git-cvsserver-refs.sh still works as root despite doing "cvs commit", I haven't dug into why. This commit is technically being overzealous, we could do better by making a mock cvs commit as root and run the tests if that works, but I don't see any compelling reason to bend over backwards to run these tests in all cases, just skipping them as root seems good enough. 1. Per: strings /usr/bin/cvs|grep 'is not allowed to commit' Using cvs 1.11.23 on CentOS, 1.12.13-MirDebian-18 on Debian. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b9e3c2 commit a78d925

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

t/t9200-git-cvsexportcommit.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ then
1818
test_done
1919
fi
2020

21+
if ! test_have_prereq NOT_ROOT; then
22+
skip_all='When cvs is compiled with CVS_BADROOT commits as root fail'
23+
test_done
24+
fi
25+
2126
CVSROOT=$PWD/tmpcvsroot
2227
CVSWORK=$PWD/cvswork
2328
GIT_DIR=$PWD/.git

t/t9600-cvsimport.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
test_description='git cvsimport basic tests'
44
. ./lib-cvs.sh
55

6+
if ! test_have_prereq NOT_ROOT; then
7+
skip_all='When cvs is compiled with CVS_BADROOT commits as root fail'
8+
test_done
9+
fi
10+
611
test_expect_success PERL 'setup cvsroot environment' '
712
CVSROOT=$(pwd)/cvsroot &&
813
export CVSROOT

0 commit comments

Comments
 (0)