All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v4 1/1] selftests: drv-net-hw: skip the tests that need a real interface
Date: Thu, 22 Oct 2026 19:23:36 +0200	[thread overview]
Message-ID: <179268981633.4087303.18375278409515971169.b4-review@b4> (raw)
In-Reply-To: <20261007145044.2647274-2-eva.kurchatova@virtuozzo.com>

> +# lib.sh reads NETIF_FIND_DRIVER before forwarding.config: the environment only
> +find_driver=${NETIF_FIND_DRIVER-}

True for lib.sh alone, not with this helper ahead of it: the helper
sources forwarding.config into the same shell, so lib.sh then sees a
NETIF_FIND_DRIVER set there and picks the ports by driver. The helper
ignores it, takes veth0 and skips a test lib.sh would run on hardware.

The reverse is off too. lib.sh sources forwarding.config after
netif_find_driver(), and NETIFS=(...) there replaces what the driver
found. The early return below trusts the driver and hands lib.sh a
config full of veths.

lib.sh's order is command line, config NETIFS, driver, veth defaults.
Follow it:

diff --git a/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh b/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh
--- a/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh
+++ b/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh
@@ -5,9 +5,6 @@
 
 forwarding_dir="$lib_dir"/../../../net/forwarding
 
-# lib.sh reads NETIF_FIND_DRIVER before forwarding.config: the environment only
-find_driver=${NETIF_FIND_DRIVER-}
-
 # forwarding.config assigns by name into the array lib.sh declares
 declare -A NETIFS
 
@@ -23,14 +20,13 @@ fi
 # found the way lib.sh finds it: keep in step with lib.sh.
 skip_on_veth()
 {
-	# lib.sh takes the interfaces from the command line ahead of anything
-	local p1=${1:-}
+	# lib.sh takes the command line, then forwarding.config, then the driver
+	local p1=${1:-${NETIFS[p1]-}}
 	local kind
 
-	# Otherwise with NETIF_FIND_DRIVER it takes those of that driver, and
-	# skips by itself when it finds none
-	[[ -z $p1 && -n $find_driver ]] && return
-	p1=${p1:-${NETIFS[p1]-veth0}}
+	# lib.sh skips by itself when the driver has no interfaces
+	[[ -z $p1 && -n $NETIF_FIND_DRIVER ]] && return
+	p1=${p1:-veth0}
 	if ip link show dev "$p1" &> /dev/null; then
 		kind=$(ip -j -d link show dev "$p1" | jq -r '.[].linkinfo.info_kind')
 	elif [[ $NETIF_CREATE == yes && $NETIF_TYPE == veth ]]; then

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

      parent reply	other threads:[~2026-10-22 17:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 14:50 [Devel] [PATCH hci-8.1 v4 0/1] " Eva Kurchatova
2026-10-07 14:50 ` [Devel] [PATCH hci-8.1 v4 1/1] selftests: " Eva Kurchatova
2026-10-07 14:55   ` no-reply
2026-10-22 17:23   ` Konstantin Khorenko [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=179268981633.4087303.18375278409515971169.b4-review@b4 \
    --to=khorenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=eva.kurchatova@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.