summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEric Garver <eric@garver.life>2019-09-10 09:43:26 -0400
committerPhil Sutter <phil@nwl.cc>2019-09-10 18:10:20 +0200
commit4266e8f3edcc65d64d4bf6182b6154ecb71c840e (patch)
treeddb79f88c56797cca1495a3db23a1242ea68a0dd /tests
parent0459d27570aa074910308e3bb367fee6a687f594 (diff)
tests: shell: verify huge transaction returns expected number of rules
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>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/shell/testcases/transactions/0049huge_05
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/shell/testcases/transactions/0049huge_0 b/tests/shell/testcases/transactions/0049huge_0
index 12338087..27912495 100755
--- a/tests/shell/testcases/transactions/0049huge_0
+++ b/tests/shell/testcases/transactions/0049huge_0
@@ -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