From: no-reply@sashiko.virtuozzo.com
To: khorenko@virtuozzo.com, Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v3 1/1] selftests: drv-net-hw: skip the tests that need a real interface
Date: Tue, 6 Oct 2026 22:31:25 +0000 [thread overview]
Message-ID: <010701a11357d2e8-4e7482c4-5fc4-40b2-9b9a-60f27a75d3d6-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261006222651.2510417-2-eva.kurchatova@virtuozzo.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] selftests: skip_on_veth() ignores NETIF_FIND_DRIVER and falsely skips on real NICs
--
commit 6f44dc091649c1067eaf65154f6f0a7b79b13a25
Author: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
selftests: drv-net-hw: skip the tests that need a real interface
This adds a skip_on_veth() helper that runs before lib.sh is sourced. It is
called from the ethtool, ethtool_extended_state, ethtool_rmon, hw_stats_l3
and hw_stats_l3_gre tests. It exits with ksft_skip when the first interface
is a veth, or when it does not exist and lib.sh would create it as a veth.
Link: https://virtuozzo.atlassian.net/browse/VSTOR-139651
> diff --git a/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh b/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh
> new file mode 100644
> index 0000000000000..aa2bb98dc2786
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh
[ ... ]
> +# Call before sourcing lib.sh, exiting after it leaves the veth pair behind
> +skip_on_veth()
> +{
> + # lib.sh takes the interfaces from the command line ahead of the config
> + local p1=${1:-${NETIFS[p1]-}}
> + local kind
> +
> + if [[ -n $p1 ]] && ip link show dev "$p1" &> /dev/null; then
> + kind=$(ip -j -d link show dev "$p1" | jq -r '.[].linkinfo.info_kind')
> + [[ $kind == veth ]] || return
> + elif [[ $NETIF_CREATE != yes || $NETIF_TYPE != veth ]]; then
> + return
> + fi
> + echo "SKIP: needs a real interface, set NETIFS in forwarding.config"
> + exit 4 # ksft_skip, lib.sh is not sourced yet
> +}
[Severity: Medium]
Can skip_on_veth() skip a test that would have run on real interfaces?
When NETIF_FIND_DRIVER is set in the environment and neither a command
line interface nor NETIFS[p1] is given, p1 is empty in skip_on_veth().
The first branch is not taken. NETIF_CREATE and NETIF_TYPE are still at
their defaults (yes and veth), so the elif condition is false. The
function then falls through to the echo and exit 4.
lib.sh handles this case later, in net/forwarding/lib.sh:
if [[ $NETIF_FIND_DRIVER ]]; then
unset NETIFS
declare -A NETIFS
netif_find_driver
fi
netif_find_driver() fills NETIFS from real devices matched by driver name.
skip_on_veth() runs before lib.sh is sourced and never looks at
NETIF_FIND_DRIVER. Other selftests already set it, for example
drivers/net/virtio_net/virtio_net_common.sh sets
NETIF_FIND_DRIVER="virtio_net".
Without this patch the test would have run on the discovered hardware.
With it, the test is reported as SKIP.
The commit message says the check takes the interfaces "the way lib.sh
does, from the command line or forwarding.config". Is that accurate,
given that the NETIF_FIND_DRIVER path is not covered?
Also, only p1 is inspected. If p1 is a real interface and p2 is missing,
lib.sh would still create a veth for p2. Can skip_on_veth() handle that
case too?
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261006222651.2510417-1-eva.kurchatova@virtuozzo.com?part=1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
prev parent reply other threads:[~2026-10-06 22:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 22:26 [Devel] [PATCH hci-8.1 v3 0/1] " Eva Kurchatova
2026-10-06 22:26 ` [Devel] [PATCH hci-8.1 v3 1/1] " Eva Kurchatova
2026-10-06 22:31 ` no-reply [this message]
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=010701a11357d2e8-4e7482c4-5fc4-40b2-9b9a-60f27a75d3d6-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=devel@openvz.org \
--cc=eva.kurchatova@virtuozzo.com \
--cc=khorenko@virtuozzo.com \
/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.