netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iptables PATCH] tests: shell: Sanitize nft-only/0009-needless-bitwise_0
@ 2023-07-19 13:04 Phil Sutter
  2023-07-19 13:06 ` Phil Sutter
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2023-07-19 13:04 UTC (permalink / raw)
  To: netfilter-devel

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 41588a10863ec..34802cc26aad4 100755
--- a/iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0
+++ b/iptables/tests/shell/testcases/nft-only/0009-needless-bitwise_0
@@ -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)
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [iptables PATCH] tests: shell: Sanitize nft-only/0009-needless-bitwise_0
  2023-07-19 13:04 [iptables PATCH] tests: shell: Sanitize nft-only/0009-needless-bitwise_0 Phil Sutter
@ 2023-07-19 13:06 ` Phil Sutter
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Sutter @ 2023-07-19 13:06 UTC (permalink / raw)
  To: netfilter-devel

On Wed, Jul 19, 2023 at 03:04:32PM +0200, Phil Sutter wrote:
> 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>

Patch applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-19 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-19 13:04 [iptables PATCH] tests: shell: Sanitize nft-only/0009-needless-bitwise_0 Phil Sutter
2023-07-19 13:06 ` Phil Sutter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).