tests/bz1031154: skip if selinux is disabled
Hi David,
Quoted 5 lines · Artem Savkov
With selinux disabled the test currently fails trying to setenforce, it should be skipped instead. Found while trying to run in a container where selinux always appears disabled.
Signed-off-by Artem Savkov <[email protected]>
Is there any feedback on v2 of this patch?
Quoted 40 lines
--- tests/bugzillas/bz1031154/runtest.sh | 1 + tests/toolbox.inc.sh | 9 +++++++++ 2 files changed, 10 insertions(+)tests/bugzillas/bz1031154/runtest.sh +1
-0@@ -20,6 +20,7 @@ then exit 0 fi +require_selinux require_command getenforce require_command setenforce require_command runcontests/toolbox.inc.sh +9
-0@@ -115,6 +115,15 @@ function require_command () fi } +function require_selinux () +{ + if ! grep -q selinuxfs /proc/mounts; + then + toolbox_skip_test $TEST "SKIP DUE TO DISABLED SELINUX" + exit 0 + fi +} + ############################################################################### # # extract an error message from the log file and check itSignature · 1 line
2.7.5
Signature · 2 lines
Regards, Artem