From a78d9258dc1fdfbecf0a60f21a8bb1594a07c442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 27 Feb 2017 11:26:28 +0000 Subject: cvs tests: skip tests that call "cvs commit" when running as root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- t/t9200-git-cvsexportcommit.sh | 5 +++++ t/t9600-cvsimport.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index bb879a527d..1319415ba8 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -18,6 +18,11 @@ then test_done fi +if ! test_have_prereq NOT_ROOT; then + skip_all='When cvs is compiled with CVS_BADROOT commits as root fail' + test_done +fi + CVSROOT=$PWD/tmpcvsroot CVSWORK=$PWD/cvswork GIT_DIR=$PWD/.git diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index 4c384ff023..804ce3850f 100755 --- a/t/t9600-cvsimport.sh +++ b/t/t9600-cvsimport.sh @@ -3,6 +3,11 @@ test_description='git cvsimport basic tests' . ./lib-cvs.sh +if ! test_have_prereq NOT_ROOT; then + skip_all='When cvs is compiled with CVS_BADROOT commits as root fail' + test_done +fi + test_expect_success PERL 'setup cvsroot environment' ' CVSROOT=$(pwd)/cvsroot && export CVSROOT -- cgit v1.2.3 From 0b69e4fa0af9a1c9fb1f8f7b73697990547af355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Wed, 1 Mar 2017 21:15:39 +0000 Subject: gitweb tests: change confusing "skip_all" phrasing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the phrasing so that instead of saying that the CGI module is unusable, we say that it's not available. This came up on the git mailing list in <4b34e3a0-3da7-d821-2a7f-9a420ac1d3f6@gmail.com> from Jakub Narębski. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- t/gitweb-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh index d5dab5a94f..59ef15efbd 100644 --- a/t/gitweb-lib.sh +++ b/t/gitweb-lib.sh @@ -110,7 +110,7 @@ perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || { } perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || { - skip_all='skipping gitweb tests, CGI module unusable' + skip_all='skipping gitweb tests, CGI & CGI::Util & CGI::Carp modules not available' test_done } -- cgit v1.2.3 From c6507484a2a87e53a5f0c4c01944192047bbeaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Wed, 1 Mar 2017 21:15:40 +0000 Subject: gitweb tests: skip tests when we don't have Time::HiRes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the gitweb tests to skip when we can't load the Time::HiRes module. Gitweb needs this module to work. It has been in perl core since v5.8, which is the oldest version we support. However CentOS (and perhaps some other distributions) carve it into its own non-core-perl package that's not installed along with /usr/bin/perl by default. Without this we'll hard fail the gitweb tests when trying to load the module. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- t/gitweb-lib.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh index 59ef15efbd..006d2a8152 100644 --- a/t/gitweb-lib.sh +++ b/t/gitweb-lib.sh @@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || { test_done } +perl -mTime::HiRes -e 0 >/dev/null 2>&1 || { + skip_all='skipping gitweb tests, Time::HiRes module not available' + test_done +} + gitweb_init -- cgit v1.2.3