On Mon, 2024-07-08 at 11:54 -0700, Andrii Nakryiko wrote:
On Thu, Jul 4, 2024 at 7:38 PM Geliang Tang geliang@kernel.org wrote:
From: Geliang Tang tanggeliang@kylinos.cn
Just like handling ENOTSUPP in test_lsm_cgroup_functional(), this patch adds a new helper test_progs_get_error() to check whether the input error is ENOTSUPP (524) or ENOTSUP (95). If it is, invoke test__skip() to skip the test instead of using test__fail().
Use this helper in ASSERT_OK() before invoking CHECK() macro.
Signed-off-by: Geliang Tang tanggeliang@kylinos.cn
.../selftests/bpf/prog_tests/lsm_cgroup.c | 6 +---- tools/testing/selftests/bpf/test_progs.h | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-)
I haven't followed these patch sets, but no, let's not add magical special error codes handling into ASSERT_xxx() macros.
I agree with Andrii here. You might use -d (denylist) option for test_progs to filter out test cases you know are not supported.
[...]