Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests/bpf: Check ASSERT_OK(err) in dummy_st_ops
Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch platform, some "unexpected arg" errors occur: ''' #78/1 dummy_st_ops/dummy_st_ops_attach:OK test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \ actual 0 != expected 4076074229 #78/2 dummy_st_ops/dummy_init_ret_value:FAIL #78/3 dummy_st_ops/dummy_init_ptr_arg:SKIP test_dummy_multiple_args:FAIL:arg 0 unexpected arg 0: \ actual 0 != expected 7 test_dummy_multiple_args:FAIL:arg 1 unexpected arg 1: \ actual 0 != expected -100 test_dummy_multiple_args:FAIL:arg 2 unexpected arg 2: \ actual 0 != expected 35423 test_dummy_multiple_args:FAIL:arg 3 unexpected arg 3: \ actual 0 != expected 99 test_dummy_multiple_args:FAIL:arg 4 unexpected arg 4: \ actual 0 != expected 1311768467139281697 #78/4 dummy_st_ops/dummy_multiple_args:FAIL #78/5 dummy_st_ops/dummy_sleepable:SKIP #78/6 dummy_st_ops/dummy_sleepable_reject_null:OK #78/7 dummy_st_ops/test_unsupported_field_sleepable:OK #78 dummy_st_ops:FAIL ''' This is because BPF trampoline is not implemented on Loongarch yet, bpf_prog_test_run_opts() returns ENOTSUPP. This patch checks the return values of bpf_prog_test_run_opts() in dummy_st_ops to fix these errors. If error returned, goto the newly added label "out" to destroy the skel. Signed-off-by: Geliang Tang <[email protected]>
- Loading branch information