🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22912

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

#22912
From: Hangbin Liu
Date: Thu, 26 Nov 2026 06:27
89 lines
11171 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..250de54d8bfa 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: <20261126-srv6_flavors_endx-v5-3-4d8232eec404@kylinos.cn>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371892-linux-kernel-netdev=dewy.ru
References: <20261126-srv6_flavors_endx-v5-0-4d8232eec404@kylinos.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371892-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v5 3/5] selftests: seg6: move SRv6 End PSP setup
 into its own helper
Date: Thu, 26 Nov 2026 14:27:25 +0800
Organization: Usenet Network
Message-ID: <20261126-srv6_flavors_endx-v5-3-4d8232eec404@kylinos.cn>
References: <20261126-srv6_flavors_endx-v5-0-4d8232eec404@kylinos.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="398294"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:M8sIAtBOqLXJpYQYxDSqBMndjVs= sha256:w5v7l2kpiwQGwURqSUaXy8SI+Wmw+ddl6+l40Cyqdf8=
	sha1:7484Ny40cRkVQJTK8t9fOorbDgA= sha256:wru1by23KDYhdy2nuaychqIQ/iLzmVg9TZgwNWlkvY8=
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 6E66D125EB3; Thu, 26 Nov 2026 09:28:33 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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] 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 sTuM2Isx6qkm;
	Thu, 26 Nov 2026 09:28:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-371892-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 40C1D125EB0; Thu, 26 Nov 2026 09:28:22 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 0832B44608; Thu, 26 Nov 2026 06:28:06 +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=1795674481;
	b=LtG13AcNLVajmRue877/MmAZ++kVfhHwpZWiNe36/7PSZ9tG0P0ikntgV3xd+3BOUEB9
	 AYUk/SD3rTHtgJSE6mBm+ewkYowGpQP0D+VgvALq8ob+LECXXk3SMWZotYo2O/w2ufG8z
	 i7+09ryUQ21tIc+0Yu9FepSnJvMB1sMQADbSOEpRI82OjkKzzzdx3ztqqb4hYHnT/kHls
	 I2EKltdplqGVNxluhhneDjffrdyElaGkkHpX414m1v08tXjQBxm6fcQL3nMGDFK0h9/1F
	 +Bj4Hn5hMKS2VSjz1GWaFd7W8OcyM6VBz8z8/Rdio5qBGqxa38TqFFjA13Kk1bqG4aw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795674481;
	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=Rq5hjTMUOxTwh0rZFU/mRxB1f9bGG4ADRGubV6JiU0I=;
	b=C1OSjjPef6Su/WL71xlz5UA0PdnFjFzD6GXqVSUDXprnvC4mLMUvoo9RsV5ttriyl90U
	 Y36W+VsxZUvjIs3ft9znWtrjxU1ICva+J4HdmV9fO3JEbXjLMm1Pfe1/Owlsmhk2paXUS
	 vNi0qJuupdnfvFisLF0gi3XT2LQ0IE8qvowiFmKFTYs+IMwMQyC4EK9m0Pd5K2mD072yX
	 upfD5f8gdlaCXgtieyB5ypKa2bAKxRZsDCuYI/QWdB9NT/whxq8ypd2Dx8iETtfqDphoO
	 ZG0iZensUuyo1ooASJeYS08RAL+49VdHJAP2ZjVAlIepRtvEOL7OA2tY1OVHh7gGLQA==
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=p+qpYNtu;
	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 B2105606A323;
	Thu, 26 Nov 2026 06:28:01 +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=p+qpYNtu
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.35
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795674480;
	b=EuT0GM7AekkJ+aZUA0nwCDbQ4h0SiiTvqncKCPhnC6cudVkqH5XFrL9SaUdVodttWFUs
	 QLlwxNhuPYlNPVRrDIgeY5AJOkVeujI0uhIjwQqfiv/6jeytcwlhO6v3k8PN/5UIFoNkH
	 oDQ2xEuHZbMDuLh3X8LP8Arja/FUzp1bp9MRXX4j+HZSL1Mc0ribYPVWJPnvNO2gbsYAU
	 Oiz9yri7GIGgvCsZcs5af60OgD7kVNrJkdMoCKXI6KQX0+nOQu4m3wI66Np51sK3MOb0L
	 f7x54ZdD5NDfBM8ApkdIenyNObnuTR0XxlAakNENduF2OKW2Uaip+zWpi37+FNkwgvw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795674480;
	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=Rq5hjTMUOxTwh0rZFU/mRxB1f9bGG4ADRGubV6JiU0I=;
	b=bgN9GU6SprAjPtg95GOSCcjpmKOTJL+gCvCUkVghQjkdTky7nAq/nOhhaPG0wpMeNrhM
	 ZPOFfgn0AVZUpOa3FAraBsEmvDIMPta/DItjXUTdsAhQ2Y7FGSucpIkngfJlandkCzazU
	 5HykblvgTKmP+JRrq3IFBUVdI7M8EKCSA2n+POQwdR6Lok9wXZKalOfsKj+cESz2bDA7R
	 YlqXagXeURlnSuZUU9p/puutJPS0OKrD4HRmivdPQ20cj0sIc3sXG4A3xmfdZuXzxJwrW
	 25D22OIQ4ZAjxswO29E74KmYLL1sdNdM03+g8NCZcHb9TW9wq6frQ3T7QdugQ5MgpiA==
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=p+qpYNtu;
	arc=none smtp.remote-ip=91.218.175.35
X-Received: from mta0.migadu.com (out-35.mta0.migadu.com [91.218.175.35])
	(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 3FAC9606A337
	for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 06:27:59 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3FAC9606A337
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=8PAih41MhEPrK1cLXfnULSCqvu5Gn8W6x6ap1W4NSUQ=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1795674478; v=1; x=1796279278;
 b=p+qpYNtukT7xWK/TX1FvQ8KkAMQJm3dbs1H+AuXovLr4qufLRHSpEQU7paRwcdHityP2pYlX
 8NrAIWsrDTRBqgptLPCoV+90ooUGeYI3VlD9kVF3wSjRO3bItDEI2Fuy8n2giB5Ul6m1vfhTQZ+
 SsVAWZLqllJv4y4cmS9kIt70=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta12.migadu.com with ESMTPS id f48ba12d9e260872;
	Thu, 26 Nov 2026 06:27:58 +0000
X-Mizu-Trace-ID: f48ba12d9e260872
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: <20261126-srv6_flavors_endx-v5-0-4d8232eec404@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