Skip to content

Commit

Permalink
integration/run-integration-tests-in-lxd: bail if unprivileged userns…
Browse files Browse the repository at this point in the history
… clone is not permitted

Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Jul 14, 2023
1 parent f9e4821 commit 61b689d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integration/run-integration-tests-in-lxd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ function run_tests {
lxc delete --force "$container_name"
}

# Make sure unprivileged userns clone is enabled otherwise security.nesting=true
# won't work.
if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" -eq 0 ]; then
echo "unpriviliged userns clone disabled, unable to run tests" >&2
exit 1
fi

declare -a images
if [ $# -gt 0 ]; then
images=("$@")
Expand Down

0 comments on commit 61b689d

Please sign in to comment.