]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: traceroute: Return correct value on failure
authorIdo Schimmel <idosch@nvidia.com>
Mon, 8 Sep 2025 07:32:34 +0000 (10:32 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 11 Sep 2025 10:22:38 +0000 (12:22 +0200)
commitc068ba9d3ded56cb1ba4d5135ee84bf8039bd563
treeb9df89fbe4b6cb570ffe724d200580c7bd752c76
parent4a8c416602d97a4e2073ed563d4d4c7627de19cf
selftests: traceroute: Return correct value on failure

The test always returns success even if some tests were modified to
fail. Fix by converting the test to use the appropriate library
functions instead of using its own functions.

Before:

 # ./traceroute.sh
 TEST: IPV6 traceroute                                               [FAIL]
 TEST: IPV4 traceroute                                               [ OK ]

 Tests passed:   1
 Tests failed:   1
 $ echo $?
 0

After:

 # ./traceroute.sh
 TEST: IPv6 traceroute                                               [FAIL]
         traceroute6 did not return 2000:102::2
 TEST: IPv4 traceroute                                               [ OK ]
 $ echo $?
 1

Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20250908073238.119240-5-idosch@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/traceroute.sh