From: Jim Meyering Date: Fri, 27 Feb 2009 08:16:45 +0000 (+0100) Subject: tests: reflect the s/+/./ SELinux indicator change X-Git-Tag: v7.2~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0433f90e3d388734888dad17f5fc2f106c59faf4;p=thirdparty%2Fcoreutils.git tests: reflect the s/+/./ SELinux indicator change * tests/mkdir/perm: Now that this test is no longer always skipped, make it work independently of ls: use stat, not ls, to get perm string. * test-lib.sh (rwx_to_mode_): Use stat, not ls to get perm string This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set. --- diff --git a/tests/mkdir/perm b/tests/mkdir/perm index 2f8715b478..2f12d073fb 100755 --- a/tests/mkdir/perm +++ b/tests/mkdir/perm @@ -2,7 +2,7 @@ # Verify that mkdir's `-m MODE' option works properly # with various umask settings. -# Copyright (C) 2000, 2002-2008 Free Software Foundation, Inc. +# Copyright (C) 2000, 2002-2009 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 @@ -72,11 +72,11 @@ for p in empty -p; do mkdir $p $mode parent/sub || fail=1 - perms=`ls -ld parent | sed 's/ .*//; s/+$//'` + perms=$(stat --printf %A parent) test "$parent_perms" = "$perms" \ || { fail=1; echo parent: expected $parent_perms, got $perms; } - perms=`ls -ld parent/sub | sed 's/ .*//; s/+$//'` + perms=$(stat --printf %A parent/sub) test "$sub_perms" = "$perms" \ || { fail=1; echo parent/sub: expected $sub_perms, got $perms; } diff --git a/tests/test-lib.sh b/tests/test-lib.sh index b3aaf65db3..45026f13da 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -136,7 +136,7 @@ rwx_to_mode_() case $rwx in [ld-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxtT-]) ;; - [ld-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxtT-]+) ;; + [ld-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxtT-][+.]) ;; *) echo "$0: invalid mode string: $rwx" 1>&2; return;; esac