]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests: ovpn: flatten slurped notification JSON before filtering
authorRalf Lici <ralf@mandelbit.com>
Tue, 24 Mar 2026 14:54:18 +0000 (15:54 +0100)
committerAntonio Quartulli <antonio@openvpn.net>
Fri, 17 Apr 2026 08:54:03 +0000 (10:54 +0200)
commit222e7f8d1ca3aaebe7588a79bf64d9820813785c
tree4d4e39f88fcbd94aa9dfeccd522635179d7bf520
parentc409da0fe15e2b2aae7f93edbab977e23117ce4d
selftests: ovpn: flatten slurped notification JSON before filtering

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.

Fixes: 77de28cd7cf1 ("selftests: ovpn: add notification parsing and matching")
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
tools/testing/selftests/net/ovpn/common.sh