diff options
author | Delyan Kratunov <delyank@fb.com> | 2022-02-03 02:54:20 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-02-03 09:31:18 +0300 |
commit | 04fcb5f9a104f24278ad849c642cbdf0c8f48453 (patch) | |
tree | e0347c7a158827786282e8b815870ccc0e0384fa /tools/testing/selftests/bpf/prog_tests/fexit_test.c | |
parent | dd5152ab338c8705093a64d706a35074b3b365aa (diff) | |
download | linux-04fcb5f9a104f24278ad849c642cbdf0c8f48453.tar.xz |
selftests/bpf: Migrate from bpf_prog_test_run
bpf_prog_test_run is being deprecated in favor of the OPTS-based
bpf_prog_test_run_opts.
We end up unable to use CHECK in most cases, so replace usages with
ASSERT_* calls.
Signed-off-by: Delyan Kratunov <delyank@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220202235423.1097270-2-delyank@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/fexit_test.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/fexit_test.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_test.c b/tools/testing/selftests/bpf/prog_tests/fexit_test.c index d4887d8bb396..101b7343036b 100644 --- a/tools/testing/selftests/bpf/prog_tests/fexit_test.c +++ b/tools/testing/selftests/bpf/prog_tests/fexit_test.c @@ -6,9 +6,9 @@ static int fexit_test(struct fexit_test_lskel *fexit_skel) { int err, prog_fd, i; - __u32 duration = 0, retval; int link_fd; __u64 *result; + LIBBPF_OPTS(bpf_test_run_opts, topts); err = fexit_test_lskel__attach(fexit_skel); if (!ASSERT_OK(err, "fexit_attach")) @@ -20,10 +20,9 @@ static int fexit_test(struct fexit_test_lskel *fexit_skel) return -1; prog_fd = fexit_skel->progs.test1.prog_fd; - err = bpf_prog_test_run(prog_fd, 1, NULL, 0, - NULL, NULL, &retval, &duration); + err = bpf_prog_test_run_opts(prog_fd, &topts); ASSERT_OK(err, "test_run"); - ASSERT_EQ(retval, 0, "test_run"); + ASSERT_EQ(topts.retval, 0, "test_run"); result = (__u64 *)fexit_skel->bss; for (i = 0; i < sizeof(*fexit_skel->bss) / sizeof(__u64); i++) { |