tests/shell: Fix nft-only/0009-needless-bitwise_0
Phil Sutter
reviewerPATCH 1/1 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 <[email protected]>
--- .../shell/testcases/nft-only/0009-needless-bitwise_0 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0 +8 -1
@@ -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)
Signature · 1 line
2.28.0