Re: t5539 broken under Mac OS X

4 messages, 4 authors, 2016-06-15 · open the first message on its own page

Re: t5539 broken under Mac OS X

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:30

Torsten Bögershausen [off-list ref] writes:
t5539 doesn't seem to work as expected under Mac OX X 10.6
(10.9 is OK)

I am not root.
Are there any ideas how we can improve the situation, or how to debug ?
As to "how to debug", the first step is to grep for that message and
notice that it comes from here:

t/lib-httpd.sh:

    if ! test_have_prereq SANITY; then
            test_skip_or_die $GIT_TEST_HTTPD \
                    "Cannot run httpd tests as root"
    fi

and then grep for SANITY to find:

t/test-lib.sh:

    # 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

It appears that the check in lib-httpd.sh thinks you lack SANITY; is
the root directory of your system somehow writable by you?


t>
t> ./t5539-fetch-http-shallow.sh ; echo $?

1..0 # SKIP Cannot run httpd tests as root
0
t>
t> GIT_TEST_HTTPD=t ./t5539-fetch-http-shallow.sh ; echo $?
error: Cannot run httpd tests as root
1
t>

Re: t5539 broken under Mac OS X

From: Torsten Bögershausen <hidden>
Date: 2016-06-15 23:03:31

On 2015-01-14 19.37, Junio C Hamano wrote:
Torsten Bögershausen [off-list ref] writes:
quoted
t5539 doesn't seem to work as expected under Mac OX X 10.6
(10.9 is OK)

I am not root.
Are there any ideas how we can improve the situation, or how to debug ?
As to "how to debug", the first step is to grep for that message and
notice that it comes from here:

t/lib-httpd.sh:

    if ! test_have_prereq SANITY; then
            test_skip_or_die $GIT_TEST_HTTPD \
                    "Cannot run httpd tests as root"
    fi

and then grep for SANITY to find:

t/test-lib.sh:

    # 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

It appears that the check in lib-httpd.sh thinks you lack SANITY; is
the root directory of your system somehow writable by you?
Yes, that was a good hint, thanks.
The "problem" is that I am Admin on one machine, but not on the other,
and / was writable for the admin group for some reasons, and only on this machine.



But, why does e.g. t0004 behave more gracefully (and skips) and t5539 just dies ?

./t0004-unwritable.sh 
ok 1 - setup
ok 2 # skip write-tree should notice unwritable repository (missing SANITY of POSIXPERM,SANITY)


(And after changing the group of / t5539 passes, and so does t0004)

Re: t5539 broken under Mac OS X

From: Jeff King <hidden>
Date: 2016-06-15 23:03:34

On Wed, Jan 14, 2015 at 08:50:47PM +0100, Torsten Bögershausen wrote:
But, why does e.g. t0004 behave more gracefully (and skips) and t5539 just dies ?

./t0004-unwritable.sh 
ok 1 - setup
ok 2 # skip write-tree should notice unwritable repository (missing SANITY of POSIXPERM,SANITY)
The http code uses test_skip_or_die when it runs into setup errors. The
intent there is that the user has either:

  1. Told us explicitly that they want http tests by setting
     GIT_TEST_HTTPD=true.

  2. Wants to run http tests if they can by setting GIT_TEST_HTTPD=auto
     (or leaving it unset, as that is the default).

In case (1), we treat this as a test failure. They asked for httpd
tests, and we could not run them. In case (2), we would just skip all of
the tests.

You may want to loosen your GIT_TEST_HTTPD setting (pre-83d842dc, you
had to set it to true to run the tests at all, but nowadays we have
auto).

-Peff

Re: t5539 broken under Mac OS X

From: Kyle J. McKay <hidden>
Date: 2016-06-15 23:03:35

On Jan 14, 2015, at 13:17, Jeff King wrote:
On Wed, Jan 14, 2015 at 08:50:47PM +0100, Torsten Bögershausen wrote:
quoted
But, why does e.g. t0004 behave more gracefully (and skips) and  
t5539 just dies ?

./t0004-unwritable.sh
ok 1 - setup
ok 2 # skip write-tree should notice unwritable repository (missing  
SANITY of POSIXPERM,SANITY)
The http code uses test_skip_or_die when it runs into setup errors.  
The
intent there is that the user has either:

 1. Told us explicitly that they want http tests by setting
    GIT_TEST_HTTPD=true.

 2. Wants to run http tests if they can by setting GIT_TEST_HTTPD=auto
    (or leaving it unset, as that is the default).

In case (1), we treat this as a test failure. They asked for httpd
tests, and we could not run them. In case (2), we would just skip  
all of
the tests.

You may want to loosen your GIT_TEST_HTTPD setting (pre-83d842dc, you
had to set it to true to run the tests at all, but nowadays we have
auto).
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).

I ended up removing group write permission from / (which happened to  
find a bug in another script of mine) and then it was happy.

-Kyle
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help