Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> --- tests/shell/features/setelem_expiration.sh | 18 ++++++++++++++++++ .../sets/0036add_set_element_expiration_0 | 2 ++ 2 files changed, 20 insertions(+) create mode 100755 tests/shell/features/setelem_expiration.sh diff --git a/tests/shell/features/setelem_expiration.sh b/tests/shell/features/setelem_expiration.sh new file mode 100755 index 000000000000..deb06cfb2f06 --- /dev/null +++ b/tests/shell/features/setelem_expiration.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# v5.3-rc1~140^2~153^2~8 +# 79ebb5bb4e38 ("netfilter: nf_tables: enable set expiration time for set elements") + +EXPECTED="table ip x { + set y { + type ipv4_addr + flags dynamic,timeout; + elements = { 1.1.1.1 expires 30s } + } +}" + +$NFT -f - <<< $EXPECTED + +$NFT list ruleset | grep "expires" +[ $? -ne 1 ] && exit 1 +exit 0 diff --git a/tests/shell/testcases/sets/0036add_set_element_expiration_0 b/tests/shell/testcases/sets/0036add_set_element_expiration_0 index 0fd016e9f857..d961ffd4cdcd 100755 --- a/tests/shell/testcases/sets/0036add_set_element_expiration_0 +++ b/tests/shell/testcases/sets/0036add_set_element_expiration_0 @@ -1,5 +1,7 @@ #!/bin/bash +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_setelem_expiration) + set -e drop_seconds() { -- 2.30.2