forked from lix-project/lix
Merge pull request #2211 from unsatcore/master
tests: more robust check for user namespaces availability (canUseSand…
This commit is contained in:
commit
de71335e4d
|
@ -57,7 +57,7 @@ rec {
|
||||||
git
|
git
|
||||||
mercurial
|
mercurial
|
||||||
]
|
]
|
||||||
++ lib.optional stdenv.isLinux libseccomp
|
++ lib.optionals stdenv.isLinux [libseccomp utillinux]
|
||||||
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
|
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
|
||||||
++ lib.optional (stdenv.isLinux || stdenv.isDarwin)
|
++ lib.optional (stdenv.isLinux || stdenv.isDarwin)
|
||||||
(aws-sdk-cpp.override {
|
(aws-sdk-cpp.override {
|
||||||
|
|
|
@ -94,12 +94,10 @@ canUseSandbox() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e /proc/sys/kernel/unprivileged_userns_clone ]; then
|
if ! unshare --user true ; then
|
||||||
if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
|
|
||||||
echo "Unprivileged user namespaces disabled by sysctl, skipping this test..."
|
echo "Unprivileged user namespaces disabled by sysctl, skipping this test..."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue