diff options
author | Phil Sutter <phil@nwl.cc> | 2021-01-15 21:58:48 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2021-01-15 22:23:40 +0100 |
commit | 0f7ea0390b33654c9a91015966f518b98356e786 (patch) | |
tree | 96a53860ebc9c0de74001e51c24e0cb193b97e8a /iptables | |
parent | fd4b9bf08b9eb4994bbba426426a978c5b9af590 (diff) |
tests/shell: Fix nft-only/0009-needless-bitwise_0
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>
Diffstat (limited to 'iptables')
-rwxr-xr-x | iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0 b/iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0 index 41d765e5..41588a10 100755 --- a/iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0 +++ b/iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0 @@ -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) |