summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/damon/sysfs.sh
diff options
context:
space:
mode:
authorKunwu Chan <chentao@kylinos.cn>2026-06-29 07:46:46 -0700
committerAndrew Morton <akpm@linux-foundation.org>2026-07-08 22:54:14 -0700
commit3a561ef3de62b04fc2be02bb3793e70a72df689b (patch)
tree097999c997116f62823dc2be42be993976ecabe4 /tools/testing/selftests/damon/sysfs.sh
parent599ec11f6308e0f7a158ecce952d1e62f494e92b (diff)
downloadlinux-next-3a561ef3de62b04fc2be02bb3793e70a72df689b.tar.gz
linux-next-3a561ef3de62b04fc2be02bb3793e70a72df689b.zip
selftests/damon: fix dead code, skipped checks, and broken lookups
'hugeapge_size' in drgn_dump_damon_status.py was a dead elif branch. $fail_reason in sysfs.sh was undefined, silently emptying the error message. 'exit' instead of 'exist' in sysfs.sh skipped a file existence check. 'nohugeapge' in sysfs.py broke an action dict lookup. Fix other wrong strings in the same files. Link: https://lore.kernel.org/20260601032314.424013-4-kunwu.chan@linux.dev Link: https://lore.kernel.org/20260629144648.134092-4-sj@kernel.org Co-developed-by: Wang Lian <lianux.mm@gmail.com> Signed-off-by: Wang Lian <lianux.mm@gmail.com> Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Signed-off-by: SJ Park <sj@kernel.org> Reviewed-by: SJ Park <sj@kernel.org> Cc: Kunwu Chan <chentao@kylinos.cn> Cc: Wang Lian <lianux.mm@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/damon/sysfs.sh')
-rwxr-xr-xtools/testing/selftests/damon/sysfs.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/damon/sysfs.sh b/tools/testing/selftests/damon/sysfs.sh
index 78f4badb5beb..2eaaa5ae3c5e 100755
--- a/tools/testing/selftests/damon/sysfs.sh
+++ b/tools/testing/selftests/damon/sysfs.sh
@@ -3,7 +3,7 @@
source _common.sh
-# Kselftest frmework requirement - SKIP code is 4.
+# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
ensure_write_succ()
@@ -28,7 +28,7 @@ ensure_write_fail()
if (echo "$content" > "$file") 2> /dev/null
then
- echo "writing $content to $file succeed ($fail_reason)"
+ echo "writing $content to $file succeeded ($reason)"
echo "expected failure because $reason"
exit 1
fi
@@ -363,7 +363,7 @@ test_context()
{
context_dir=$1
ensure_dir "$context_dir" "exist"
- ensure_file "$context_dir/avail_operations" "exit" 400
+ ensure_file "$context_dir/avail_operations" "exist" 400
ensure_file "$context_dir/operations" "exist" 600
ensure_file "$context_dir/addr_unit" "exist" 600
ensure_file "$context_dir/pause" "exist" 600