mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-17 05:28:58 -05:00
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>
This commit is contained in:
committed by
Jakub Kicinski
parent
15e9abc270
commit
166e664e70
@@ -8,17 +8,20 @@ ALL_TESTS="
|
||||
"
|
||||
DEV=$1
|
||||
|
||||
# Kselftest framework requirement - SKIP code is 4.
|
||||
ksft_skip=4
|
||||
|
||||
##############################################################################
|
||||
# Sanity checks
|
||||
|
||||
if [[ "$(id -u)" -ne 0 ]]; then
|
||||
echo "SKIP: need root privileges"
|
||||
exit 0
|
||||
exit $ksft_skip
|
||||
fi
|
||||
|
||||
if [[ "$DEV" == "" ]]; then
|
||||
echo "SKIP: PTP device not provided"
|
||||
exit 0
|
||||
exit $ksft_skip
|
||||
fi
|
||||
|
||||
require_command()
|
||||
@@ -27,7 +30,7 @@ require_command()
|
||||
|
||||
if [[ ! -x "$(command -v "$cmd")" ]]; then
|
||||
echo "SKIP: $cmd not installed"
|
||||
exit 1
|
||||
exit $ksft_skip
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -37,7 +40,7 @@ phc_sanity()
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
echo "SKIP: unknown clock $DEV: No such device"
|
||||
exit 1
|
||||
exit $ksft_skip
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user