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

From: Andrea Mayer

Date: Sun Nov 29 2026 - 22:48:28 EST


On Thu, 26 Nov 2026 14:27:25 +0800
Hangbin Liu <hangbin.liu@xxxxxxxxx> wrote:

Hi Hangbin,

> From: Hangbin Liu <liuhangbin@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> [snip]
> @@ -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}"

Nit, a style preference: "${ret}" and "${ksft_fail}", as for the
other variables here.

Thanks,
Andrea