Skip to content

Commit

Permalink
test: enable unpriv user namespaces
Browse files Browse the repository at this point in the history
These are disabled by default in some distros; we would like to test
rootless, however.

Signed-off-by: Casey Callendrello <[email protected]>
  • Loading branch information
squeed committed Jan 14, 2025
1 parent ba8bc7d commit c85121c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ done

# Run the pkg/ns tests as non root user
mkdir -p /tmp/cni-rootless
if [ "$(sysctl -bn kernel.unprivileged_userns_clone)" -ne "1" ]; then
echo "sudo sysctl -w kernel.unprivileged_userns_clone=1"
sudo sysctl -w kernel.unprivileged_userns_clone=1
fi
(export XDG_RUNTIME_DIR=/tmp/cni-rootless; cd pkg/ns/; unshare -rmn go test)

0 comments on commit c85121c

Please sign in to comment.