]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: verify huge transaction returns expected number of rules
authorEric Garver <eric@garver.life>
Tue, 10 Sep 2019 13:43:26 +0000 (09:43 -0400)
committerPhil Sutter <phil@nwl.cc>
Tue, 10 Sep 2019 16:10:20 +0000 (18:10 +0200)
Verify that we get the expected number of rules with --echo (i.e. the
reply wasn't truncated).

Signed-off-by: Eric Garver <eric@garver.life>
Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/shell/testcases/transactions/0049huge_0

index 12338087c63e0c8fa5e30921bfe82ca384f38383..2791249512b6d7e13282dc5ab9c056f21fd84cff 100755 (executable)
@@ -6,9 +6,10 @@ $NFT flush ruleset
 $NFT add table inet test
 $NFT add chain inet test c
 
+RULE_COUNT=3000
 RULESET=$(
-for ((i = 0; i < 3000; i++)); do
+for ((i = 0; i < ${RULE_COUNT}; i++)); do
        echo "add rule inet test c accept comment rule$i"
 done
 )
-$NFT -e -f - <<< "$RULESET" >/dev/null
+test $($NFT -e -a -f - <<< "$RULESET" |grep "#[ ]\+handle[ ]\+[0-9]\+" |wc -l) -eq ${RULE_COUNT} || exit 1