Skip to contentSkip to conversation

test-lib.sh: No POSIXPERM for cygwin

RFC In review Torsten Bögershausen 4 participants 6 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

RFC 1/1 test-lib.sh: No POSIXPERM for cygwin

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

---
 t/test-lib.sh | 1 -
 1 file changed, 1 deletion(-)
t/test-lib.sh +0 -1
index 1a6c4ab..94b097e 100644
@@ -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
Signature · 1 line
1.8.1.1
#1 lore raw
Quoted 3 lines · Torsten Bögershausen

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...?

#2 lore raw

Am 2013-02-06 10:34, schrieb Erik Faye-Lund:

Quoted 6 lines · Torsten Bögershausen
Quoted 3 lines

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

#3 lore raw
In reply to Torsten Bögershausen
Quoted 2 lines · Torsten Bögershausen

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]

Quoted 11 lines
---
 t/test-lib.sh | 1 -
 1 file changed, 1 deletion(-)
t/test-lib.sh +0 -0
index 1a6c4ab..94b097e 100644

t/test-lib.sh case $(uname -s) in · line 674

Quoted 7 lines
t/test-lib.sh +0 -1
@@ -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

#4 lore raw
Quoted 5 lines · Ramsay Jones
Quoted 2 lines · Torsten Bögershausen

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.

Quoted 23 lines
Quoted 11 lines
---
 t/test-lib.sh | 1 -
 1 file changed, 1 deletion(-)
t/test-lib.sh +0 -0
index 1a6c4ab..94b097e 100644

t/test-lib.sh case $(uname -s) in · line 674

Quoted 7 lines
t/test-lib.sh +0 -1
@@ -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

#5 lore raw
Quoted 6 lines · Junio C Hamano
Quoted 4 lines · Ramsay Jones
Quoted 2 lines · Torsten Bögershausen

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)

Quoted 9 lines

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