summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2018-10-20 23:58:44 +0200
committerAlexei Starovoitov <ast@kernel.org>2018-10-21 08:17:43 +0200
commitc5fa5d602221362f8341ecd9e32d83194abf5bd9 (patch)
tree6d9be8ac450553a0730f939aad476fdc17a2f6e2 /tools
parentMerge branch 'misc-improvements' (diff)
downloadlinux-c5fa5d602221362f8341ecd9e32d83194abf5bd9.tar.xz
linux-c5fa5d602221362f8341ecd9e32d83194abf5bd9.zip
selftests/bpf: fix return value comparison for tests in test_libbpf.sh
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>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/bpf/test_libbpf.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_libbpf.sh b/tools/testing/selftests/bpf/test_libbpf.sh
index d97dc914cd49..156d89f1edcc 100755
--- a/tools/testing/selftests/bpf/test_libbpf.sh
+++ b/tools/testing/selftests/bpf/test_libbpf.sh
@@ -6,7 +6,7 @@ export TESTNAME=test_libbpf
# Determine selftest success via shell exit code
exit_handler()
{
- if (( $? == 0 )); then
+ if [ $? -eq 0 ]; then
echo "selftests: $TESTNAME [PASS]";
else
echo "$TESTNAME: failed at file $LAST_LOADED" 1>&2