Article View: linux.kernel.netdev
Article #19178[PATCH net-next v4 3/5] selftests: seg6: move SRv6 End PSP setup into its own helper
From: Hangbin Liu
Date: Thu, 19 Nov 2026 13:55
Date: Thu, 19 Nov 2026 13:55
89 lines
11203 bytes
11203 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:
<20261119-srv6_flavors_endx-v4-3-284cdb484eee@kylinos.cn>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367051-linux-kernel-netdev=dewy.ruReferences:
<20261119-srv6_flavors_endx-v4-0-284cdb484eee@kylinos.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367051-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v4 3/5] selftests: seg6: move SRv6 End PSP setup into its own helper Date: Thu, 19 Nov 2026 21:55:19 +0800 Organization: Usenet Network Message-ID: <20261119-srv6_flavors_endx-v4-3-284cdb484eee@kylinos.cn> References: <20261119-srv6_flavors_endx-v4-0-284cdb484eee@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2886709"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:S8a0F24s6N1MHvhcHY+tqKfT26A= sha256:C4/JC1a7K+1Hb1YbHuXIpTN9CXRSDsJiDSfMH5yn1q4= sha1:bn0xNz/wMuIgBJ704EYqADwdQbU= sha256:zNFk4ENfeYfPBuoXdj16op/XztVGImnckW1dGygNISg= 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 A195411567D; Thu, 19 Nov 2026 16:56:33 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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, 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 WcJbRxFTetIt; Thu, 19 Nov 2026 16:56:30 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-367051-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id DC29D11567B; Thu, 19 Nov 2026 16:56:21 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 5892B165385; Thu, 19 Nov 2026 13:56:16 +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=1795096574; b=kc3Fyz0+PgV5xlNqXCj78MfYpHuKwZkSiIOEqsb5dAFuVoqSHTI1Qbt/aa6kaRWj2S27 wS8YlKxP7m9lYlmZGRL46u4K3fTtRhhCJuRuUwv3zWcPWN03zK5xpU/wqvIzZk1oBDdLT GJy4x1qLLAn7GAmAiKq5/GTARhigAONh5zJqj6ZHE89QYtAk0yrHQ/bjnrLLroyJD0F9S eBHsNf0Cearvta2DHXhegep6lUAP3hOZkauzOfvSpJs4MIy8qXrL+dviRoanR9mQMFCfe lMVKQrsod4yW41QdO8zgP58kX4q+dGFmbR98vNOTUx2iNPIkGn5PKi/ZRuKIRVC+DyQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795096574; 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=kPmHUt+HOLTiIkZh/IVQGCe9eOSsGdBzcRXwsIb6oWfWJ3F+/M/B8B982cuPDS9cV4Fa 4bYiUYAmbOC68Ekk2pfqu3o2WhvvFfN+lScNezSrHhKOYdgk3Z/U3+ZLzcVA8jsM2axlh ALt0o1pK1nMdKvoshPDXEW5oV89sLK7tNfKcjLpcHT80+WdMXCgYuJMd0Gidd7XAKH5e7 aI9VQ4gzOV43G17U2CRfn5eKEQtmS2ufO4V1M76tusqF8nEEeTxJK3PYLF0HtZrn7b6VL +fUHjxcGDBzCsIHpnZRyORpo2HtHsBEWX3G/KVZ8RgXdiednDejYdC83JBkvm/7Pdaw== 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=LCnzlOvw; 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 D7B94606A33A; Thu, 19 Nov 2026 13:56:14 +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=LCnzlOvw X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.126 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795096574; b=H3ebZjm9ZbWO4/693DVCgynX2quR58RdThEFTMzmGIyWNMc144bOfnO60XB98yuZv2Ud 9c38qqip7h3nlK6mziw+W/VL+KjSDWBxBRspfxhFBwDUM3QqC8NmZUIuugZ7WLePlCYx3 JOISAQL314j1+WQr8nLKqZA3+J5lOyVc8ucgOCWBHbGvdJiD/BOxsHDBc5KvtJQF3rQnL dMzuEDw7r6ZPahpr6DWpl50QsYUIm2D2fe9ny9wkzy0QjRTFs1l0lLF4rFfBjRwXNHJU1 wi8OiieS8IVQ5ZsWdHMZ/bdb2xgFUSQtzsn7AWY4RXkWPG0hCspKm6OqZPN3ocTrn7w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795096574; 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=M0URu/E6NlEdgleRmvi+lzuDNRpQAhUuAS+h2JMydpei0zEaReSSeNSPBeVVwR1wb6mm qIQpcy87BVdAz+xcM7NZsT/cq1y402wfr9Jp0MHlS8VSc3N3feWrWIpaC7iqIhEmj20Cr pVa2xVXZkurQapX5MYoDaQL7VrXz+1TSSu0me2e8xHsnns+iy2QJlirGL62cWq2o8Bn3z Y9qkjbuwvX0Xkb15zgxkF0wsNDtA4KkQFo6jnJOLLabJDx6zqad7ba7cdbPyftuTiKzdJ LbfeWF5ScJ4wHJ9OSGW7Hi2zgSJP2vTUVwBPq6DunLysrgnIoagM/MnWu7lSBUvK3ow== 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=LCnzlOvw; arc=none smtp.remote-ip=95.215.58.126 X-Received: from mta1.migadu.com (out-126.mta1.migadu.com [95.215.58.126]) (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 DA108606A320 for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 13:56:12 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DA108606A320 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=1795096571; v=1; x=1795701371; b=LCnzlOvwCH5/81KYLFQfrnyLuvpqbXXgUXvB00Ud0ToorgPICy4k6iPa6wkJeNr7GtQWPenr AQzKBBOGQxJMTksr3yChF5WM7pCW6h4EVeV6tOO4o3r2mWw7Gww0eBqzUTD3L0AqtaJXwp51YC2 JxuDoUgFmSynlaCm0fN0AcG8= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id f10e56e4a88febcd; Thu, 19 Nov 2026 13:56:10 +0000 X-Mizu-Trace-ID: f10e56e4a88febcd 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: <20261119-srv6_flavors_endx-v4-0-284cdb484eee@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 <liuhangbin@kylinos.cn> X-Mailer: b4 0.16.0