{"thread":{"id":"3708","subject":"[BUG] make test (t3600-rm.sh) fails","startedAt":"2006-03-24T10:14:25Z","lastAt":"2006-03-24T13:51:02Z","messageCount":6,"participants":["Panagiotis Issaris","Junio C Hamano","Takis","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"17856","messageId":"4423C681.3000302@issaris.org","threadId":"3708","inReplyTo":null,"subject":"[BUG] make test (t3600-rm.sh) fails","fromName":"Panagiotis Issaris","fromEmail":"takis@issaris.org","sentAt":"2006-03-24T10:14:25Z","receivedAt":"2006-03-24T10:14:25Z","isPatch":false,"sender":{"key":"takis@issaris.org","avatar":"https://gravatar.com/avatar/3075e01ed561c6d890ff95515ba9489b6e694bb751786087d044eab9bea32607?d=mp&s=160"},"body":"Hi,\n\nJust a small report that \"make test\" fails on my system on the current \ngit git tree:\n\n...\n* passed all 3 test(s)\n*** t3600-rm.sh ***\nCommitting initial tree e5c556e46aae6124ff4a2a466c95004e92d9a2e4\n*   ok 1: Pre-check that foo exists and is in index before git-rm foo\n*   ok 2: Test that git-rm foo succeeds\n*   ok 3: Post-check that foo exists but is not in index after git-rm foo\n*   ok 4: Pre-check that bar exists and is in index before \"git-rm -f bar\"\n*   ok 5: Test that \"git-rm -f bar\" succeeds\n*   ok 6: Post-check that bar does not exist and is not in index after \n\"git-rm -f bar\"\n*   ok 7: Test that \"git-rm -- -q\" succeeds (remove a file that looks \nlike an option)\n*   ok 8: Test that \"git-rm -f\" succeeds with embedded space, tab, or \nnewline characters.\n* FAIL 9: Test that \"git-rm -f\" fails if its rm fails\n        git-rm -f baz\n*   ok 10: When the rm in \"git-rm -f\" fails, it should not remove the \nfile from the index\n* failed 1 among 10 test(s)\nmake[2]: *** [t3600-rm.sh] Error 1\nmake[2]: Leaving directory `/usr/local/src/git/t'\nmake[1]: *** [test] Error 2\nmake[1]: Leaving directory `/usr/local/src/git'\nmake: *** [build-arch-stamp] Error 2\n\n\nMy system:\nUbuntu 5.10 aka Breezy\nLinux issaris 2.6.15.060103 #1 Tue Jan 3 14:27:55 CET 2006 i686 GNU/Linux\nmodel name      : Intel(R) Pentium(R) 4 CPU 3.20GHz\n\nWith friendly regards,\nTakis\n"},{"id":"17858","messageId":"7v7j6k16g2.fsf@assigned-by-dhcp.cox.net","threadId":"3708","inReplyTo":"4423C681.3000302@issaris.org","subject":"Re: [BUG] make test (t3600-rm.sh) fails","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-24T10:29:49Z","receivedAt":"2006-03-24T10:29:49Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Panagiotis Issaris <takis@issaris.org> writes:\n\n> * FAIL 9: Test that \"git-rm -f\" fails if its rm fails\n>        git-rm -f baz\n>...\n> My system:\n> Ubuntu 5.10 aka Breezy\n> Linux issaris 2.6.15.060103 #1 Tue Jan 3 14:27:55 CET 2006 i686 GNU/Linux\n\nI wonder what your system shows if you run:\n\n\t$ cd t && sh -x t3600-rm.sh -i -v\n\nThe test #9 makes the test directory unwritable before trying to\nunlink a file there, and git-rm runs rm without -f which should\nmake it fail.  So either your \"chmod u-w .\" is broken, you are\nrunning it as root and defeating \"chmod u-w .\", or you have a\nbroken rm that does not report failure with its exit status.\n\nThe relevant part on my machine looks like this:\n\n$ cd t\n$ sh -x t3600-rm.sh -i -v\n...\n*   ok 8: Test that \"git-rm -f\" succeeds with embedded space, tab, or newline characters.\n+ test y = y\n+ chmod u-w .\n+ test_expect_failure 'Test that \"git-rm -f\" fails if its rm fails' 'git-rm -f baz'\n+ test 2 = 2\n+ say 'expecting failure: git-rm -f baz'\n+ echo '* expecting failure: git-rm -f baz'\n* expecting failure: git-rm -f baz\n+ test_run_ 'git-rm -f baz'\n+ eval 'git-rm -f baz'\n++ git-rm -f baz\nrm: cannot remove `baz': Permission denied\n+ eval_ret=123\n+ return 0\n+ '[' 0 = 0 -a 123 '!=' 0 ']'\n+ test_ok_ 'Test that \"git-rm -f\" fails if its rm fails'\n++ expr 8 + 1\n+ test_count=9\n+ say '  ok 9: Test that \"git-rm -f\" fails if its rm fails'\n+ echo '*   ok 9: Test that \"git-rm -f\" fails if its rm fails'\n*   ok 9: Test that \"git-rm -f\" fails if its rm fails\n...\n"},{"id":"17859","messageId":"df33fe7c0603240245o516095b5m@mail.gmail.com","threadId":"3708","inReplyTo":"7v7j6k16g2.fsf@assigned-by-dhcp.cox.net","subject":"Re: [BUG] make test (t3600-rm.sh) fails","fromName":"Takis","fromEmail":"panagiotis.issaris@gmail.com","sentAt":"2006-03-24T10:45:39Z","receivedAt":"2006-03-24T10:45:39Z","isPatch":false,"sender":{"key":"panagiotis.issaris@gmail.com","avatar":null},"body":"Hi,\n\n2006/3/24, Junio C Hamano <junkio@cox.net>:\n> Panagiotis Issaris <takis@issaris.org> writes:\n>\n> > * FAIL 9: Test that \"git-rm -f\" fails if its rm fails\n> >        git-rm -f baz\n> >...\n> > My system:\n> > Ubuntu 5.10 aka Breezy\n> > Linux issaris 2.6.15.060103 #1 Tue Jan 3 14:27:55 CET 2006 i686 GNU/Linux\n>\n> I wonder what your system shows if you run:\n>\n>         $ cd t && sh -x t3600-rm.sh -i -v\n\nHere's the output:\n\ntakis@issaris:/usr/local/src/git$ cd t && sh -x t3600-rm.sh -i -v\n...\n*   ok 8: Test that \"git-rm -f\" succeeds with embedded space, tab, or\nnewline characters.\n+ test y = y\n+ chmod u-w .\n+ test_expect_failure 'Test that \"git-rm -f\" fails if its rm fails'\n'git-rm -f baz'\n+ test 2 = 2\n+ say 'expecting failure: git-rm -f baz'\n+ echo '* expecting failure: git-rm -f baz'\n* expecting failure: git-rm -f baz\n+ test_run_ 'git-rm -f baz'\n+ eval 'git-rm -f baz'\n++ git-rm -f baz\nrm: cannot remove `baz': Permission denied\n+ eval_ret=0\n+ return 0\n+ '[' 0 = 0 -a 0 '!=' 0 ']'\n+ test_failure_ 'Test that \"git-rm -f\" fails if its rm fails' 'git-rm -f baz'\n++ expr 8 + 1\n+ test_count=9\n++ expr 0 + 1\n+ test_failure=1\n+ say 'FAIL 9: Test that \"git-rm -f\" fails if its rm fails'\n+ echo '* FAIL 9: Test that \"git-rm -f\" fails if its rm fails'\n* FAIL 9: Test that \"git-rm -f\" fails if its rm fails\n+ shift\n+ echo 'git-rm -f baz'\n+ sed -e 's/^/  /'\n        git-rm -f baz\n+ test t = ''\n+ trap - exit\n+ exit 1\n\n> The test #9 makes the test directory unwritable before trying to\n> unlink a file there, and git-rm runs rm without -f which should\n> make it fail.  So either your \"chmod u-w .\" is broken, you are\n> running it as root and defeating \"chmod u-w .\", or you have a\n> broken rm that does not report failure with its exit status.\nI am running it as fakeroot, as part of the \"dpkg-buildpackage\n-rfakeroot -uc -us -b\"\ncommand for building Debian packages. Would this be the problem (the fakeroot)?\n\nWith friendly regards,\nTakis\n"},{"id":"17862","messageId":"7vy7z0yuav.fsf@assigned-by-dhcp.cox.net","threadId":"3708","inReplyTo":"df33fe7c0603240245o516095b5m@mail.gmail.com","subject":"Re: [BUG] make test (t3600-rm.sh) fails","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-24T11:08:08Z","receivedAt":"2006-03-24T11:08:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Takis <panagiotis.issaris@gmail.com> writes:\n\n> I am running it as fakeroot, as part of the \"dpkg-buildpackage\n> -rfakeroot -uc -us -b\"\n> command for building Debian packages. Would this be the problem (the fakeroot)?\n\nThat is what is causing this, yes.\n\n\t$ mkdir /var/tmp/junk && cd /var/tmp/junk\n        $ chmod u+w .\n\t$ fakeroot sh -c 'date >foo; chmod u-w .; rm foo; ls -l foo'\n        $ chmod u+w .\n\t$ sh -c 'date >foo; chmod u-w .; rm foo; ls -l foo'\n\nThe one under fakeroot happily ignores the directory being\nunwritable because it mimics to be root.\n\nBut that does not mean fakeroot is buggy.  Fakeroot is doing\nwhat it is designed to do.\n\nThat does not mean running our tests under fakeroot is stupidity\non your part.  We do not advertise that the tests should not be\nrun as root.\n\nThe test is buggy -- it tries to make sure the command fails\nwhen underlying rm fails, but is not aware that \"chmod u-w .\"\nis not a good way to make ./foo undeletable if you run it as\nroot.  At least it should skip those two tests if it is run by\nroot.\n"},{"id":"17866","messageId":"4423E06E.9090004@issaris.org","threadId":"3708","inReplyTo":"7vy7z0yuav.fsf@assigned-by-dhcp.cox.net","subject":"Re: [BUG] make test (t3600-rm.sh) fails","fromName":"Panagiotis Issaris","fromEmail":"takis@issaris.org","sentAt":"2006-03-24T12:05:02Z","receivedAt":"2006-03-24T12:05:02Z","isPatch":false,"sender":{"key":"takis@issaris.org","avatar":"https://gravatar.com/avatar/3075e01ed561c6d890ff95515ba9489b6e694bb751786087d044eab9bea32607?d=mp&s=160"},"body":"Hi,\n\nJunio C Hamano wrote:\n\n>...\n>But that does not mean fakeroot is buggy.  Fakeroot is doing\n>what it is designed to do.\n>\n>That does not mean running our tests under fakeroot is stupidity\n>on your part.  We do not advertise that the tests should not be\n>run as root.\n>\n>The test is buggy -- it tries to make sure the command fails\n>when underlying rm fails, but is not aware that \"chmod u-w .\"\n>is not a good way to make ./foo undeletable if you run it as\n>root.  At least it should skip those two tests if it is run by\n>root.\n>  \n>\nSomething like this?\n\n\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex d1947e1..52a1e99 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -56,6 +56,7 @@ test \"$test_tabs\" = y && test_expect_suc\n     \"git-rm -f 'space embedded' 'tab   embedded' 'newline\n embedded'\"\n\n+if test `whoami` != \"root\"; then\n if test \"$test_tabs\" = y; then\n chmod u-w .\n test_expect_failure \\\n@@ -63,6 +64,7 @@ test_expect_failure \\\n     'git-rm -f baz'\n chmod u+w .\n fi\n+fi\n\n test_expect_success \\\n     'When the rm in \"git-rm -f\" fails, it should not remove the file from the index' \\\n"},{"id":"17870","messageId":"20060324135102.GX18185@pasky.or.cz","threadId":"3708","inReplyTo":"4423E06E.9090004@issaris.org","subject":"Re: [BUG] make test (t3600-rm.sh) fails","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-03-24T13:51:02Z","receivedAt":"2006-03-24T13:51:02Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Mar 24, 2006 at 01:05:02PM CET, I got a letter\nwhere Panagiotis Issaris <takis@issaris.org> said that...\n> diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\n> index d1947e1..52a1e99 100755\n> --- a/t/t3600-rm.sh\n> +++ b/t/t3600-rm.sh\n> @@ -56,6 +56,7 @@ test \"$test_tabs\" = y && test_expect_suc\n>     \"git-rm -f 'space embedded' 'tab   embedded' 'newline\n> embedded'\"\n> \n> +if test `whoami` != \"root\"; then\n\nRoot is not the only condition when this will not fail, it can happen\non broken filesystems as well, specifically AFS. (Avoid avoid avoid that\nhorrid thing!)\n\nSo, perhaps rather\n\n> if test \"$test_tabs\" = y; then\n> chmod u-w .\n+ touch xyzzy || \\\n> test_expect_failure \\\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nRight now I am having amnesia and deja-vu at the same time.  I think\nI have forgotten this before.\n"}]}