Skip to content

Commit c6980e3

Browse files
sjp38torvalds
authored andcommitted
selftests/damon: test DAMON enabling with empty target_ids case
DAMON debugfs didn't check empty targets when starting monitoring, and the issue is fixed with commit b5ca3e8 ("mm/damon/dbgfs: add adaptive_targets list check before enable monitor_on"). To avoid future regression, this commit adds a test case for that in DAMON selftests. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: SeongJae Park <[email protected]> Cc: Brendan Higgins <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 964e170 commit c6980e3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/testing/selftests/damon/debugfs_attrs.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,13 @@ test_write_succ "$file" "" "$orig_content" "empty input"
9494
test_content "$file" "$orig_content" "" "empty input written"
9595
echo "$orig_content" > "$file"
9696

97+
# Test empty targets case
98+
# =======================
99+
100+
orig_target_ids=$(cat "$DBGFS/target_ids")
101+
echo "" > "$DBGFS/target_ids"
102+
orig_monitor_on=$(cat "$DBGFS/monitor_on")
103+
test_write_fail "$DBGFS/monitor_on" "on" "orig_monitor_on" "empty target ids"
104+
echo "$orig_target_ids" > "$DBGFS/target_ids"
105+
97106
echo "PASS"

0 commit comments

Comments
 (0)