[PATCH net-next 4/8] selftests: traceroute: Return correct value on failure
David Ahern
dsahern at kernel.org
Tue Sep 2 02:37:51 UTC 2025
On 9/1/25 2:30 AM, Ido Schimmel wrote:
> 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 at nvidia.com>
> Signed-off-by: Ido Schimmel <idosch at nvidia.com>
> ---
> tools/testing/selftests/net/traceroute.sh | 38 ++++++-----------------
> 1 file changed, 9 insertions(+), 29 deletions(-)
>
Reviewed-by: David Ahern <dsahern at kernel.org>
More information about the Linux-security-module-archive
mailing list