From 5f83041242ca0ff38a74d51b85e00047568c4933 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 18 Sep 2023 12:28:26 +0200 Subject: tests/shell: skip reset tests if kernel lacks support reset is implemented via flush + extra attribute, so older kernels perform a flush. This means .nft doesn't work, we need to check if the individual set contents/sets are still in place post-reset. Make this generic and permit use of feat.sh in addition to the simpler foo.nft feature files. Signed-off-by: Florian Westphal Signed-off-by: Thomas Haller --- tests/shell/features/reset_rule.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 tests/shell/features/reset_rule.sh (limited to 'tests/shell/features/reset_rule.sh') diff --git a/tests/shell/features/reset_rule.sh b/tests/shell/features/reset_rule.sh new file mode 100755 index 00000000..567ee2f1 --- /dev/null +++ b/tests/shell/features/reset_rule.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# 8daa8fde3fc3 ("netfilter: nf_tables: Introduce NFT_MSG_GETRULE_RESET") +# v6.2-rc1~99^2~210^2~2 + +unshare -n bash -c "$NFT \"add table t; add chain t c ; add rule t c counter packets 1 bytes 42\"; \ +$NFT reset rules chain t c ; \ +$NFT reset rules chain t c |grep counter\ packets\ 0\ bytes\ 0" -- cgit v1.2.3