lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260120230208.328337-2-aleksey.oladko@virtuozzo.com>
Date: Tue, 20 Jan 2026 23:02:03 +0000
From: Aleksei Oladko <aleksey.oladko@...tuozzo.com>
To: "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
        Shuah Khan <shuah@...nel.org>, Petr Machata <petrm@...dia.com>,
        Nikolay Aleksandrov <razor@...ckwall.org>
Cc: netdev@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Aleksei Oladko <aleksey.oladko@...tuozzo.com>
Subject: [PATCH 1/6] selftests: forwarding: lib: skip test if team driver is not supported

Some kselftests rely on teamd to create LAG devices. If the kernel is
built without CONFIG_NET_TEAM, the teamd command fails with:
Failed: Operation not supported

Currently, the exit code of teamd is not properly checked, causing
the test to proceed and eventually fail instead of being skipped.

Add a check for the teamd exit code, mark the test as skipped
to avoid self-positive failures.

Signed-off-by: Aleksei Oladko <aleksey.oladko@...tuozzo.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index a9034f0bb58b..0a474b02371d 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -771,9 +771,21 @@ team_create()
 {
 	local if_name=$1; shift
 	local mode=$1; shift
+	local output
+	local status
 
 	require_command $TEAMD
-	$TEAMD -t $if_name -d -c '{"runner": {"name": "'$mode'"}}'
+	output=$($TEAMD -t $if_name -d -c '{"runner": {"name": "'$mode'"}}' 2>&1)
+	status=$?
+
+	if [ $status -ne 0 ]; then
+		if echo "$output" | grep -q "Operation not supported"; then
+			exit $ksft_skip
+		else
+			exit 1
+		fi
+	fi
+
 	for slave in "$@"; do
 		ip link set dev $slave down
 		ip link set dev $slave master $if_name
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ