From: Antonio Quartulli <antonio@openvpn.net>
To: netdev@vger.kernel.org
Cc: ralf@mandelbit.com, Sabrina Dubroca <sd@queasysnail.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Antonio Quartulli <antonio@openvpn.net>
Subject: [PATCH net-next 3/5] selftests: ovpn: flatten slurped notification JSON before filtering
Date: Mon, 13 Apr 2026 00:11:19 +0200 [thread overview]
Message-ID: <20260412221121.410365-4-antonio@openvpn.net> (raw)
In-Reply-To: <20260412221121.410365-1-antonio@openvpn.net>
From: Ralf Lici <ralf@mandelbit.com>
Notification comparison uses jq -s, which slurps all inputs into an
array. Some inputs can be arrays themselves, and applying the .msg.peer
filter directly on those entries triggers jq type errors.
Expand any array-valued JSON items returned by jq -s before selecting
.msg.peer, so the filter handles both normal notification objects and []
entries without type errors.
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
---
tools/testing/selftests/net/ovpn/common.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/ovpn/common.sh b/tools/testing/selftests/net/ovpn/common.sh
index 336a2a14285f..dd562cc41b95 100644
--- a/tools/testing/selftests/net/ovpn/common.sh
+++ b/tools/testing/selftests/net/ovpn/common.sh
@@ -15,7 +15,8 @@ SYMMETRIC_ID=${SYMMETRIC_ID:-0}
export ID_OFFSET=$(( 9 * (SYMMETRIC_ID == 0) ))
-JQ_FILTER='map(select(.msg.peer | has("remote-ipv6") | not)) |
+JQ_FILTER='map(if type == "array" then .[] else . end) |
+ map(select(.msg.peer | has("remote-ipv6") | not)) |
map(del(.msg.ifindex)) | sort_by(.msg.peer.id)[]'
LAN_IP="11.11.11.11"
--
2.52.0
next prev parent reply other threads:[~2026-04-12 22:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-12 22:11 [PATCH net-next 0/5] pull request: ovpn 2026-04-13 Antonio Quartulli
2026-04-12 22:11 ` [PATCH net-next 1/5] selftests: ovpn: add nftables config dependencies for test-mark Antonio Quartulli
2026-04-12 22:11 ` [PATCH net-next 2/5] selftests: ovpn: fail notification check on mismatch Antonio Quartulli
2026-04-14 0:00 ` Jakub Kicinski
2026-04-14 9:01 ` Antonio Quartulli
2026-04-12 22:11 ` Antonio Quartulli [this message]
2026-04-12 22:11 ` [PATCH net-next 4/5] selftests: ovpn: add namespace to helpers and shared variables Antonio Quartulli
2026-04-12 22:11 ` [PATCH net-next 5/5] selftests: ovpn: align command flow with TAP Antonio Quartulli
2026-04-13 23:56 ` Jakub Kicinski
2026-04-14 9:02 ` Antonio Quartulli
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=20260412221121.410365-4-antonio@openvpn.net \
--to=antonio@openvpn.net \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ralf@mandelbit.com \
--cc=sd@queasysnail.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox