]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: shell: Sanitize nft-only/0009-needless-bitwise_0
authorPhil Sutter <phil@nwl.cc>
Wed, 19 Jul 2023 12:58:11 +0000 (14:58 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 19 Jul 2023 13:05:47 +0000 (15:05 +0200)
Some versions of awk (gawk-4.2.1-4.el8 in particular) also print the
non-debug ruleset listing's empty lines, causing the diff to fail. Catch
this by exiting upon seeing the first table heading. For the sake of
comparing bytecode, the actual ruleset listing is not interesting,
anyway.

Fixes: 0f7ea0390b336 ("tests/shell: Fix nft-only/0009-needless-bitwise_0")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0

index 41588a10863ec6450549be86dbfc0ab437380af1..34802cc26aad431165c1d121db6d617d34405e42 100755 (executable)
@@ -340,7 +340,7 @@ bridge filter OUTPUT 10 9
 # - lines with bytecode (starting with '  [')
 # - empty lines (so printed diff is not a complete mess)
 filter() {
-       awk '/^(  \[|$)/{print}'
+       awk '/^table /{exit} /^(  \[|$)/{print}'
 }
 
 diff -u -Z <(filter <<< "$EXPECT") <(nft --debug=netlink list ruleset | filter)