Fix pmtu.sh result checking in ubuntu_kernel_selftests

Bug #2043198 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
New
Undecided
Unassigned

Bug Description

[Impact]
In pmtu.sh test from ubuntu_kernel_selftests, there is a syntax issue for test result checking which will make it always report pass if the last test in the script has passed.

[Fix]
* 63e201916b selftests: pmtu.sh: fix result checking

[Test Plan]
Run the patched pmtu.sh from kernel tree. Also apply the following patch to validate this fix:

diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index f838dd3..cb62a75 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -266,7 +266,9 @@ tests="
        list_flush_ipv4_exception ipv4: list and flush cached exceptions 1
        list_flush_ipv6_exception ipv6: list and flush cached exceptions 1
        pmtu_ipv4_route_change ipv4: PMTU exception w/route replace 1
- pmtu_ipv6_route_change ipv6: PMTU exception w/route replace 1"
+ pmtu_ipv6_route_change ipv6: PMTU exception w/route replace 1
+ emit_fail Test that will emit fail result 0
+ emit_pass Test that will emit pass result 0"

 NS_A="ns-A"
 NS_B="ns-B"
@@ -2232,6 +2234,13 @@ test_pmtu_ipv6_route_change() {
        test_pmtu_ipvX_route_change 6
 }

+test_emit_fail() {
+ false
+}
+test_emit_pass() {
+ true
+}
+
 usage() {
        echo
        echo "$0 [OPTIONS] [TEST]..."

Check the return value of this script, it should be 1

[Regression Potential]
This is just changing test result processing behaviour, no actual impact to any kernel function. But we might see new failure discovered by this test.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

This has landed via stable update bug 2049432 since Ubuntu-5.15.0-96.106

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.