]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Skip the chcon test on a system with no SELinux support.
authorJim Meyering <meyering@redhat.com>
Tue, 9 Oct 2007 07:58:27 +0000 (09:58 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 9 Oct 2007 08:13:39 +0000 (10:13 +0200)
* tests/test-lib.sh (require_selinux_): New function.
* tests/misc/chcon: Use it.
* tests/misc/selinux: Use it here, too.
* tests/cp/cp-a-selinux: and here.
* tests/selinux: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove selinux.
Reported by Mike Frysinger and Bauke Jan Douma.

ChangeLog
tests/Makefile.am
tests/cp/cp-a-selinux
tests/misc/chcon
tests/misc/selinux
tests/selinux [deleted file]
tests/test-lib.sh

index 21c17c9371a6b066295c78e0a176e3012a2fd68f..792be83127a5d04fa342f0cc5ae7557684b4967a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2007-10-09  Jim Meyering  <meyering@redhat.com>
 
+       Skip the chcon test on a system with no SELinux support.
+       * tests/test-lib.sh (require_selinux_): New function.
+       * tests/misc/chcon: Use it.
+       * tests/misc/selinux: Use it here, too.
+       * tests/cp/cp-a-selinux: and here.
+       * tests/selinux: Remove file.
+       * tests/Makefile.am (EXTRA_DIST): Remove selinux.
+       Reported by Mike Frysinger and Bauke Jan Douma.
+
        * src/dircolors.hin: Recognize .lzma as a compressed-file suffix.
 
        * configure.ac (AM_INIT_AUTOMAKE): Use dist-lzma, rather than dist-bzip2.
index af9328de2a0ad0e53d53abe9980a04b008338e80..25b77fce02aef10a3404d12adec585b247f84ceb 100644 (file)
@@ -33,7 +33,6 @@ EXTRA_DIST =          \
   priv-check           \
   rwx-to-mode          \
   sample-test          \
-  selinux              \
   setgid-check         \
   sparse-file          \
   strace               \
index 8cb5a456cfe9624e8d1ff081d35b2dbb6f6e10a3..c0d98bdac8d609350ae079620e5a930e29a77e46 100755 (executable)
@@ -23,9 +23,9 @@ if test "$VERBOSE" = yes; then
 fi
 
 . $srcdir/../lang-default
-. $srcdir/../selinux
 PRIV_CHECK_ARG=require-root . $srcdir/../priv-check
 . $srcdir/../test-lib.sh
+require_selinux_
 
 cwd=`pwd`
 cleanup_() { cd /; umount "$cwd/mnt"; }
index 46aaf87e31b3d6c36919d65d4a8d34161db4ac3c..3307bc970939ab83d938097dcd601ab5d40ca87e 100755 (executable)
@@ -9,6 +9,8 @@ fi
 . $srcdir/../lang-default
 PRIV_CHECK_ARG=require-root . $srcdir/../priv-check
 . $srcdir/../test-lib.sh
+require_selinux_
+
 mkdir -p d/sub/s2 || framework_failure
 touch f g d/sub/1 d/sub/2 || framework_failure
 
index 67de51ea321333d1ebc2ffe763204760aed7a73c..847ccac2c652ac1b3a386794983d36d749e6561f 100755 (executable)
@@ -11,9 +11,9 @@ if test "$VERBOSE" = yes; then
 fi
 
 . $srcdir/../lang-default
-. $srcdir/../selinux
 . $srcdir/../test-lib.sh
 skip_if_root_
+require_selinux_
 
 # Create a regular file, dir, fifo.
 touch f || framework_failure
diff --git a/tests/selinux b/tests/selinux
deleted file mode 100644 (file)
index 2026a6a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Skip this test if there is insufficient SELinux support.
-# Copyright (C) 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-case `ls -Zd .` in
-  '? .'|'unlabeled .')
-    echo "$0: skipping this test; this system (or maybe just" 1>&2
-    echo "   the current file system) lacks SELinux support" 1>&2
-    (exit 77); exit 77
-  ;;
-esac
index 9d47242e48b3e2f1bad480a6659c400259e4f8ff..66fbc1dc403075e5f4bd5b6b62fe47ebad4414c8 100644 (file)
@@ -39,6 +39,16 @@ skip_if_()
   esac
 }
 
+require_selinux_()
+{
+  case `ls -Zd .` in
+    '? .'|'unlabeled .')
+      skip_test_ "this system (or maybe just" \
+        "the current file system) lacks SELinux support"
+    ;;
+  esac
+}
+
 skip_if_root_() { uid_is_privileged_ && skip_test_ "must be run as non-root"; }
 error_() { echo "$0: $@" 1>&2; (exit 1); exit 1; }
 framework_failure() { error_ 'failure in testing framework'; }
@@ -73,3 +83,7 @@ elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
 else
   compare() { cmp "$@"; }
 fi
+
+# Local Variables:
+# indent-tabs-mode: nil
+# End: