selftests: lib: Define more kselftest exit codes
authorPetr Machata <petrm@nvidia.com>
Tue, 26 Mar 2024 16:54:35 +0000 (17:54 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Mar 2024 01:03:42 +0000 (18:03 -0700)
The following patches will operate with more exit codes besides
ksft_skip. Add them here.

Additionally, move a duplicated skip exit code definition from
forwarding/tc_tunnel_key.sh. Keep a similar duplicate in
forwarding/devlink_lib.sh, because even though lib.sh will have
been sourced in all cases where devlink_lib is, the inclusion is not
visible in the file itself, and relying on it would be confusing.

Cc: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/545a03046c7aca0628a51a389a9b81949ab288ce.1711464583.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/tc_tunnel_key.sh
tools/testing/selftests/net/lib.sh

index 5a5dd90348195ca50f6dc955111f693ed4ee35cd..79775b10b99f1e2d5a8c016ce4ae0333690cb889 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
-# Kselftest framework requirement - SKIP code is 4.
-ksft_skip=4
 
 ALL_TESTS="tunnel_key_nofrag_test"
 
index 5b366cc4fc43b77a189f9bb52a0130a465dbe9d4..d9bdf6aa3bf13afc450dd178d14719ce1c30040e 100644 (file)
@@ -8,8 +8,12 @@
 
 BUSYWAIT_TIMEOUT=$((WAIT_TIMEOUT * 1000)) # ms
 
-# Kselftest framework requirement - SKIP code is 4.
+# Kselftest framework constants.
+ksft_pass=0
+ksft_fail=1
+ksft_xfail=2
 ksft_skip=4
+
 # namespace list created by setup_ns
 NS_LIST=""