sysfs_memcg_path_leak test uses $ksft_skip without defining it. As a result, the test is marked as passed while it was skipped, like below. $ ./sysfs_memcg_path_leak.sh Run as root $ echo $? 0 Users who run the test could therefore wrongly believe the test was run and passed while it was skipped. Define the value at the beginning of the test. After this patch, the exit code reflects the skip. $ ./sysfs_memcg_path_leak.sh Run as root $ echo $? 4 Fixes: dfa3cf0bc018 ("selftets/damon: add a test for memcg_path leak") Cc: # 6.17.x Closes: https://sashiko.dev/#/bug/linux-a0456336-0608-4fec-ac22-0ee61d1d6a91 Signed-off-by: SJ Park --- tools/testing/selftests/damon/sysfs_memcg_path_leak.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh index 34c37129c49fe..d407dddb879ec 100755 --- a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh +++ b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh @@ -1,6 +1,9 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + if [ $EUID -ne 0 ] then echo "Run as root" base-commit: 20b1ca206f8a664a16ad3006262c63b5d37b1ecc -- 2.47.3