commit
91dc281a82ea ("src: rework singleton interval transformation to
reduce memory consumption") duplicates singleton interval elements when
the netlink message gets full, this results in spurious EEXIST errors
when creating many elements in a set.
This patch extends the existing test to cover for this bug.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
echo "add table x
add map x y { type ipv4_addr : ipv4_addr; flags interval; }
-add element x y $(generate_add)" > $tmpfile
+create element x y $(generate_add)" > $tmpfile
set -e
$NFT -f $tmpfile
exit 1
fi
+$NFT flush ruleset
+
+# now try with add element command
+echo "add table x
+add map x y { type ipv4_addr : ipv4_addr; flags interval; }
+add element x y $(generate_add)" > $tmpfile
+
+set -e
+$NFT -f $tmpfile
+
+# same listing output is EXPECTED, no need to generate it again.
+
+GET=$($NFT list ruleset)
+if [ "$EXPECTED" != "$GET" ] ; then
+ $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+ exit 1
+fi
+
if [ "$HOWMANY" != 63 ] ; then
echo "Run a partial test due to NFT_TEST_SKIP_slow=y. Skip"
exit 77