coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: runcon: fix new test to skip on non SELinux systems


From: Pádraig Brady
Subject: [PATCH] tests: runcon: fix new test to skip on non SELinux systems
Date: Sat, 27 Aug 2022 22:19:39 +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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/misc/runcon-compute.sh b/tests/misc/runcon-compute.sh
index 1c4e0c060..4db24ac4b 100755
--- a/tests/misc/runcon-compute.sh
+++ b/tests/misc/runcon-compute.sh
@@ -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
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]