Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: ptp: use KSFT_SKIP exit code for skip scenarios

The kselftest framework defines KSFT_SKIP=4 as the standard exit code
for skipped tests. However, phc.sh currently uses a mix of 'exit 0' and
'exit 1' to indicate skip conditions, which can confuse test harnesses
and CI systems.

This patch introduces ksft_skip=4 variable and unifies all skip exit
paths to use 'exit $ksft_skip', consistent with other selftests like
net/lib.sh and net/fib_nexthops.sh.

Signed-off-by: Junjie Cao <junjie.cao@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260126061532.12532-1-junjie.cao@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Junjie Cao and committed by
Jakub Kicinski
166e664e 15e9abc2

+7 -4
+7 -4
tools/testing/selftests/ptp/phc.sh
··· 8 8 " 9 9 DEV=$1 10 10 11 + # Kselftest framework requirement - SKIP code is 4. 12 + ksft_skip=4 13 + 11 14 ############################################################################## 12 15 # Sanity checks 13 16 14 17 if [[ "$(id -u)" -ne 0 ]]; then 15 18 echo "SKIP: need root privileges" 16 - exit 0 19 + exit $ksft_skip 17 20 fi 18 21 19 22 if [[ "$DEV" == "" ]]; then 20 23 echo "SKIP: PTP device not provided" 21 - exit 0 24 + exit $ksft_skip 22 25 fi 23 26 24 27 require_command() ··· 30 27 31 28 if [[ ! -x "$(command -v "$cmd")" ]]; then 32 29 echo "SKIP: $cmd not installed" 33 - exit 1 30 + exit $ksft_skip 34 31 fi 35 32 } 36 33 ··· 40 37 41 38 if [ $? != 0 ]; then 42 39 echo "SKIP: unknown clock $DEV: No such device" 43 - exit 1 40 + exit $ksft_skip 44 41 fi 45 42 } 46 43