🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25673

[PATCH net-next v6 3/6] selftests: seg6: move SRv6 End PSP setup into its own helper

#25673
From: Hangbin Liu
Date: Wed, 02 Dec 2026 08:46
89 lines
11239 bytes
From: Hangbin Liu <liuhangbin@kylinos.cn>

setup() installs both the base topology and the End PSP policies. That
couples general test setup with one specific flavor scenario and makes
it hard to add further flavor cases cleanly.

Extract the End PSP policy setup into setup_end_flv_psp() so flavor
tests can set up and later tear down independently (the matching
cleanup arrives in a following patch).

Run the block under set -e so a setup failure is treated as an error
instead of falling through into the connectivity checks. When deciding
to report the run as skipped, keep any failure already recorded by a
test, so a real failure is not converted into a skip.

Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
 .../testing/selftests/net/srv6_end_flavors_test.sh | 33 ++++++++++++++++------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/net/srv6_end_flavors_test.sh b/tools/testing/selftests/net/srv6_end_flavors_test.sh
index 157baa8ecb0b..35ac88a1e6cb 100755
--- a/tools/testing/selftests/net/srv6_end_flavors_test.sh
+++ b/tools/testing/selftests/net/srv6_end_flavors_test.sh
@@ -488,10 +488,15 @@ cleanup()
 
 	# check whether the setup phase was completed successfully or not. In
 	# case of an error during the setup phase of the testing environment,
-	# the selftest is considered as "skipped".
+	# the selftest is considered as "skipped", unless a test has already
+	# recorded a failure.
 	if [ "${SETUP_ERR}" -ne 0 ]; then
-		echo "SKIP: Setting up the testing environment failed"
-		exit "${ksft_skip}"
+		if [ "${ret}" -ne "${ksft_fail}" ]; then
+			echo "SKIP: Setting up the testing environment failed"
+			exit "${ksft_skip}"
+		fi
+
+		echo "FAIL: Setting up the testing environment failed"
 	fi
 
 	exit "${ret}"
@@ -962,17 +967,25 @@ setup()
 	setup_hs 1 1
 	setup_hs 2 2
 
-	# set up the loopback addresses of the hosts used by the Policies (i.c)
-	# and (i.d).
-	setup_hs_lo_addr 1 1 "${END_CSID_PSP_FUNC}"
-	setup_hs_lo_addr 2 2 "${END_CSID_PSP_FUNC}"
-
 	# set up default SRv6 Endpoints (i.e. SRv6 End behavior)
 	setup_rt_local_sids 1 "2 3 4"
 	setup_rt_local_sids 2 "1 3 4"
 	setup_rt_local_sids 3 "1 2 4"
 	setup_rt_local_sids 4 "1 2 3"
 
+	# testing environment was set up successfully
+	SETUP_ERR=0
+}
+
+setup_end_flv_psp()
+{
+	SETUP_ERR=1
+
+	# set up the loopback addresses of the hosts used by the Policies (i.c)
+	# and (i.d).
+	setup_hs_lo_addr 1 1 "${END_CSID_PSP_FUNC}"
+	setup_hs_lo_addr 2 2 "${END_CSID_PSP_FUNC}"
+
 	# set up SRv6 policies
 	# create a connection between hosts hs-1 and hs-2.
 	# The path between hs-1 and hs-2 traverses SRv6 aware routers.
@@ -1429,6 +1442,10 @@ set +e
 
 router_tests
 host2gateway_tests
+
+set -e
+setup_end_flv_psp
+set +e
 host_srv6_end_flv_psp_tests
 host_srv6_end_flv_next_csid_psp_tests
 host_srv6_end_flv_consumed_srh_tests

-- 
2.56.0
Technical Details
Message-ID: <20261202-srv6_flavors_endx-v6-3-4e50b828e702@kylinos.cn>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375647-linux-kernel-netdev=dewy.ru
References: <20261202-srv6_flavors_endx-v6-0-4e50b828e702@kylinos.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375647-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v6 3/6] selftests: seg6: move SRv6 End PSP setup
 into its own helper
Date: Wed, 02 Dec 2026 16:46:29 +0800
Organization: Usenet Network
Message-ID: <20261202-srv6_flavors_endx-v6-3-4e50b828e702@kylinos.cn>
References: <20261202-srv6_flavors_endx-v6-0-4e50b828e702@kylinos.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1926493"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jiDlZ85FV2GwEiDh7DIzPG8ScJ0= sha256:oFQWLXpZUETXdJ2s4oH0Q5CzlAiOaBB7QFstykTQsa8=
	sha1:F0Gj5F01d3+415XLZ5z3FJlwwmk= sha256:6dfGLRMo1I14o+a+WEMCUfEWyFwsiVtqzkCpRlHkWxA=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 3A2921175B0; Wed,  2 Dec 2026 11:47:34 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id GUq9uOuGuGbA;
	Wed,  2 Dec 2026 11:47:31 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-375647-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 6BE0011757C; Wed,  2 Dec 2026 11:47:22 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 182C6601A88; Wed,  2 Dec 2026 08:47:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796201238;
	b=BSPRaoOIJmUMVg7qq6dy99zS3r317xVjMIYYtX5ua529xv5NX6rCcwClBOXJzxv/9my5
	 Y+oppTEDwxcQTUrrh3m2zdR45I4CxwV7rTuP7+sWksYH9iF1AEOfcPPmX5gghcj5Bc258
	 7R9YXbkW5PTk5cwWxQrSklpkR8YHjGUEUyDA4pnEswfojK+petLRWwn1WpEsbuDLCbKbH
	 cUt5JgzSA0I37jiRVRNYZ3Eu0CFkmaL9PUkdfIYWcA6fPfE7yrOu7XDwwXD18ybbgyML/
	 8q4f0MkY3oXc1F4BTxCIVkbyNHG5AETAwQlrST4Vnd3ySzRuWZFtFfa9p5cwvJpvWOA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796201238;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:Date:
	 Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
	 X-Mailer;
	bh=A6xkkr5+t/7+ZOpY+ZbKysnRRJFCDEx9LylGKWPpUso=;
	b=sjefoMXDZYv27kMZtnCuO7sJxsrYSZRuh67ObeoRDZmI2IuYyvZH+SAd0gHJUjlJg28Z
	 Tul5bNBiAsN8PdB2oMEoztwfom6A6VcRmuoKjzF1rtNNs4SNIhza+MROw+9L46uJ+pq9S
	 g29Wudq7oRdhvwKGmf1EHBvaF1T9y+SysOSXxsrpANSpjRZMzcPKLFlTzSXF34iOOkS7F
	 +4Uoe+kUgOUySl+Ful8nuCQJnRH64fuV2vWVHmGqMCoTG8uaplNC0oju1i3hUIz/5CgnX
	 H/TeteviR18LbY3Zgs8bUfwulovK3FTbYTaV1xigVfpx0XLTqa4GYj7C6rjEwULlZgg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=eb8hspya;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id AEF6E606A323;
	Wed,  2 Dec 2026 08:47:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=eb8hspya
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.247
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796201237;
	b=UCiyECvbuqrMG/wQysuPCmgbaePsWluLoquN4WUUIuE+pNMxZjb7IhlRja4bEZJSxNMi
	 /gJts0/LuH52NS4Hy5sKv2eKJ9NBq/rC1o74/jy1w7AbztOLeKR8tWboWi5JB9OQpd7zj
	 NqrUZkrFhXnQ5XJkw1N6Slw3CRysCoFevPxopd9mTZMVQsMxZpurTvztimgvWvI+xwi55
	 GhQSG0Eygwrup8KrH/HxwFQTN4fol4f0Cmmk+7TdpRSsDLe7frmjVqybWFQ/Nk+EFji86
	 RzWxLcfwAku0e44jR9phARnobJpSNJ0M1OcBo9Lw7tBxGjEsSeC1UrAouogj1EYB/qg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796201237;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:From:Date:Subject:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Message-Id:References:
	 In-Reply-To:To:Cc:X-Mailer;
	bh=A6xkkr5+t/7+ZOpY+ZbKysnRRJFCDEx9LylGKWPpUso=;
	b=30urz9Xx3s3rgzJ/kSGmcFtcqDXhV1qmPBqg6DoEysPi3SQOzkd4kvjBaC3AzbXd/ecx
	 DCeepHBzxKtu/7uvQKCdrBZ+vdzIPfvDVDgkNf/FGQlTRYzr0+szcT7TmEwe3EixWT3k/
	 1GeglmTd4vPunGbUjfV8sBgxqu3gOb4XdjKP4Hts+Bx9RDxkcaoIzr636T94X7vpPSsQ4
	 4Qf7fScMODw7bNAAY0CIXYrsJfpcA5PtT6JSgGXW+n77LqMQrWrHh7D3lF55MLhKz+fnq
	 v87CS/eHw2LtO0nRi/WG1UcPD1HWG55dpyZQTechI8bIgmVUqgvk29iTyl9lORn3ceA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=eb8hspya;
	arc=none smtp.remote-ip=91.218.175.247
X-Received: from mta0.migadu.com (out-247.mta0.migadu.com [91.218.175.247])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72EC0606A331
	for <netdev@vger.kernel.org>; Wed,  2 Dec 2026 08:47:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 72EC0606A331
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=NUMWxTALBins7pjr+sPhTYOlZg1C16/F6RrPMKS10Qg=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1796201231; v=1; x=1796806031;
 b=eb8hspyaRVtio88qDwJjvPwjX+naPbPCzCzzUZzDfDEIJSZT9Nov5ky71a3vWkMfDNitnnm5
 ULCAzTT9+Kp9w5N3EJ/lFLexn7r05oeOdTYGLPdOIC2C0KLKBHvsd6imZAbOske6ih/z52bkcqE
 5Cmga9zjr5S8zcyfTRVT4kDE=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta12.migadu.com with ESMTPS id daf0edd17db9e885;
	Wed, 02 Dec 2026 08:47:11 +0000
X-Mizu-Trace-ID: daf0edd17db9e885
X-Migadu-Flow: FLOW_OUT
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261202-srv6_flavors_endx-v6-0-4e50b828e702@kylinos.cn>
X-Cc: Hangbin Liu <hangbin.liu@linux.dev>, netdev@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, 
 Hangbin Liu <hangbin.liu@linux.dev>
X-Mailer: b4 0.16.0