* tests/misc/selinux: Skip this test if the initial chcon fails.
authorJim Meyering <jim@meyering.net>
Wed, 3 Oct 2007 10:56:32 +0000 (12:56 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 3 Oct 2007 10:56:32 +0000 (12:56 +0200)
ChangeLog
tests/misc/selinux

index afc67cb..8dab218 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-10-03  Jim Meyering  <jim@meyering.net>
+
+       * tests/misc/selinux: Skip this test if the initial chcon fails.
+
 2007-10-02  Jim Meyering  <jim@meyering.net>
 
        Never copy through a symlink that cp has just created.
index a4fc78a..67de51e 100755 (executable)
@@ -25,7 +25,11 @@ fail=0
 ctx=root:object_r:tmp_t
 # FIXME, what if $ctx is no different from the default.  Not likely.
 # give each a different context, via chcon
-chcon $ctx f d p || fail=1
+chcon $ctx f d p 2>/dev/null || {
+  echo 1>&2 'skipping this test: "chcon '$ctx' ..." failed'
+  (exit 77); exit 77
+}
+
 # inspect that context with both ls -Z and stat.
 for i in d f p; do
   c=`ls -dogZ $i|cut -d' ' -f3`; test x$c = x$ctx || fail=1