Re: [PATCH] selftests: Use kselftest skip code for skipped tests
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2021-05-25 14:04:12
Also in:
bpf, linux-kselftest, lkml
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2021-05-25 14:04:12
Also in:
bpf, linux-kselftest, lkml
On Tue, May 25, 2021 at 2:17 AM Po-Hsu Lin [off-list ref] wrote:
There are several test cases still using exit 0 when they need to be skipped. Use kselftest framework skip code instead so it can help us to distinguish the proper return status. Criterion to filter out what should be fixed in selftests directory: grep -r "exit 0" -B1 | grep -i skip This change might cause some false-positives if people are running these test scripts directly and only checking their return codes, which will change from 0 to 4. However I think the impact should be small as most of our scripts here are already using this skip code. And there will be no such issue if running them with the kselftest framework. Signed-off-by: Po-Hsu Lin <redacted>
Perhaps it's a good time to mention this patch to add a kselftest helper library for shell tests again: [PATCH] tools/testing: add kselftest shell helper library https://lore.kernel.org/linux-kselftest/20201123162508.585279-1-willemdebruijn.kernel@gmail.com/ (local) That can avoid redefining this constant in every file.