From: Junio C Hamano <gitster@pobox•com>
To: "Kyle J. McKay" <mackyle@gmail•com>
Cc: "Jeff King" <peff@peff•net>,
"Torsten Bögershausen" <tboegi@web•de>,
"Git Mailing List" <git@vger•kernel.org>
Subject: Re: t5539 broken under Mac OS X
Date: Thu, 15 Jan 2015 12:29:39 -0800 [thread overview]
Message-ID: <xmqqwq4n6b4c.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <064010B3-BC58-42F2-B5C0-DAADAA59B87D@gmail.com> (Kyle J. McKay's message of "Wed, 14 Jan 2015 21:48:28 -0800")
"Kyle J. McKay" <mackyle@gmail•com> writes:
> I ran into this problem. It seems like (at least on older Mac OS X)
> that the root directory is created like so:
>
> drwxrwxr-t 39 root admin /
>
> And since the first (and likely only user) on Mac OS X is a member of
> the admin group, the SANITY test fails and complains even though
> you're not running as root (the failure message is misleading).
The design choice Mac OS X makes around filesystems may deserve the
!SANITY label ;-) but we may want to tighten the check for SANITY,
or better yet, rethink the interaction between POSIXPERM and SANITY.
What we want to express with SANITY is:
On this system, if the user who is running the test
does not have write permission to a file, write to such a
file would fail.
So running our tests as a non-root admin user should be labeled as
being sane. We just use a more expedient "if you can write into the
root directory, you must be root, asit is crazy to allow non-root
user to 'mv /etc /foo && mkdir /etc && write /etc/passwd'"
heuristics which is old-school.
This should not be the final patch (I think it should become a lazy
prereq as it does a lot more), but just for testing, how does this
look?
t/test-lib.sh | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index bb1402d..cdafab5 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1033,7 +1033,16 @@ test_lazy_prereq USR_BIN_TIME '
# When the tests are run as root, permission tests will report that
# things are writable when they shouldn't be.
-test -w / || test_set_prereq SANITY
+if test_have_prereq POSIXPERM &&
+ ! test -w / &&
+ >sanitytest &&
+ chmod a= sanitytest &&
+ ! (>sanitytest) 2>/dev/null &&
+ chmod +w sanitytest &&
+ rm -f sanitytest
+then
+ test_set_prereq SANITY
+fi
GIT_UNZIP=${GIT_UNZIP:-unzip}
test_lazy_prereq UNZIP '
next prev parent reply other threads:[~2015-01-15 20:30 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 15:39 t5539 broken under Mac OS X Torsten Bögershausen
2015-01-14 18:37 ` Junio C Hamano
2015-01-14 19:50 ` Torsten Bögershausen
2015-01-14 21:17 ` Jeff King
2015-01-15 5:48 ` Kyle J. McKay
2015-01-15 20:29 ` Junio C Hamano [this message]
2015-01-15 22:27 ` Jeff King
2015-01-15 22:39 ` Junio C Hamano
2015-01-15 23:57 ` Jeff King
2015-01-16 0:04 ` Junio C Hamano
2015-01-16 1:32 ` [PATCH] t/lib-httpd: switch SANITY check for NOT_ROOT Jeff King
2015-01-16 3:27 ` Kyle J. McKay
2015-01-16 3:34 ` Jeff King
2015-01-16 9:16 ` Jeff King
2015-01-16 18:32 ` Junio C Hamano
2015-01-16 19:02 ` Junio C Hamano
2015-01-17 23:35 ` Torsten Bögershausen
2015-01-21 22:33 ` Junio C Hamano
2015-01-22 21:51 ` Torsten Bögershausen
2015-01-22 22:07 ` Junio C Hamano
2015-01-23 6:00 ` Torsten Bögershausen
2015-02-12 22:36 ` Junio C Hamano
2015-02-14 8:36 ` [msysGit] " Torsten Bögershausen
2015-02-15 23:48 ` Junio C Hamano
2015-01-23 21:24 ` [msysGit] " Torsten Bögershausen
2015-01-23 23:02 ` Junio C Hamano
2015-01-24 9:41 ` [msysGit] " Johannes Schindelin
2015-01-16 18:38 ` Kyle J. McKay
2015-01-16 18:38 ` Kyle J. McKay
2015-01-16 20:04 ` Achim Gratz
2015-01-27 1:44 ` t5539 broken under Mac OS X Erik Faye-Lund
2015-01-27 2:51 ` Junio C Hamano
2015-01-27 16:35 ` Erik Faye-Lund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwq4n6b4c.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=mackyle@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
--cc=tboegi@web$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox