Skip to content

Commit

Permalink
lib/testing: Execute tests in separate namespaces
Browse files Browse the repository at this point in the history
We moved the libxdp tests to separate namespaces, but not the tool tests. Let's
move the tool tests as well, since they also mess with namespace setups, so it's
better to make sure they don't interfere with the rest of the system.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
  • Loading branch information
tohojo committed Aug 5, 2024
1 parent 23865d4 commit f9d5502
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/testing/test_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,11 @@ if [ "$EUID" -ne "0" ]; then
else
die "Tests should be run as root"
fi
else
if [ "${DID_UNSHARE:-0}" -ne "1" ]; then
echo " Executing tests in separate net- and mount namespaces" >&2
exec env DID_UNSHARE=1 unshare -n -m "$0" "$@"
fi
fi

export XDP_FILTER
Expand Down

0 comments on commit f9d5502

Please sign in to comment.