net: ipv6: added test to expose racey clock check in route cache aging logic

Introduces a KUnit test which exposes a racey clock check in route cache
aging logic.

This test creates a rt6_exception which is set to expire after the now
time passed into rt6_age_exceptions and asserts that the exception will
not be removed.

This test fails because with certain settings, specified by this test,
the aging logic does not use the time passed in as the current time, but
instead directly checks jiffies. Because jiffies is greater than the
expiration time on the exception, it is removed; however, it should not
be because the now parameter can be and usually is early than the
current value of jiffies.

This test may be run using a .config with the following options:

CONFIG_TEST=y
CONFIG_TEST_TEST=y
CONFIG_EXAMPLE_TEST=y
CONFIG_NET=y
CONFIG_INET=y
CONFIG_IPV6_TEST=y

and with the following command:

./tools/testing/kunit/kunit.py

Change-Id: I9acda2ca4e04b4cf60e5addd5a4ee989cb0efca0
Kunitconfig-Revision: c4ad34242571a1883bdd1db0dae32bb6cc69559d
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
1 file changed