]> www.infradead.org Git - users/dwmw2/linux.git/commit
selftests: forwarding: Convert log_test() to recognize RET values
authorPetr Machata <petrm@nvidia.com>
Tue, 26 Mar 2024 16:54:37 +0000 (17:54 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Mar 2024 01:03:43 +0000 (18:03 -0700)
commita923af1ceee744c187d1c08a0d7dc9e8ab7ca482
treeb851b70aadf5f433632f16edf4119cd48cb6bb80
parent596c8819cb78c047acc0cab03a863a9983a3cc62
selftests: forwarding: Convert log_test() to recognize RET values

In a previous patch, the interpretation of RET value was changed to mean
the kselftest framework constant with the test outcome: $ksft_pass,
$ksft_xfail, etc.

Update log_test() to recognize the various possible RET values.

Then have EXIT_STATUS track the RET value of the current test. This differs
subtly from the way RET tracks the value: while for RET we want to
recognize XFAIL as a separate status, for purposes of exit code, we want to
to conflate XFAIL and PASS, because they both communicate non-failure. Thus
add a new helper, ksft_exit_status_merge().

With this log_test_skip() and log_test_xfail() can be reexpressed as thin
wrappers around log_test.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/e5f807cb5476ab795fd14ac74da53a731a9fc432.1711464583.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/lib.sh
tools/testing/selftests/net/lib.sh