Skip to content

Commit f9d5502

Browse files
committed
lib/testing: Execute tests in separate namespaces
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 <[email protected]>
1 parent 23865d4 commit f9d5502

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/testing/test_runner.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,11 @@ if [ "$EUID" -ne "0" ]; then
580580
else
581581
die "Tests should be run as root"
582582
fi
583+
else
584+
if [ "${DID_UNSHARE:-0}" -ne "1" ]; then
585+
echo " Executing tests in separate net- and mount namespaces" >&2
586+
exec env DID_UNSHARE=1 unshare -n -m "$0" "$@"
587+
fi
583588
fi
584589

585590
export XDP_FILTER

0 commit comments

Comments
 (0)