[B/D/E/F/G][Unstable][PATCH 0/2][SRU] Fix false-negative return value for rtnetlink.sh in kselftests/net

Po-Hsu Lin po-hsu.lin at canonical.com
Wed Aug 12 12:08:11 UTC 2020


== Justification ==
All the sub test cases in rtnetlink.sh from kselftests/net were using
the same variable "ret" to store the return value of their test result,
and it will be reset to 0 in the beginning of each test.

This will cause false-negative result if the last case has passed.

Also, the kci_test_encap() test in rtnetlink.sh is actually composed by
two different sub-tests, kci_test_encap_vxlan() and kci_test_encap_fou()

Therefore we should check the test result of these two to avoid
false-negative result for this test case.

== Fixes ==
* c2a4d2747996 ("selftests: rtnetlink: correct the final return value for the test")
* 72f70c159b53 ("selftests: rtnetlink: make kci_test_encap() return sub-test result")

This issue is affecting our kernels from B to G, there is no such test
in X thus it can be skipped.

The first patch can be cherry-picked for E/F/G, but needs to be
backported for B/D as they're missing some tests.
The second patch can be cherry-picked for all affected kernels.

== Test ==
Manually tested. The test will fail as expected:
$ sudo ./rtnetlink.sh
PASS: policy routing
PASS: route get
echo $?
PASS: preferred_lft addresses have expired
PASS: promote_secondaries complete
PASS: tc htb hierarchy
PASS: gre tunnel endpoint
PASS: gretap
PASS: ip6gretap
PASS: erspan
PASS: ip6erspan
PASS: bridge setup
PASS: ipv6 addrlabel
PASS: set ifalias a28e0b75-bcc7-4b62-8f5a-381215796229 for test-dummy0
PASS: vrf
PASS: vxlan
FAIL: can't add fou port 7777, skipping test
PASS: macsec
PASS: ipsec
PASS: ipsec_offload
PASS: bridge fdb get
PASS: neigh get
$ echo $?
1

== Regression Potential ==
Low, changes limited to testing tools. It's expected to see this test
failing after applying these patches, since it is reflecting the actual
test result.

Po-Hsu Lin (2):
  selftests: rtnetlink: correct the final return value for the test
  selftests: rtnetlink: make kci_test_encap() return sub-test result

 tools/testing/selftests/net/rtnetlink.sh | 68 +++++++++++++++++++++-----------
 1 file changed, 46 insertions(+), 22 deletions(-)

-- 
2.7.4




More information about the kernel-team mailing list