selftests/bpf: Fix attach tests retcode checks
authorArtem Savkov <asavkov@redhat.com>
Thu, 21 Apr 2022 13:01:04 +0000 (15:01 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 21 Apr 2022 14:34:55 +0000 (16:34 +0200)
commit920fd5e1771db8b338d4145c2d30d60bf0bcce99
tree020352f368979bfde1c743492799e0da57e8e428
parent9d87e41a6d644d4cee66a72fd1656fac5b7850d1
selftests/bpf: Fix attach tests retcode checks

Switching to libbpf 1.0 API broke test_sock and test_sysctl as they
check for return of bpf_prog_attach to be exactly -1. Switch the check
to '< 0' instead.

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: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Yafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/bpf/20220421130104.1582053-1-asavkov@redhat.com
tools/testing/selftests/bpf/test_sock.c
tools/testing/selftests/bpf/test_sysctl.c