Re: BUG: tools/testing/selftests/net/l2_tos_ttl_inherit.sh hangs when selftest restarted

From: Guillaume Nault
Date: Fri Jan 06 2023 - 19:15:38 EST


On Fri, Jan 06, 2023 at 02:44:11AM +0100, Mirsad Goran Todorovac wrote:
> [root@pc-mtodorov linux_torvalds]# tools/testing/selftests/net/l2_tos_ttl_inherit.sh
> ┌────────┬───────┬───────┬──────────────┬──────────────┬───────┬────────┐
> ├────────┼───────┼───────┼──────────────┼──────────────┼───────┼────────┤
> │ Type │ outer | inner │ tos │ ttl │ vlan │ result │
> ├────────┼───────┼───────┼──────────────┼──────────────┼───────┼────────┤
> │ gre │ 4 │ 4 │ inherit 0xc4 │ inherit 116 │ false │Cannot create namespace file "/var/run/netns/testing": File exists
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists

You probably have leftovers from a previous test case. In particular
the "testing" network name space already exists, which prevents the
script from creating it. You can delete it manually with
"ip netns del testing". If this netns is there because of a previous
incomplete run of l2_tos_ttl_inherit.sh, then you'll likely need to
also remove the tunnel interface it created in your current netns
("ip link del tep0").

Ideally this script wouldn't touch the current netns and would clean up
its environment in all cases upon exit. I have a patch almost ready
that does just that.