bug#16532: Test Fail: tests/chown/separator

2014-01-24 Thread Pádraig Brady
On 01/24/2014 07:43 AM, Bernhard Voelker wrote:
 On 01/24/2014 04:09 AM, Pádraig Brady wrote:
 On 01/24/2014 02:46 AM, Assaf Gordon wrote:
 $ getent group | grep ^users
 users:x:100:
 users:x:1000:www-data,XXX,YYY
 ===

 Oh right, grep ^$id_gn: it is so.

 Note we can't rely on getent(1) being available (as noted in bug 9987),
 but the failure in that edge case is still a skip as the count will be 0 
 then.
 
 I'm still not convinced that we should mask this misconfiguration
 by skipping the test.
 
 AFAIK it's totally valid to have several names for a gid,
 but is it permitted the other way round?
 
 I'd bet you run into other trouble on such a system, too.
 Therefore, I see the failing test more as a heads-up to
 fix the configuration.
 
 Thanks  have a nice day,
 Berny
 

Since it's an easy enough workaround it's worth adding IMHO.
As a general point there should never be any questions
about test failures. I've seen some test suites become
less than useful through attrition of little issues.
For me the tests take more time than the code and are more
awkward to write, but that's all fine and good as that's
were the real value is.

thanks,
Pádraig.





bug#16532: Test Fail: tests/chown/separator

2014-01-24 Thread Bernhard Voelker
On 01/24/2014 01:19 PM, Pádraig Brady wrote:
 On 01/24/2014 07:43 AM, Bernhard Voelker wrote:
 On 01/24/2014 04:09 AM, Pádraig Brady wrote:
 Oh right, grep ^$id_gn: it is so.

 Note we can't rely on getent(1) being available (as noted in bug 9987),
 but the failure in that edge case is still a skip as the count will be 0 
 then.

 I'm still not convinced that we should mask this misconfiguration
 by skipping the test.

 AFAIK it's totally valid to have several names for a gid,
 but is it permitted the other way round?

 I'd bet you run into other trouble on such a system, too.
 Therefore, I see the failing test more as a heads-up to
 fix the configuration.

 Thanks  have a nice day,
 Berny

 
 Since it's an easy enough workaround it's worth adding IMHO.
 As a general point there should never be any questions
 about test failures. I've seen some test suites become
 less than useful through attrition of little issues.
 For me the tests take more time than the code and are more
 awkward to write, but that's all fine and good as that's
 were the real value is.

Okay, let's go with it then. Thanks.

BTW: I'd change the skip_ message to reflect the above mentioned
corner case where getent is not available, something like:

-  skip_ multiple IDs for group '$id_gn': $(getent group $id_gn)
+  skip_ group '$id_gn' not biunique: $(getent group | grep ^$id_gn:)

Have a nice day,
Berny





bug#16532: Test Fail: tests/chown/separator

2014-01-24 Thread Assaf Gordon

On 01/24/2014 07:46 AM, Bernhard Voelker wrote:

On 01/24/2014 04:09 AM, Pádraig Brady wrote:

Oh right, grep ^$id_gn: it is so.


BTW: I'd change the skip_ message to reflect the above mentioned
corner case where getent is not available, something like:

-  skip_ multiple IDs for group '$id_gn': $(getent group $id_gn)
+  skip_ group '$id_gn' not biunique: $(getent group | grep ^$id_gn:)



Attached is an updated version, using grep and the suggested error message.
On addition is a tr '\n' ',' - because skip only shows the first 
line of the message, and so multiple groups and not displayed.


-gordon

From 5fc10774383928b2fbfde33de3efb314166fe475 Mon Sep 17 00:00:00 2001
From: Assaf Gordon assafgor...@gmail.com
Date: Thu, 23 Jan 2014 20:34:52 -0500
Subject: [PATCH] tests: skip chown/separator with conflicting group IDs

* tests/chown/separator.sh: skip test if the user's group has
multiple entries.
Fixes http://bugs.gnu.org/16532
---
 tests/chown/separator.sh | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tests/chown/separator.sh b/tests/chown/separator.sh
index f64b738..f5ecb5b 100755
--- a/tests/chown/separator.sh
+++ b/tests/chown/separator.sh
@@ -31,6 +31,12 @@ test -n $id_g || framework_failure_
 id_gn=$(id -gn) || framework_failure_
 test -n $id_gn || framework_failure_
 
+# Systems with both local and external groups with conflicting IDs,
+# were seen to fail this test erroneously with EPERM errors.
+test $(getent group | grep ^$id_gn: | wc -l) = 1 ||
+  skip_ group '$id_gn' not biunique:  \
+$(getent group | grep ^$id_gn: | tr '\n' ',')
+
 # FreeBSD 6.x's getgrnam fails to look up a group name containing
 # a space. On such a system, skip this test if the group name contains
 # a byte not in the portable filename character set.
-- 
1.8.4.3



bug#16532: Test Fail: tests/chown/separator

2014-01-24 Thread Pádraig Brady
On 01/24/2014 04:58 PM, Assaf Gordon wrote:
 On 01/24/2014 07:46 AM, Bernhard Voelker wrote:
 On 01/24/2014 04:09 AM, Pádraig Brady wrote:
 Oh right, grep ^$id_gn: it is so.

 BTW: I'd change the skip_ message to reflect the above mentioned
 corner case where getent is not available, something like:

 -  skip_ multiple IDs for group '$id_gn': $(getent group $id_gn)
 +  skip_ group '$id_gn' not biunique: $(getent group | grep ^$id_gn:)

 
 Attached is an updated version, using grep and the suggested error message.
 On addition is a tr '\n' ',' - because skip only shows the first line of 
 the message, and so multiple groups and not displayed.

If you remove the  from $() the '\n' would be changed to spaces
Your changing to ',' is neater though.
Note to avoid a trailing ',' one can use ... | paste -s -d,

Anyway pushed.

thanks!
Pádraig.






bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Assaf Gordon

Hello,

Testing the latest coreutils (v8.22.16-be97f) on an old Ubuntu server, 
results in a test failure tests/chown/separator (log + strace below).


System is:

$ uname -a
Linux club 2.6.32-24-server #43-Ubuntu SMP Thu Sep 16 16:05:42 UTC 2010 
x86_64 GNU/Linux


$ cat /etc/issue
Ubuntu 10.04.4 LTS \n \l

## Failed on the following file-system
$ stat -f /data/gordon/projects/coreutils/
  File: /data/gordon/projects/coreutils/
ID: 830 Namelen: 255 Type: xfs
Block size: 4096   Fundamental block size: 4096
Blocks: Total: 1952592384 Free: 86807222   Available: 86807222
Inodes: Total: 1429327392 Free: 1388915606


strace (same command which failed in the log below):
=
$ pwd
/data/gordon/projects/coreutils/
$ mkdir foo
$ cd foo
$ strace ../src/chown 34574:users . 21 | grep -A 5 -B 5 chown
--
mmap(NULL, 895, PROT_READ, MAP_SHARED, 3, 0) = 0x7fb7ce753000
lseek(3, 895, SEEK_SET) = 895
munmap(0x7fb7ce753000, 895) = 0
close(3)= 0
newfstatat(AT_FDCWD, ., {st_mode=S_IFDIR|0755, st_size=6, ...}, 
AT_SYMLINK_NOFOLLOW) = 0

fchownat(AT_FDCWD, ., 34574, 100, 0)  = -1 EPERM (Operation not permitted)
open(/usr/local/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo, 
O_RDONLY) = -1 ENOENT (No such file or directory)
open(/usr/local/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo, 
O_RDONLY) = -1 ENOENT (No such file or directory)
open(/usr/local/share/locale/en_US/LC_MESSAGES/coreutils.mo, O_RDONLY) 
= -1 ENOENT (No such file or directory)
open(/usr/local/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo, 
O_RDONLY) = -1 ENOENT (No such file or directory)
open(/usr/local/share/locale/en.utf8/LC_MESSAGES/coreutils.mo, 
O_RDONLY) = -1 ENOENT (No such file or directory)

--
=


FAIL: tests/chown/separator
===

++ initial_cwd_=/data/gordon/projects/coreutils
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /data/gordon/projects/coreutils gt-separator.sh.
+++ case $# in
+++ destdir_=/data/gordon/projects/coreutils
+++ template_=gt-separator.sh.
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
 unset TMPDIR
+++ d=/data/gordon/projects/coreutils/gt-separator.sh.fh9P
+++ case $d in
+++ test -d /data/gordon/projects/coreutils/gt-separator.sh.fh9P
 ls -dgo /data/gordon/projects/coreutils/gt-separator.sh.fh9P
 tr S -
+++ perms='drwx-- 2 6 Jan 23 13:22 
/data/gordon/projects/coreutils/gt-separator.sh.fh9P'

+++ case $perms in
+++ test 0 = 0
+++ echo /data/gordon/projects/coreutils/gt-separator.sh.fh9P
+++ return
++ test_dir_=/data/gordon/projects/coreutils/gt-separator.sh.fh9P
++ cd /data/gordon/projects/coreutils/gt-separator.sh.fh9P
++ gl_init_sh_nl_='
'
++ IFS='
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/data/gordon/projects/coreutils/./src
+ case $abs_path_dir_ in
+ 
PATH=/data/gordon/projects/coreutils/./src:/data/gordon/projects/coreutils/src:/data/gordon/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

+ create_exe_shims_ /data/gordon/projects/coreutils/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ chown
+ test yes = yes
+ local i
+ for i in '$*'
+ env chown --version
chown (GNU coreutils) 8.22.16-be97f
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
http://gnu.org/licenses/gpl.html.

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie and Jim Meyering.
++ id -u
+ id_u=34574
+ test -n 34574
++ id -un
+ id_un=agordon
+ test -n agordon
++ id -g
+ id_g=1000
+ test -n 1000
++ id -gn
+ id_gn=users
+ test -n users
+ case $host_triplet in
+ chown '' .
+ for u in '$id_u' '$id_un' ''\'''\'''
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574:1000 .
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574.1000 .
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574:users .
chown: changing ownership of '.': Operation not permitted
+ fail=1
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574.users .
chown: changing ownership of '.': Operation not permitted
+ fail=1
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in 

bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Bernhard Voelker
tag 16532 + moreinfo
thanks

On 01/23/2014 07:41 PM, Assaf Gordon wrote:
 Hello,

welcome back!

 Testing the latest coreutils (v8.22.16-be97f) on an old Ubuntu server, 
 results in a test failure tests/chown/separator (log + strace below).

 $ strace ../src/chown 34574:users . 21 | grep -A 5 -B 5 chown

 fchownat(AT_FDCWD, ., 34574, 100, 0)  = -1 EPERM (Operation not permitted)

 ++ id -g
 + id_g=1000

 + chown 34574:users .
 chown: changing ownership of '.': Operation not permitted
 + fail=1

Ooops, something very strange is going on on your system:
chown resolves the group 'users' to gid 100 while 'id -g'
says 1000.

Can you find out why?
Are you using some strange Samba/Kerberos authentication against
an Active Directory or similar? (I've seen such issues with that
combination,)

Have a nice day,
Berny





bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Assaf Gordon

On 01/23/2014 06:20 PM, Bernhard Voelker wrote:

On 01/23/2014 07:41 PM, Assaf Gordon wrote:

$ strace ../src/chown 34574:users . 21 | grep -A 5 -B 5 chown



fchownat(AT_FDCWD, ., 34574, 100, 0)  = -1 EPERM (Operation not permitted)



++ id -g
+ id_g=1000



+ chown 34574:users .
chown: changing ownership of '.': Operation not permitted
+ fail=1


Ooops, something very strange is going on on your system:
chown resolves the group 'users' to gid 100 while 'id -g'
says 1000.

Can you find out why?
Are you using some strange Samba/Kerberos authentication against
an Active Directory or similar? (I've seen such issues with that
combination,)



Thanks for the quick reply - this is a strange old server (not my doing...).
Indeed it uses an external authentication, and has conflicting local and 
global groups named users.


==
$ grep users /etc/group
users:x:100:
$ getent group | grep ^users
users:x:100:
users:x:1000:
$ id -G
1000 1001 3432
==

So I guess this is not a bug, and can be closed.
I'll just ignore this failure on this system.

Thanks,
-gordon







bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Pádraig Brady
On 01/23/2014 11:41 PM, Assaf Gordon wrote:
 On 01/23/2014 06:20 PM, Bernhard Voelker wrote:
 On 01/23/2014 07:41 PM, Assaf Gordon wrote:
 $ strace ../src/chown 34574:users . 21 | grep -A 5 -B 5 chown

 fchownat(AT_FDCWD, ., 34574, 100, 0)  = -1 EPERM (Operation not permitted)

 ++ id -g
 + id_g=1000

 + chown 34574:users .
 chown: changing ownership of '.': Operation not permitted
 + fail=1

 Ooops, something very strange is going on on your system:
 chown resolves the group 'users' to gid 100 while 'id -g'
 says 1000.

 Can you find out why?
 Are you using some strange Samba/Kerberos authentication against
 an Active Directory or similar? (I've seen such issues with that
 combination,)

 
 Thanks for the quick reply - this is a strange old server (not my doing...).
 Indeed it uses an external authentication, and has conflicting local and 
 global groups named users.
 
 ==
 $ grep users /etc/group
 users:x:100:
 $ getent group | grep ^users
 users:x:100:
 users:x:1000:
 $ id -G
 1000 1001 3432
 ==
 
 So I guess this is not a bug, and can be closed.
 I'll just ignore this failure on this system.

It is a false failure though so would be worth avoiding.
It's important to have robust tests we and builders can rely on.

Would something along the following be possible?

test $(getent group $group | wc -l) != 1 || skip_ multiple ids for group 
$group: $(getent group $group)

welcome back!
Pádraig.





bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Assaf Gordon
This patch makes the test skip on my server (did not test it on other 
systems).


On 01/23/2014 08:09 PM, Pádraig Brady wrote:

On 01/23/2014 11:41 PM, Assaf Gordon wrote:



So I guess this is not a bug, and can be closed.
I'll just ignore this failure on this system.


It is a false failure though so would be worth avoiding.
It's important to have robust tests we and builders can rely on.

Would something along the following be possible?

test $(getent group $group | wc -l) != 1 || skip_ multiple ids for group $group: 
$(getent group $group)




From 3737105eacbb23cbe453a3d210359fea614b7154 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= p...@draigbrady.com
Date: Thu, 23 Jan 2014 20:34:52 -0500
Subject: [PATCH] tests: skip chown/separator with duplicated groups

* tests/chwon/separator.sh: skip test if the user's group has
multiple entries.
Fixes http://bugs.gnu.org/16532
---
 tests/chown/separator.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/chown/separator.sh b/tests/chown/separator.sh
index f64b738..ec33f4a 100755
--- a/tests/chown/separator.sh
+++ b/tests/chown/separator.sh
@@ -31,6 +31,9 @@ test -n $id_g || framework_failure_
 id_gn=$(id -gn) || framework_failure_
 test -n $id_gn || framework_failure_

+test $(getent group $id_gn | wc -l) != 1 ||
+  skip_ multiple ids for group $id_gn: $(getent group $id_gn)
+
 # FreeBSD 6.x's getgrnam fails to look up a group name containing
 # a space. On such a system, skip this test if the group name contains
 # a byte not in the portable filename character set.
--
1.8.4.3







bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Pádraig Brady
On 01/24/2014 01:38 AM, Assaf Gordon wrote:
 This patch makes the test skip on my server (did not test it on other 
 systems).
 
 On 01/23/2014 08:09 PM, Pádraig Brady wrote:
 On 01/23/2014 11:41 PM, Assaf Gordon wrote:
 
 So I guess this is not a bug, and can be closed.
 I'll just ignore this failure on this system.

 It is a false failure though so would be worth avoiding.
 It's important to have robust tests we and builders can rely on.

 Would something along the following be possible?

 test $(getent group $group | wc -l) != 1 || skip_ multiple ids for group 
 $group: $(getent group $group)

 
 
 From 3737105eacbb23cbe453a3d210359fea614b7154 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= p...@draigbrady.com
 Date: Thu, 23 Jan 2014 20:34:52 -0500
 Subject: [PATCH] tests: skip chown/separator with duplicated groups
 
 * tests/chwon/separator.sh: skip test if the user's group has

s/chwon/chown/

 multiple entries.
 Fixes http://bugs.gnu.org/16532
 ---
  tests/chown/separator.sh | 3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/tests/chown/separator.sh b/tests/chown/separator.sh
 index f64b738..ec33f4a 100755
 --- a/tests/chown/separator.sh
 +++ b/tests/chown/separator.sh
 @@ -31,6 +31,9 @@ test -n $id_g || framework_failure_
  id_gn=$(id -gn) || framework_failure_
  test -n $id_gn || framework_failure_
 
 +test $(getent group $id_gn | wc -l) != 1 ||
 +  skip_ multiple ids for group $id_gn: $(getent group $id_gn)
 +
  # FreeBSD 6.x's getgrnam fails to look up a group name containing
  # a space. On such a system, skip this test if the group name contains
  # a byte not in the portable filename character set.

Cool I'll push that in your name since you
did the hard work of tracking it down,
generating the patch and testing.

Marking this as done.

cheers,
Pádraig.





bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Pádraig Brady
On 01/24/2014 01:43 AM, Pádraig Brady wrote:
 On 01/24/2014 01:38 AM, Assaf Gordon wrote:
 This patch makes the test skip on my server (did not test it on other 
 systems).

 On 01/23/2014 08:09 PM, Pádraig Brady wrote:
 On 01/23/2014 11:41 PM, Assaf Gordon wrote:

 So I guess this is not a bug, and can be closed.
 I'll just ignore this failure on this system.

 It is a false failure though so would be worth avoiding.
 It's important to have robust tests we and builders can rely on.

 Would something along the following be possible?

 test $(getent group $group | wc -l) != 1 || skip_ multiple ids for group 
 $group: $(getent group $group)



 From 3737105eacbb23cbe453a3d210359fea614b7154 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= p...@draigbrady.com
 Date: Thu, 23 Jan 2014 20:34:52 -0500
 Subject: [PATCH] tests: skip chown/separator with duplicated groups

 * tests/chwon/separator.sh: skip test if the user's group has
 
 s/chwon/chown/
 
 multiple entries.
 Fixes http://bugs.gnu.org/16532
 ---
  tests/chown/separator.sh | 3 +++
  1 file changed, 3 insertions(+)

 diff --git a/tests/chown/separator.sh b/tests/chown/separator.sh
 index f64b738..ec33f4a 100755
 --- a/tests/chown/separator.sh
 +++ b/tests/chown/separator.sh
 @@ -31,6 +31,9 @@ test -n $id_g || framework_failure_
  id_gn=$(id -gn) || framework_failure_
  test -n $id_gn || framework_failure_

 +test $(getent group $id_gn | wc -l) != 1 ||

Actually I messed up the login in the suggestion.
I think the above should be s/!=/=/ which I've done
in the attached patch.

If you could confirm it was skipped on your system
it would be great.

I'll push soon anyway.

 +  skip_ multiple ids for group $id_gn: $(getent group $id_gn)

I also protected the $id_gn with quotes in case
there were spaces in the group name or something.

thanks,
Pádraig.

From 9ad5f9f8d8e15c9f47173427714bfd6bcff2730e Mon Sep 17 00:00:00 2001
From: Assaf Gordon assafgor...@gmail.com
Date: Thu, 23 Jan 2014 20:34:52 -0500
Subject: [PATCH] tests: skip chown/separator with conflicting group IDs

* tests/chown/separator.sh: skip test if the user's group has
multiple entries.
Fixes http://bugs.gnu.org/16532
---
 tests/chown/separator.sh |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tests/chown/separator.sh b/tests/chown/separator.sh
index f64b738..ed3635d 100755
--- a/tests/chown/separator.sh
+++ b/tests/chown/separator.sh
@@ -31,6 +31,11 @@ test -n $id_g || framework_failure_
 id_gn=$(id -gn) || framework_failure_
 test -n $id_gn || framework_failure_
 
+# Systems with both local and external groups with conflicting IDs,
+# were seen to fail this test erroneously with EPERM errors.
+test $(getent group $id_gn | wc -l) = 1 ||
+  skip_ multiple IDs for group '$id_gn': $(getent group $id_gn)
+
 # FreeBSD 6.x's getgrnam fails to look up a group name containing
 # a space. On such a system, skip this test if the group name contains
 # a byte not in the portable filename character set.
-- 
1.7.7.6



bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Assaf Gordon

On 01/23/2014 09:32 PM, Pádraig Brady wrote:


Actually I messed up the login in the suggestion.
I think the above should be s/!=/=/ which I've done
in the attached patch.

If you could confirm it was skipped on your system
it would be great.

I'll push soon anyway.



Please don't push yet - it doesn't work, but for un-expected reason:

my previous patch was incorrect (The = vs != as you pointed), but 
also getent groups was incorrect - so two wrongs did make a right :)


The test fails, here's why:

On my strange system:

===
$ getent group users
users:x:100:
===
vs.
===
$ getent group | grep ^users
users:x:100:
users:x:1000:www-data,XXX,YYY
===

And so, the skip test didn't actual work to begin with.

Should we change it to getent + grep ?

-gordon












bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Assaf Gordon

On 01/23/2014 09:46 PM, Assaf Gordon wrote:

On 01/23/2014 09:32 PM, Pádraig Brady wrote:


If you could confirm it was skipped on your system
it would be great.



Please don't push yet - it doesn't work, but for un-expected reason:
On my strange system


For completeness, attached is the test fail log.

Also, similar examples with other groups:

===
$ getent group | cut -f1 -d: | sort | uniq -d
adm
bin
daemon
lp
mail
root
sys
tty
users
uucp
$ getent group | grep ^mail:
mail:x:8:
mail:x:6:root
$ getent group mail
mail:x:8:
$ getent group | grep ^adm:
adm:x:4:
adm:x:4:root,adm,daemon
$ getent group adm
adm:x:4:
===

So yes, this is not an ideally-configured system.

-gordon

===
   GNU coreutils 8.22.17-ba34a-dirty: ./tests/test-suite.log
===

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: ./tests/chown/separator
=

++ initial_cwd_=/data/gordon/projects/coreutils
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /data/gordon/projects/coreutils gt-separator.sh.
+++ case $# in
+++ destdir_=/data/gordon/projects/coreutils
+++ template_=gt-separator.sh.
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
 unset TMPDIR
+++ d=/data/gordon/projects/coreutils/gt-separator.sh.t8dv
+++ case $d in
+++ test -d /data/gordon/projects/coreutils/gt-separator.sh.t8dv
 ls -dgo /data/gordon/projects/coreutils/gt-separator.sh.t8dv
 tr S -
+++ perms='drwx-- 2 6 Jan 23 21:41 /data/gordon/projects/coreutils/gt-separator.sh.t8dv'
+++ case $perms in
+++ test 0 = 0
+++ echo /data/gordon/projects/coreutils/gt-separator.sh.t8dv
+++ return
++ test_dir_=/data/gordon/projects/coreutils/gt-separator.sh.t8dv
++ cd /data/gordon/projects/coreutils/gt-separator.sh.t8dv
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/data/gordon/projects/coreutils/./src
+ case $abs_path_dir_ in
+ PATH=/data/gordon/projects/coreutils/./src:/data/gordon/projects/coreutils/src:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+ create_exe_shims_ /data/gordon/projects/coreutils/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ chown
+ test yes = yes
+ local i
+ for i in '$*'
+ env chown --version
chown (GNU coreutils) 8.22.17-ba34a-dirty
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie and Jim Meyering.
++ id -u
+ id_u=34574
+ test -n 34574
++ id -un
+ id_un=agordon
+ test -n agordon
++ id -g
+ id_g=1000
+ test -n 1000
++ id -gn
+ id_gn=users
+ test -n users
++ getent group users
++ wc -l
+ test 1 = 1
+ case $host_triplet in
+ chown '' .
+ for u in '$id_u' '$id_un' ''\'''\'''
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574:1000 .
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574.1000 .
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574:users .
chown: changing ownership of '.': Operation not permitted
+ fail=1
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574.users .
chown: changing ownership of '.': Operation not permitted
+ fail=1
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574: .
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 34574. .
+ for u in '$id_u' '$id_un' ''\'''\'''
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in '$seps'
+ case $u$sep$g in
+ chown agordon:1000 .
+ for sep in '$seps'
+ case $u$sep$g in
+ chown agordon.1000 .
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in '$seps'
+ case $u$sep$g in
+ chown agordon:users .
chown: changing ownership of '.': Operation not permitted
+ fail=1
+ for sep in '$seps'
+ case $u$sep$g in
+ chown agordon.users .
chown: changing ownership of '.': Operation not permitted
+ fail=1
+ for g in '$id_g' '$id_gn' ''\'''\'''
+ case $u$g in
+ seps=': .'
+ for sep in '$seps'
+ case $u$sep$g in
+ chown 

bug#16532: Test Fail: tests/chown/separator

2014-01-23 Thread Pádraig Brady
On 01/24/2014 02:46 AM, Assaf Gordon wrote:
 On 01/23/2014 09:32 PM, Pádraig Brady wrote:

 Actually I messed up the login in the suggestion.
 I think the above should be s/!=/=/ which I've done
 in the attached patch.

 If you could confirm it was skipped on your system
 it would be great.

 I'll push soon anyway.

 
 Please don't push yet - it doesn't work, but for un-expected reason:
 
 my previous patch was incorrect (The = vs != as you pointed), but also 
 getent groups was incorrect - so two wrongs did make a right :)
 
 The test fails, here's why:
 
 On my strange system:
 
 ===
 $ getent group users
 users:x:100:
 ===
 vs.
 ===
 $ getent group | grep ^users
 users:x:100:
 users:x:1000:www-data,XXX,YYY
 ===

Oh right, grep ^$id_gn: it is so.

Note we can't rely on getent(1) being available (as noted in bug 9987),
but the failure in that edge case is still a skip as the count will be 0 then.

thanks,
Pádraig.