threads / rfc / 32744

[RFC] test-lib.sh: No POSIXPERM for cygwin

Subject: [RFC] test-lib.sh: No POSIXPERM for cygwin

## tl;dr

6 messages between Jan 27, 2013 and Feb 8, 2013.

replies: 5people: 4as markdown or json

Torsten Bögershausen· Jan 27, 2013, 14:57 UTC · lore

t0070 and t1301 fail when running the test suite under cygwin. Skip the failing tests by unsetting POSIXPERM.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 t/test-lib.sh | 1 -
 1 file changed, 1 deletion(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1a6c4ab..94b097e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -669,7 +669,6 @@ case $(uname -s) in
 	test_set_prereq SED_STRIPS_CR
 	;;
 *CYGWIN*)
-	test_set_prereq POSIXPERM
 	test_set_prereq EXECKEEPSPID
 	test_set_prereq NOT_MINGW
 	test_set_prereq SED_STRIPS_CR
-- 
1.8.1.1
Erik Faye-Lund· Feb 6, 2013, 09:34 UTC · re: Torsten Bögershausen · lore

Re: [RFC] test-lib.sh: No POSIXPERM for cygwin

On Sun, Jan 27, 2013 at 3:57 PM, Torsten Bögershausen <tboegi@web.de> wrote:
> t0070 and t1301 fail when running the test suite under cygwin.
> Skip the failing tests by unsetting POSIXPERM.
>
But is this the real reason? I thought Cygwin implemented POSIX permissions...?
Torsten Bögershausen· Feb 6, 2013, 20:16 UTC · re: Erik Faye-Lund · lore

Re: [RFC] test-lib.sh: No POSIXPERM for cygwin

Am 2013-02-06 10:34, schrieb Erik Faye-Lund:
Show 6 quoted lines
> On Sun, Jan 27, 2013 at 3:57 PM, Torsten Bögershausen <tboegi@web.de> wrote:
>> t0070 and t1301 fail when running the test suite under cygwin.
>> Skip the failing tests by unsetting POSIXPERM.
>>
>
> But is this the real reason? I thought Cygwin implemented POSIX permissions...?
t0070:
  'mktemp to unwritable directory prints filename'
   mkdir cannotwrite &&
   chmod -w cannotwrite &&
   test_when_finished "chmod +w cannotwrite" &&
   test_must_fail test-mktemp cannotwrite/testXXXXXX 2>err &&
   grep "cannotwrite/test" err

When a directory under Linux/*nix has no write permission, it is not allowed to create another directory (or file..) here. This is not working under cygwin, a directory/file can be created even if the parent directory has chmod 0. ------------- tb@PC /cygdrive/c/temp $ mkdir ttt

tb@PC /cygdrive/c/temp $ chmod 0 ttt

tb@PC /cygdrive/c/temp $ ls -ld ttt d---------+ 1 tb None 0 Feb 6 20:33 ttt

tb@PC /cygdrive/c/temp $ touch ttt/x

tb@PC /cygdrive/c/temp $ ls -ld ttt d---------+ 1 tb None 0 Feb 6 20:33 ttt

tb@PC /cygdrive/c/temp $ ls -l ttt total 0 -rw-r--r--+ 1 tb None 0 Feb 6 20:33 x -------------------------------------------

If this is POSIX compliant? I'm not an expert here. On the other hand: This test case does not test git, but rather the file system, so we can probaly remove it?

About 1301: Some resereach needs to be done, to find out the connection between umask, cygwin and the mount options.

On my system I have:
$mount
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
/Torsten
Ramsay Jones· Feb 7, 2013, 18:25 UTC · re: Torsten Bögershausen · lore

Re: [RFC] test-lib.sh: No POSIXPERM for cygwin

Torsten Bögershausen wrote:
> t0070 and t1301 fail when running the test suite under cygwin.
> Skip the failing tests by unsetting POSIXPERM.

t1301 does not fail for me. (WIN XP (SP3) on NTFS) [It's so long since I looked, but I'm pretty sure that the failure in t0070 is caused by *git*, not by cygwin not supporting POSIXPERM]

Show 18 quoted lines
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
> ---
>  t/test-lib.sh | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 1a6c4ab..94b097e 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -669,7 +669,6 @@ case $(uname -s) in
>  	test_set_prereq SED_STRIPS_CR
>  	;;
>  *CYGWIN*)
> -	test_set_prereq POSIXPERM
>  	test_set_prereq EXECKEEPSPID
>  	test_set_prereq NOT_MINGW
>  	test_set_prereq SED_STRIPS_CR
> 
So, I'm not in favour of this, FWIW.

ATB, Ramsay Jones

Junio C Hamano· Feb 7, 2013, 19:35 UTC · re: Ramsay Jones · lore

Re: [RFC] test-lib.sh: No POSIXPERM for cygwin

Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 5 quoted lines
> Torsten Bögershausen wrote:
>> t0070 and t1301 fail when running the test suite under cygwin.
>> Skip the failing tests by unsetting POSIXPERM.
>
> t1301 does not fail for me. (WIN XP (SP3) on NTFS)

Others run Cygwin with vfat or some other filesystem, and some of them do not cope will with POSIXPERM, perhaps?

Not having POSIXPERM by default for Cygwin may be a saner default than having one, if we have to pick one.

It may be debatable to have this default as platform attribute, though.

Show 23 quoted lines
>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
>> ---
>>  t/test-lib.sh | 1 -
>>  1 file changed, 1 deletion(-)
>> 
>> diff --git a/t/test-lib.sh b/t/test-lib.sh
>> index 1a6c4ab..94b097e 100644
>> --- a/t/test-lib.sh
>> +++ b/t/test-lib.sh
>> @@ -669,7 +669,6 @@ case $(uname -s) in
>>  	test_set_prereq SED_STRIPS_CR
>>  	;;
>>  *CYGWIN*)
>> -	test_set_prereq POSIXPERM
>>  	test_set_prereq EXECKEEPSPID
>>  	test_set_prereq NOT_MINGW
>>  	test_set_prereq SED_STRIPS_CR
>> 
>
> So, I'm not in favour of this, FWIW.
>
> ATB,
> Ramsay Jones
Torsten Bögershausen· Feb 8, 2013, 06:08 UTC · re: Junio C Hamano · lore

Re: [RFC] test-lib.sh: No POSIXPERM for cygwin

On 07.02.13 20:35, Junio C Hamano wrote:
Show 15 quoted lines
> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
>
>> Torsten Bögershausen wrote:
>>> t0070 and t1301 fail when running the test suite under cygwin.
>>> Skip the failing tests by unsetting POSIXPERM.
>> t1301 does not fail for me. (WIN XP (SP3) on NTFS)
> Others run Cygwin with vfat or some other filesystem, and some of
> them do not cope will with POSIXPERM, perhaps?
>
> Not having POSIXPERM by default for Cygwin may be a saner default
> than having one, if we have to pick one.
>
> It may be debatable to have this default as platform attribute,
> though.
>

Yes, 1301 passes on cygwin 1.5, but not on 1.7. And it breaks on VFAT, for all kind of OS.

Thanks for comments, I'll put more investigations on my todo stack. /Torsten

← back to recent threads