net:icmp.sh in ubuntu_kernel_selftests failed on J-kvm due to leftover ns1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
New
|
Undecided
|
Roxana Nicolescu |
Bug Description
Issue found on J-kvm 5.15.0-1029.34
Test failed because of the leftover /run/netns/ns1 from another test
Running 'make run_tests -C net TEST_PROGS=icmp.sh TEST_GEN_PROGS='' TEST_CUSTOM_
make: Entering directory '/home/
make --no-builtin-rules ARCH=x86 -C ../../../.. headers_install
make[1]: Entering directory '/home/
INSTALL ./usr/include
make[1]: Leaving directory '/home/
TAP version 13
1..1
# selftests: net: icmp.sh
# Cannot create namespace file "/run/netns/ns1": File exists
# FAIL - got ICMP response from , should be 192.0.0.8
not ok 1 selftests: net: icmp.sh # exit=1
make: Leaving directory '/home/
It looks like this came from the fib_tests.sh
Which seems to be updated in this cycle, the test output is different.
In 5.15.0-1029.34
$ sudo ./fib_tests.sh
Single path route test
Start point
TEST: IPv4 fibmatch [ OK ]
TEST: IPv6 fibmatch [ OK ]
Nexthop device deleted
TEST: IPv4 fibmatch - no route [ OK ]
TEST: IPv6 fibmatch - no route [ OK ]
Multipath route test
Error: Multipath support not enabled in kernel.
In 5.15.0-1028.33
Running 'make run_tests -C net TEST_PROGS=
make: Entering directory '/home/
make --no-builtin-rules ARCH=x86 -C ../../../.. headers_install
make[1]: Entering directory '/home/
INSTALL ./usr/include
make[1]: Leaving directory '/home/
TAP version 13
1..1
# selftests: net: fib_tests.sh
#
# Single path route test
# Error: Unknown device type.
not ok 1 selftests: net: fib_tests.sh # exit=2
make: Leaving directory '/home/
This icmp.sh test is OK if you run it manually. Thus I won't call it a regression.
Changed in ubuntu-kernel-tests: | |
assignee: | nobody → Roxana Nicolescu (roxanan) |
Your observations are correct. Thanks for pointing me to the right direction. IP_ROUTE_ MULTIPATH is not enabled for kvm. Not sure if this is intentional or not, I will have to double check.
fib_test.sh fails at Multipath route test when command
ip -netns ns1 route add 203.0.113.0/24 nexthop via 198.51.100.2 dev dummy0 nexthop via 192.0.2.2 dev dummy1 is executed. This fails because CONFIG_
Right before, in fib_test.sh they use set -e which will cause an exit if one of the commands fails.
Because nobody calls cleanup function where namespace ns1 is deleted when the next test tries to create this namespace it will fail.
Regardless of the actual root cause of why multipath is not enabled, even if that test fails, the test should always cleanup before exit.
I suggest removing set -e and checking the return code of each command everywhere. The problem though is that this is used in multiple places, so I am not sure why this was chosen in the first place.
I am curious to see other opinions on this.