selftests/bpf: Fix map tests errno checks
authorArtem Savkov <asavkov@redhat.com>
Thu, 21 Apr 2022 09:43:20 +0000 (11:43 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 21 Apr 2022 16:51:57 +0000 (09:51 -0700)
commitc14766a8a8f3d6c75bf09ec3b6d9ce4d8217015a
treef2305bc20d43093ecce4e36634a82cffa49e48cc
parent6a12b8e20d7e72386594a9dbe7bf2d7fae3b3aa6
selftests/bpf: Fix map tests errno checks

Switching to libbpf 1.0 API broke test_lpm_map and test_lru_map as error
reporting changed. Instead of setting errno and returning -1 bpf calls
now return -Exxx directly.
Drop errno checks and look at return code directly.

Fixes: b858ba8c52b6 ("selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK")
Signed-off-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Yafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/bpf/20220421094320.1563570-1-asavkov@redhat.com
tools/testing/selftests/bpf/test_lpm_map.c
tools/testing/selftests/bpf/test_lru_map.c