On Wed, Dec 06, 2023 at 01:33:25PM +0100, Pablo Neira Ayuso wrote: > On Wed, Dec 06, 2023 at 01:18:28PM +0100, Florian Westphal wrote: > > Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote: > > > > The mode without unshare exists for historic reasons, as unshare was > > > > added initially. At this point, what is the use of supporting or using > > > > that? > > > > > > This provides an easy way for me to test 'nft monitor'. > > > > > > I can keep it out of tree if you prefer -U remains broken. > > > > No no no, I was just asking if '-U' should still run the > > feature probes without a netns, which is what its doing right > > now. > > > > Perhaps -U should just disable the unshare for the actual shell > > tests, not for the feature probe scripts. > > Ah, I understand. Fine with me. Maybe this?
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh index 86c8312683cc..55ebbe6d236d 100755 --- a/tests/shell/run-tests.sh +++ b/tests/shell/run-tests.sh @@ -497,6 +497,7 @@ detect_unshare() { return 1 fi NFT_TEST_UNSHARE_CMD="$1" + NFT_REAL_UNSHARE_CMD="$1" return 0 } @@ -581,12 +582,12 @@ feature_probe() local with_path="$NFT_TEST_BASEDIR/features/$1" if [ -r "$with_path.nft" ] ; then - $NFT_TEST_UNSHARE_CMD "$NFT_REAL" --check -f "$with_path.nft" &>/dev/null + $NFT_REAL_UNSHARE_CMD "$NFT_REAL" --check -f "$with_path.nft" &>/dev/null return $? fi if [ -x "$with_path.sh" ] ; then - NFT="$NFT_REAL" $NFT_TEST_UNSHARE_CMD "$with_path.sh" &>/dev/null + NFT="$NFT_REAL" $NFT_REAL_UNSHARE_CMD "$with_path.sh" &>/dev/null return $? fi @@ -602,9 +603,6 @@ for feat in "${_HAVE_OPTS[@]}" ; do val="$(bool_n "${!var}")" fi eval "export $var=$val" - if [ "$NFT_TEST_HAS_UNSHARED" != y ] ; then - $NFT flush ruleset - fi done if [ "$NFT_TEST_JOBS" -eq 0 ] ; then