summaryrefslogtreecommitdiffstats
path: root/tests/shell/run-tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/run-tests.sh')
-rwxr-xr-xtests/shell/run-tests.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 26f8f46d..51c90c9b 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -22,6 +22,15 @@ if [ "$(id -u)" != "0" ] ; then
msg_error "this requires root!"
fi
+if [ "${1}" != "run" ]; then
+ if unshare -f -n true; then
+ unshare -n "${0}" run $@
+ exit $?
+ fi
+ msg_warn "cannot run in own namespace, connectivity might break"
+fi
+shift
+
[ -z "$NFT" ] && NFT=$SRC_NFT
if [ ! -x "$NFT" ] ; then
msg_error "no nft binary!"