From 222b7c46bd717f17bcfa40219eecffaf56a5369b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 9 Mar 2007 08:47:33 +0100 Subject: Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9) * tests/chgrp/basic: Don't let failure by chgrp to set the group of a symlink make this test fail. Do give a diagnostic. In the chgrp-no-change-ctime test, add darwin7.9.0 as another known-failing system. When failing on some other system, print $host_triplet, too. Reported by Peter Fales. --- tests/chgrp/basic | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'tests/chgrp') diff --git a/tests/chgrp/basic b/tests/chgrp/basic index 897900d00..ccc69f036 100755 --- a/tests/chgrp/basic +++ b/tests/chgrp/basic @@ -1,8 +1,7 @@ #!/bin/sh # make sure chgrp is reasonable -# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006 Free Software -# Foundation, Inc. +# Copyright (C) 2000-2007 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -79,7 +78,11 @@ test `stat --printf=%g f` = $g1 || fail=1 # This should not change the group of f. chgrp -h $g2 symlink test `stat --printf=%g f` = $g1 || fail=1 -test `stat --printf=%g symlink` = $g2 || fail=1 + +# Don't fail if chgrp failed to set the group of a symlink. +# Some systems don't support that. +test `stat --printf=%g symlink` = $g2 || + echo 'info: failed to set group of symlink' 1>&2 chown --from=:$g1 :$g2 f; test `stat --printf=%g f` = $g2 || fail=1 @@ -110,15 +113,18 @@ sleep 1 chgrp $g1 f # The following no-change chgrp command is supposed to update f's ctime, -# but on OpenBSD, it appears to be a no-op for some file system types -# (at least NFS) so g's ctime is more recent. This is not a big deal; +# but on OpenBSD and Darwin 7.9.0, it appears to be a no-op for some file +# system types (at least NFS) so g's ctime is more recent. +# This is not a big deal; # this test works fine when the files are on a local file system (/tmp). chgrp '' f test "`ls -C -c -t f g`" = 'f g' || \ { case $host_triplet in - *openbsd*) echo ignoring known OpenBSD-specific chgrp failure 1>&2 ;; - *) echo no-change chgrp failed to update ctime 1>&2; fail=1 ;; + *openbsd*) echo ignoring known OpenBSD-specific chgrp failure 1>&2 ;; + *darwin7.9.0) echo ignoring known MacOS X-specific chgrp failure 1>&2 ;; + *) echo $host_triplet: no-change chgrp failed to update ctime 1>&2; + fail=1 ;; esac } -- cgit v1.2.3-70-g09d2