selftests/damon/sysfs: test damon_target filter

Test existence of files and validity of input keyword for DAMON monitoring
target based DAMOS filter on DAMON sysfs interface.

Link: https://lkml.kernel.org/r/20230802214312.110532-11-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
SeongJae Park 2023-08-02 21:43:09 +00:00 committed by Andrew Morton
parent 9f6e47abfc
commit 9628ace840

View File

@ -104,11 +104,13 @@ test_filter()
ensure_write_succ "$filter_dir/type" "anon" "valid input"
ensure_write_succ "$filter_dir/type" "memcg" "valid input"
ensure_write_succ "$filter_dir/type" "addr" "valid input"
ensure_write_succ "$filter_dir/type" "target" "valid input"
ensure_write_fail "$filter_dir/type" "foo" "invalid input"
ensure_file "$filter_dir/matching" "exist" "600"
ensure_file "$filter_dir/memcg_path" "exist" "600"
ensure_file "$filter_dir/addr_start" "exist" "600"
ensure_file "$filter_dir/addr_end" "exist" "600"
ensure_file "$filter_dir/damon_target_idx" "exist" "600"
}
test_filters()