From: Jakub Kicinski <kuba@kernel.org>
To: antonio@openvpn.net
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, ralf@mandelbit.com, sd@queasysnail.net,
pabeni@redhat.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com
Subject: Re: [PATCH net-next 5/5] selftests: ovpn: align command flow with TAP
Date: Mon, 13 Apr 2026 16:56:08 -0700 [thread overview]
Message-ID: <20260413235608.3699773-2-kuba@kernel.org> (raw)
In-Reply-To: <20260412221121.410365-6-antonio@openvpn.net>
This is an AI-generated review of your patch. The human sending this
email says: "The second one looks legit, would you prefer to follow
up or respin?"
---
selftests: ovpn: align command flow with TAP
This commit restructures the ovpn selftests to use the TAP infrastructure,
splitting each test into stages with KTAP output, adding command wrappers,
and centralizing behavior control in common.sh.
> diff --git a/tools/testing/selftests/net/ovpn/common.sh b/tools/testing/selftests/net/ovpn/common.sh
> index 2b3f2e5c8cc9d..ec6fea37ceb39 100644
> --- a/tools/testing/selftests/net/ovpn/common.sh
> +++ b/tools/testing/selftests/net/ovpn/common.sh
[ ... ]
> @@ -152,8 +263,8 @@ ovpn_compare_ntfs() {
> received="${OVPN_TMP_JSONS[$1]}"
> diff_file=$(mktemp)
>
> - kill -TERM ${OVPN_LISTENER_PIDS[$1]} || true
> - wait ${OVPN_LISTENER_PIDS[$1]} || true
> + kill -TERM ${OVPN_LISTENER_PIDS[$1]} 2>/dev/null || true
> + wait ${OVPN_LISTENER_PIDS[$1]} 2>/dev/null || true
> printf "Checking notifications for peer ${1}... "
Does this leave the reaped PID in OVPN_LISTENER_PIDS?
Later, ovpn_cleanup() calls ovpn_stop_listener() which iterates over the
array and issues another kill -TERM on the same PID. Since the process was
already reaped by the wait here, could the OS recycle the PID, potentially
causing the second kill to terminate an unrelated system process?
[ ... ]
> +ovpn_cleanup_peer_ns() {
> + local peer="$1"
> +
> + if ! ip netns list | grep -qx "${peer}"; then
> + return 0
> + fi
Can this fail to match and permanently leak network namespaces?
When virtual interfaces are moved into namespaces during setup, ip netns list
often includes an internal ID in its output, such as:
peer0 (id: 0)
Because grep is using the -x flag to enforce an exact whole-line match,
it appears this will fail to match peer0 and return early, skipping the
subsequent namespace deletion.
[ ... ]
> diff --git a/tools/testing/selftests/net/ovpn/test-close-socket.sh b/tools/testing/selftests/net/ovpn/test-close-socket.sh
> index 4f0367c60fdaf..e97affe727383 100755
> --- a/tools/testing/selftests/net/ovpn/test-close-socket.sh
> +++ b/tools/testing/selftests/net/ovpn/test-close-socket.sh
> @@ -9,37 +9,72 @@ set -e
>
> source ./common.sh
Is test-close-socket.sh missing the set -eE flag and the ovpn_stage_err
ERR trap?
The other test scripts were updated to use set -eE and register the trap,
which handles emitting the KTAP failure directive. If a command fails here,
will set -e cause the script to exit immediately and bypass the KTAP
failure reporting entirely?
next prev parent reply other threads:[~2026-04-13 23:56 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 ` [PATCH net-next 3/5] selftests: ovpn: flatten slurped notification JSON before filtering Antonio Quartulli
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 [this message]
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=20260413235608.3699773-2-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=antonio@openvpn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--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