The script runs command in network+user namespace with remapped uid0. In case this fails (e.g. because user namespaces are disabled), we should re-try with plain "-n" before giving up and returning an error. Also, in case 'ipset' isn't in $PATH, this fails. Let runtest.sh export the ipset binary to use and refer to that. While at it, parallelize the test and also run it 124 times, not just 4 times - missing $() resulted in 'for x in a b c d ..'. Signed-off-by: Florian Westphal x --- tests/runtest.sh | 1 + tests/setlist_ns.sh | 29 +++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/runtest.sh b/tests/runtest.sh index 766335fda768..ba4683f59e5d 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -22,6 +22,7 @@ tests="$tests comment setlist restore" if [ "$IPSET_UNSHARED" = "" ]; then # Re-execute in new network namespace export IPSET_UNSHARED="yes" + export IPSET_BIN="$ipset" sysctl net.netfilter.nf_log_all_netns=1 exec unshare -n -- "$0" "$@" fi diff --git a/tests/setlist_ns.sh b/tests/setlist_ns.sh index 9e47d65e95dc..67232acdd906 100755 --- a/tests/setlist_ns.sh +++ b/tests/setlist_ns.sh @@ -2,21 +2,42 @@ set -e +[ -z "$IPSET_BIN" ] && IPSET_BIN=ipset + CMD=$(cat <