DAMON selftest interface essential file operations test (sysfs.sh) is
not testing DAMOS dests/ directory.  Add the test.

Signed-off-by: SeongJae Park <[email protected]>
---
 tools/testing/selftests/damon/sysfs.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tools/testing/selftests/damon/sysfs.sh 
b/tools/testing/selftests/damon/sysfs.sh
index 78eea0d13c271..cbfababa0bf31 100755
--- a/tools/testing/selftests/damon/sysfs.sh
+++ b/tools/testing/selftests/damon/sysfs.sh
@@ -99,6 +99,29 @@ test_stats()
        done
 }
 
+test_dest()
+{
+       dest_dir=$1
+       ensure_file "$dest_dir/id" "exist"
+       ensure_file "$dest_dir/weight" "exist"
+}
+
+test_dests()
+{
+       dests_dir=$1
+       ensure_file "$dests_dir/nr_dests" "exist" "600"
+       ensure_write_succ "$dests_dir/nr_dests" "1" "valid input"
+       test_dest "$dests_dir/0"
+
+       ensure_write_succ "$dests_dir/nr_dests" "2" "valid input"
+       test_dest "$dests_dir/0"
+       test_dest "$dests_dir/1"
+
+       ensure_write_succ "$dests_dir/nr_dests" "0" "valid input"
+       ensure_dir "$dests_dir/0" "not_exist"
+       ensure_dir "$dests_dir/1" "not_exist"
+}
+
 test_filter()
 {
        filter_dir=$1
-- 
2.47.3

Reply via email to