* 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.
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.
priv-check \
rwx-to-mode \
sample-test \
- selinux \
setgid-check \
sparse-file \
strace \
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"; }
. $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
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
+++ /dev/null
-# 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
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'; }
else
compare() { cmp "$@"; }
fi
+
+# Local Variables:
+# indent-tabs-mode: nil
+# End: