selftests/damon/sysfs.sh: test all files in quota goal dir

DAMON sysfs interface for DAMOS quota has quite extended since its initial
introduction.  The test case for that in DAMON sysfs interface essential
file operations test (sysfs.sh) has not accordingly extended, though. 
Extend the test case to test all existing files.

Link: https://lore.kernel.org/20260630141726.92246-8-sj@kernel.org
Signed-off-by: SJ Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
SJ Park
2026-06-30 07:17:21 -07:00
committed by Andrew Morton
parent 01ff35b160
commit 8fa52376da

View File

@@ -199,6 +199,20 @@ test_goal()
ensure_dir "$goal_dir" "exist"
ensure_file "$goal_dir/target_value" "exist" "600"
ensure_file "$goal_dir/current_value" "exist" "600"
ensure_file "$goal_dir/target_metric" "exist" "600"
local fpath="$goal_dir/target_metric"
ensure_write_succ "$fpath" "user_input" "valid input"
ensure_write_succ "$fpath" "some_mem_psi_us" "valid input"
ensure_write_succ "$fpath" "node_mem_used_bp" "valid input"
ensure_write_succ "$fpath" "node_mem_free_bp" "valid input"
ensure_write_succ "$fpath" "node_memcg_used_bp" "valid input"
ensure_write_succ "$fpath" "node_memcg_free_bp" "valid input"
ensure_write_succ "$fpath" "active_mem_bp" "valid input"
ensure_write_succ "$fpath" "inactive_mem_bp" "valid input"
ensure_write_succ "$fpath" "node_eligible_mem_bp" "valid input"
ensure_write_fail "$fpath" "foo" "invalid input"
ensure_file "$goal_dir/nid" "exist" "600"
ensure_file "$goal_dir/path" "exist" "600"
}
test_goals()