Commit 1107dc4c authored by Yosry Ahmed's avatar Yosry Ahmed Committed by Shuah Khan
Browse files

selftests/run_kselftest.sh: Use readlink if realpath is not available

'realpath' is not always available,  fallback to 'readlink -f' if is not
available. They seem to work equally well in this context.

Link: https://lore.kernel.org/r/20250318160510.3441646-1-yosry.ahmed@linux.dev


Signed-off-by: default avatarYosry Ahmed <yosry.ahmed@linux.dev>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 1efe2022
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3,7 +3,14 @@
#
# 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

cd $BASE_DIR
TESTS="$BASE_DIR"/kselftest-list.txt
if [ ! -r "$TESTS" ] ; then