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/run_kselftest.sh: Resolve BASE_DIR with pwd -P

run_kselftest.sh only needs to canonicalize the directory containing the
script itself. Use shell-native path resolution for that by changing into
the directory and calling pwd -P.

This avoids depending on either realpath or readlink -f while still
producing a physical absolute path for BASE_DIR.

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
Link: https://lore.kernel.org/r/20260320-selftests-fixes-v1-3-79144f76be01@suse.com
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Ricardo B. Marlière and committed by
Shuah Khan
a82e076f dbb6153c

+1 -6
+1 -6
tools/testing/selftests/run_kselftest.sh
··· 4 4 # Run installed kselftest tests. 5 5 # 6 6 7 - # Fallback to readlink if realpath is not available 8 - if which realpath > /dev/null; then 9 - BASE_DIR=$(realpath $(dirname $0)) 10 - else 11 - BASE_DIR=$(readlink -f $(dirname $0)) 12 - fi 7 + BASE_DIR=$(cd "$(dirname "$0")" && pwd -P) 13 8 14 9 cd $BASE_DIR 15 10 TESTS="$BASE_DIR"/kselftest-list.txt