]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests/shell: Fix nft-only/0009-needless-bitwise_0
authorPhil Sutter <phil@nwl.cc>
Fri, 15 Jan 2021 20:58:48 +0000 (21:58 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 15 Jan 2021 21:23:40 +0000 (22:23 +0100)
For whatever reason, stored expected output contains false handles. To
overcome this, filter the rule data lines from both expected and stored
output before comparing.

Fixes: 81a2e12851283 ("tests/shell: Add test for bitwise avoidance fixes")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0

index 41d765e537312c8e33722d87d53fd860f029eaff..41588a10863ec6450549be86dbfc0ab437380af1 100755 (executable)
@@ -336,4 +336,11 @@ bridge filter OUTPUT 10 9
   [ counter pkts 0 bytes 0 ]
 "
 
-diff -u -Z <(echo "$EXPECT") <(nft --debug=netlink list ruleset | awk '/^table/{exit} {print}')
+# print nothing but:
+# - lines with bytecode (starting with '  [')
+# - empty lines (so printed diff is not a complete mess)
+filter() {
+       awk '/^(  \[|$)/{print}'
+}
+
+diff -u -Z <(filter <<< "$EXPECT") <(nft --debug=netlink list ruleset | filter)