All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: kadlec@netfilter.org, Florian Westphal <fw@strlen.de>
Subject: [PATCH ipset 3/7] tests: diff.sh: preserve file name
Date: Thu,  9 Jul 2026 22:03:54 +0200	[thread overview]
Message-ID: <20260709200358.15504-4-fw@strlen.de> (raw)
In-Reply-To: <20260709200358.15504-1-fw@strlen.de>

As-is, in case of error, its not easy to see which diff file has
failed, because diff gets fed via <(sed...), so diff shows
something like
--- /dev/fd/63
+++ /dev/ ..

Take advantage of the temporary directory and output a file
that has keeps part of the original name.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tests/diff.sh | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tests/diff.sh b/tests/diff.sh
index a364a28b1dda..76b1938149eb 100755
--- a/tests/diff.sh
+++ b/tests/diff.sh
@@ -1,7 +1,14 @@
 #!/bin/bash
 
-diff -u -I 'Revision: .*' -I 'Size in memory.*' \
-    <(sed -e 's/timeout [0-9]*/timeout x/' -e 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' $1) \
-    <(sed -e 's/timeout [0-9]*/timeout x/' -e 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' $2)
+NEW_DUMP="$IPSET_TMP/kernel-dump.sed"
+STORED_DUMP="$IPSET_TMP/$2.sed"
 
+sed -e 's/timeout [0-9]*/timeout x/' -e 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' "$1" > "$NEW_DUMP"
+sed -e 's/timeout [0-9]*/timeout x/' -e 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' "$2" > "$STORED_DUMP"
 
+diff -u -I 'Revision: .*' -I 'Size in memory.*' "$STORED_DUMP" "$NEW_DUMP"
+ret=$?
+
+rm -f "$STORED_DUMP" "$NEW_DUMP"
+
+exit $ret
-- 
2.54.0


  parent reply	other threads:[~2026-07-09 20:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 20:03 [PATCH ipset 0/7] test updates Florian Westphal
2026-07-09 20:03 ` [PATCH ipset 1/7] tests: make runtest.sh work with readonly-cwd Florian Westphal
2026-07-09 20:03 ` [PATCH ipset 2/7] tests: runtest.sh: run inside namespace Florian Westphal
2026-07-09 20:03 ` Florian Westphal [this message]
2026-07-09 20:03 ` [PATCH ipset 4/7] tests: check_klog.sh: unclutter stderr Florian Westphal
2026-07-09 20:03 ` [PATCH ipset 5/7] tests: setlist_ns.sh: use local ipset binary and don't rely on userns Florian Westphal
2026-07-09 20:03 ` [PATCH ipset 6/7] tests: make setlist_resize.sh more verbose on error Florian Westphal
2026-07-09 20:03 ` [PATCH ipset 7/7] tests: runtest.sh: add sendip emulation via scapy Florian Westphal
2026-07-13 13:35 ` [PATCH ipset 0/7] test updates Jozsef Kadlecsik
2026-07-13 14:11   ` Pablo Neira Ayuso
2026-07-13 14:25     ` Jozsef Kadlecsik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260709200358.15504-4-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.