Re: [PATCH net] selftest/net: skip srv6_end_d[t/x][4/6]_*_test.sh if iproute2 too old

From: Alessio Faina

Date: Fri Aug 28 2026 - 12:05:17 EST


On Fri, Aug 28, 2026 at 04:23:57AM +0200, Andrea Mayer wrote:
> On Thu, 27 Aug 2026 11:56:09 +0200
> Alessio Faina <alessio.faina@xxxxxxxxxxxxx> wrote:
>
> > [snip]
> >
> > For the DX tests I was doing a local test but it's not in the original
> > kernel, sorry, I must have confused 2 tasks with one, so disregard the
> > DX4 and DX6 tests, they are not relevant to this issue; if we manage to
> > agree on a solution for the DT4 and DT6 tests, I will discard those
> > modification in a subsequent patch.
>
> Ok, so this is about the dt4 and dt6 tests only.
>
> > About the DT4 and DT6 tests, I thought to use the same method as the failure
> > was practically the same as End.DT46.
> > This is the version I'm currently using
> > ip utility, iproute2-ss200127 (should be 5.5.0 if I'm not mistaken)
> > and I can confirm
> > [SEG6_LOCAL_ACTION_END_DT4] = "End.DT4"
> > [SEG6_LOCAL_ACTION_END_DT6] = "End.DT6",
> > is available.
> >
> > What do you suggest would be the right way forward to check what is
> > going on?
>
> These tests need the vrftable attribute. The help does not list it
> before v5.14.0, while ip parses it from v5.11.0, so a help check skips
> tests that would run on v5.11.0, v5.12.0 and v5.13.0.
> One possible way could be to try the route add in a throwaway netns and
> skip the selftest if that fails. test_encap_lookup_supp_or_ksft_skip() in
> srv6_encap_lookup_l3vpn_test.sh could provide the general idea, but here
> the netns also needs the vrf device and the strict mode the test sets up.
>
> That's more code than a help check, but it skips when the route really
> cannot be installed. There is a trade-off to consider, and comments or
> other ideas are very welcome.
>
> Ciao,
> Andrea

Hi andrea,

I tried multiple methods:
the first approach is yours, but I can see the following error with any iproute2
version I'm using (I tried 5.5 to 5.18): when running
"ip -netns ${rtdst_name}" command, it always returns

RTNETLINK answers: File exists
2

I tried the following approach as well,

# set the decap route for decapsulating packets which arrive from
# the rtdst router and destined to the hsdst host.
- ip -netns ${rtdst_name} -6 route add ${vpn_sid}/128 table ${LOCALSID_TABLE_ID} \
- encap seg6local action End.DT4 vrftable ${tid} dev vrf-${tid}
+ if ! ip -netns ${rtdst_name} -6 route add ${vpn_sid}/128 table ${LOCALSID_TABLE_ID} \
+ encap seg6local action End.DT4 vrftable ${tid} dev vrf-${tid} 2>/dev/null; then
+ echo "SKIP: SRv6 End.DT4 vrftable not supported in iproute2"
+ cleanup
+ exit "${ksft_skip}"
+ fi

where the test is checked at vrftable creation time, and it would
cleanup and exit as expected from standard tests.

But obviously this gets the same RTNETLINK answer as an error.

Then another approach came to my mind, and it seems to be quite reliable.
Practically checking if the ip command contains the string "vrftable"
using the "strings" command, and if not, skip the test.

Something like this:

+test_iproute2_vrftable_supp_or_ksft_skip()
+{
+ if ! strings $(command -v ip) | grep -q "vrftable"; then
+ echo "SKIP: SRv6 End.DT4 vrftable not supported in iproute2"
+ exit "${ksft_skip}"
+ fi
+}
+

What do you think about it?

Kind regards,

-Alessio Faina