summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2019-06-02 01:14:00 -0600
committerAssaf Gordon <assafgordon@gmail.com>2019-06-02 01:14:00 -0600
commita9cb52bcf39f0ee307301ac73c11acb24372b9d8 (patch)
treedb1b039830893cbae16e8e96e290d1fcda237da4
parent07ef8a3138bac38245ee86be5e3759eac2363f17 (diff)
downloadsed-a9cb52bcf39f0ee307301ac73c11acb24372b9d8.tar.gz
tests: inplace-selinux.sh: skip if SELinux is not supported
Avoid false-positive failure on system with SELinux enabled when SED is built without SELinux suppport. Reported by Jeffrey Walton <noloader@gmail.com> in https://bugs.gnu.org/35997 . * testsuite/inplace-selinux.sh: Call 'sed --version' to check if sed was built with SELinux support before continuing with the test.
-rwxr-xr-xtestsuite/inplace-selinux.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/testsuite/inplace-selinux.sh b/testsuite/inplace-selinux.sh
index a560764..6dacf12 100755
--- a/testsuite/inplace-selinux.sh
+++ b/testsuite/inplace-selinux.sh
@@ -18,6 +18,11 @@
print_ver_ sed
require_selinux_
+sed --version | grep -q "with SELinux" \
+ || skip_ "sed built without SELinux support"
+sed --version | grep -q "^SELinux is enabled" \
+ || skip_ "sed reports SELinux is disabled on this system"
+
touch a || framework_failure_
chcon -u system_u a || skip_ "chcon doesn't work"
chcon -u user_u a || skip_ "chcon doesn't work"