From a2b6e503c53ed6f4e20474e78f17fac208f4627e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 3 Nov 2015 22:05:26 -0500 Subject: [PATCH] tests: Skip 'guix environment --container' tests in some cases. The tests in tests/guix-environment-container.sh cannot be performed unless the system supports user namespaces. * tests/guix-environment-container.sh: Skip if feature tests fail. --- tests/guix-environment-container.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index 141fd16..9e75ac5 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -22,6 +22,25 @@ set -e +# Perform some feature tests to determine if the tests are applicable. +if test -f /proc/self/ns/user -a \ + -f /proc/self/setgroups +then + if test -f /proc/sys/kernel/unprivileged_userns_clone + then + if test $(cat /proc/sys/kernel/unprivileged_userns_clone) = "1" + then + true + else + exit 77 + fi + else + true + fi +else + exit 77 +fi + guix environment --version tmpdir="t-guix-environment-$$" -- 2.5.0