On 4/28/19 11:53 AM, Alexei Starovoitov wrote: > Adding tests as we go along would immensely help too. > Unfortunately afaik there is no test infra to use for it.
pcpu routes are the predominant ones used for traffic. We have a number of existing tests in selftests - fib_tests.sh - that exercise the code paths touched by this set. That includes their entire life cycle - from FIB entry create, to running traffic or 'ip route get' to cleanup. For the exception code paths selftests has pmtu.sh which covers creation of entries, updates and deletes. Both of those cover IPv4 and IPv6. I have a vrf test suite which covers functional tests under a lot of permutations (ie., sysctls, APIs, remote traffic, local traffic, negative tests, ...) as well as some runtime tests (e.g., active and passive socket with device kills). All of these are run using namespaces which are created and destroyed 100's of times during a run which covers cleanup of resources (eg, netdev refcnts). While the tests were started for VRF they cover non-VRF tests too as 1 namespace uses VRF and other does not. I run this suite with a performance focused kernel config and one with rculock debugging and kmemleak enabled. I am currently re-working the script into something suitable for selftests. I might get it out this dev cycle, if not the beginning of the next. I am also reworking a lot of the above to handle nexthop objects in addition to its own standalone set of functional tests.