[augeas-devel] augeas: master - tests: extract SELinux context more portably

David Lutterkort lutter at fedoraproject.org
Mon Jul 27 13:04:18 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=7a3a89a03249c0d96153a1a100f9030345057003
Commit:        7a3a89a03249c0d96153a1a100f9030345057003
Parent:        2c0668171461942edbfc4eb5965ae1e5866e4e11
Author:        Jim Meyering <meyering at redhat.com>
AuthorDate:    Tue Jul 21 09:22:45 2009 -0400
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Thu Jul 23 11:12:00 2009 +0200

tests: extract SELinux context more portably

* test-preserve.sh: Use stat --format=%C $hosts ... rather than
ls -lZ $hosts | cut -d ' ' -f 5.  The latter fails with some
combinations of ls and SELinux.
---
 tests/test-preserve.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/test-preserve.sh b/tests/test-preserve.sh
index 301b0c1..eb6bb7a 100755
--- a/tests/test-preserve.sh
+++ b/tests/test-preserve.sh
@@ -42,7 +42,7 @@ fi
 act_group=$(ls -l $hosts | sed -e 's/  */ /g' | cut -d ' ' -f 4)
 act_mode=$(ls -l $hosts | cut -b 1-10)
 if [ $selinux = yes ] ; then
-  act_con=$(ls -lZ $hosts | cut -d ' ' -f 5 | cut -d ':' -f 3)
+  act_con=$(stat --format=%C $hosts | cut -d ':' -f 3)
 fi
 if [ "x$group" != "x$act_group" ] ; then
     echo "Expected group $group but got $act_group"




More information about the augeas-devel mailing list