Add a test to validate set overlap and automerge for large set. This test runs nft -f twice to cover for set reload without flush. Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> --- .../testcases/sets/overlap_automerge_large_0 | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tests/shell/testcases/sets/overlap_automerge_large_0 diff --git a/tests/shell/testcases/sets/overlap_automerge_large_0 b/tests/shell/testcases/sets/overlap_automerge_large_0 new file mode 100755 index 000000000000..578eeda81831 --- /dev/null +++ b/tests/shell/testcases/sets/overlap_automerge_large_0 @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e + +RULESET="table inet x { + set y { + type ipv4_addr + flags interval + } +}" + +tmpfile=$(mktemp) + +for ((i=1;i<255;i+=2)) +do + for ((j=1;j<224;j+=2)) + do + echo "add element inet x y { 10.100.$i.$j }" >> $tmpfile + done +done + +$NFT -f - <<< $RULESET +time $NFT -f $tmpfile +time $NFT -f $tmpfile +$NFT flush ruleset + +tmpfile2=$(mktemp) + +RULESET="table inet x { + set y { + type ipv4_addr + flags interval + auto-merge + } +}" + +for ((i=1;i<255;i+=2)) +do + for ((j=1;j<224;j+=2)) + do + echo "add element inet x y { 10.100.$i.$j }" >> $tmpfile2 + j=$(($j+1)) + echo "add element inet x y { 10.100.$i.$j }" >> $tmpfile2 + done +done + +$NFT -f - <<< $RULESET +time $NFT -f $tmpfile2 +time $NFT -f $tmpfile2 + +rm -f $tmpfile +rm -f $tmpfile2 -- 2.30.2