selftests/bpf: fix return value comparison for tests in test_libbpf.sh
authorQuentin Monnet <quentin.monnet@netronome.com>
Sat, 20 Oct 2018 21:58:44 +0000 (22:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:16:46 +0000 (09:16 +0100)
commit570c05378d971ab29e6e67500c8b0e6fdd19dc93
tree2f19fb0951121162d87626c10b42efb37aac50b4
parent3173e226ca412a80267f471ce173e326895198df
selftests/bpf: fix return value comparison for tests in test_libbpf.sh

[ Upstream commit c5fa5d602221362f8341ecd9e32d83194abf5bd9 ]

The return value for each test in test_libbpf.sh is compared with

    if (( $? == 0 )) ; then ...

This works well with bash, but not with dash, that /bin/sh is aliased to
on some systems (such as Ubuntu).

Let's replace this comparison by something that works on both shells.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/test_libbpf.sh