[PATCH nft 1/3] tests: shell: verify huge transaction returns expected number of rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Verify that we get the expected number of rules with --echo (i.e. the
reply wasn't truncated).

Signed-off-by: Eric Garver <eric@xxxxxxxxxxx>
---
 tests/shell/testcases/transactions/0049huge_0 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/shell/testcases/transactions/0049huge_0 b/tests/shell/testcases/transactions/0049huge_0
index 12338087c63e..2791249512b6 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
-- 
2.20.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux