From a82e076f4a0c084b2f5470db31dd9282ba3fcbb2 Mon Sep 17 00:00:00 2001 From: "Ricardo B. Marlière" Date: Fri, 20 Mar 2026 15:29:18 -0300 Subject: selftests/run_kselftest.sh: Resolve BASE_DIR with pwd -P MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Link: https://lore.kernel.org/r/20260320-selftests-fixes-v1-3-79144f76be01@suse.com Signed-off-by: Shuah Khan --- tools/testing/selftests/run_kselftest.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'tools/testing') diff --git a/tools/testing/selftests/run_kselftest.sh b/tools/testing/selftests/run_kselftest.sh index ec79160b8d8b..8fa808e10455 100755 --- a/tools/testing/selftests/run_kselftest.sh +++ b/tools/testing/selftests/run_kselftest.sh @@ -4,12 +4,7 @@ # Run installed kselftest tests. # -# Fallback to readlink if realpath is not available -if which realpath > /dev/null; then - BASE_DIR=$(realpath $(dirname $0)) -else - BASE_DIR=$(readlink -f $(dirname $0)) -fi +BASE_DIR=$(cd "$(dirname "$0")" && pwd -P) cd $BASE_DIR TESTS="$BASE_DIR"/kselftest-list.txt -- cgit v1.2.3