{"thread":{"id":"45236","subject":"[PATCH] cvs tests: When root, skip tests that call \"cvs commit\"","startedAt":"2017-02-27T11:27:21Z","lastAt":"2017-02-27T19:44:09Z","messageCount":2,"participants":["Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"312717","messageId":"20170227112628.10410-1-avarab@gmail.com","threadId":"45236","inReplyTo":null,"subject":"[PATCH] cvs tests: When root, skip tests that call \"cvs commit\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-02-27T11:26:28Z","receivedAt":"2017-02-27T11:27:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the tests that fail to when we run the test suite as root, due\nto calling \"cvs commit\".\n\nThe GNU cvs package has an optional compile-time CVS_BADROOT\nflag. When compiled with this flag \"cvs commit\" will refuse to commit\nanything as root. On my Debian box this isn't compiled in[1] in, but\non CentOS it is.\n\nI've run all the t/t*cvs*.sh tests, and these are the only two that\nfail. For some reason e.g. t9402-git-cvsserver-refs.sh still works as\nroot despite doing \"cvs commit\", I haven't dug into why.\n\nThis commit is technically being overzealous, we could do better by\nmaking a mock cvs commit as root and run the tests if that works, but\nI don't see any compelling reason to bend over backwards to run these\ntests in all cases, just skipping them as root seems good enough.\n\n1. Per: strings /usr/bin/cvs|grep 'is not allowed to commit'\n   Using cvs 1.11.23 on CentOS, 1.12.13-MirDebian-18 on Debian.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t9200-git-cvsexportcommit.sh | 5 +++++\n t/t9600-cvsimport.sh           | 5 +++++\n 2 files changed, 10 insertions(+)\n\ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex bb879a527d..1319415ba8 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -18,6 +18,11 @@ then\n     test_done\n fi\n \n+if ! test_have_prereq NOT_ROOT; then\n+\tskip_all='When cvs is compiled with CVS_BADROOT commits as root fail'\n+\ttest_done\n+fi\n+\n CVSROOT=$PWD/tmpcvsroot\n CVSWORK=$PWD/cvswork\n GIT_DIR=$PWD/.git\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 4c384ff023..804ce3850f 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -3,6 +3,11 @@\n test_description='git cvsimport basic tests'\n . ./lib-cvs.sh\n \n+if ! test_have_prereq NOT_ROOT; then\n+\tskip_all='When cvs is compiled with CVS_BADROOT commits as root fail'\n+\ttest_done\n+fi\n+\n test_expect_success PERL 'setup cvsroot environment' '\n \tCVSROOT=$(pwd)/cvsroot &&\n \texport CVSROOT\n-- \n2.11.0\n\n"},{"id":"312763","messageId":"xmqqvarvwhox.fsf@gitster.mtv.corp.google.com","threadId":"45236","inReplyTo":"20170227112628.10410-1-avarab@gmail.com","subject":"Re: [PATCH] cvs tests: When root, skip tests that call \"cvs commit\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-02-27T19:35:10Z","receivedAt":"2017-02-27T19:44:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, makes sense.\n"}]}