]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: runcon: fix new test to skip on non SELinux systems
authorPádraig Brady <P@draigBrady.com>
Sat, 27 Aug 2022 21:15:44 +0000 (22:15 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 27 Aug 2022 21:15:44 +0000 (22:15 +0100)
* tests/misc/runcon-compute.sh: Use our new internal error
125 status to detect SELinux errors, and skip in this case.

tests/misc/runcon-compute.sh

index 1c4e0c06073f118e8f029627341341d422a7e397..4db24ac4b2ee2da716da804b1bb657dbe82158f7 100755 (executable)
@@ -23,6 +23,8 @@ print_ver_ runcon
 printf '%s\n' '#!/bin/sh' 'exit 1' >> 'true' || framework_failure_
 chmod a+x 'true' || framework_failure_
 
-returns_ 1 runcon -c true || fail=1
+runcon -c true; ret=$?
+test "$ret" = 125 && skip_ 'runcon setup failed'
+test "$ret" = 1 || fail=1
 
 Exit $fail