Commit 3649caed authored by SeongJae Park's avatar SeongJae Park Committed by Andrew Morton

selftests/damon: test quota goals directory

Add DAMON selftests for testing creation/existence of quota goals
directories and files, and simple valid input writes.

Link: https://lkml.kernel.org/r/20231130023652.50284-7-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: David Gow <davidgow@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f1762cb3
......@@ -150,6 +150,32 @@ test_weights()
ensure_file "$weights_dir/age_permil" "exist" "600"
}
test_goal()
{
goal_dir=$1
ensure_dir "$goal_dir" "exist"
ensure_file "$goal_dir/target_value" "exist" "600"
ensure_file "$goal_dir/current_value" "exist" "600"
}
test_goals()
{
goals_dir=$1
ensure_dir "$goals_dir" "exist"
ensure_file "$goals_dir/nr_goals" "exist" "600"
ensure_write_succ "$goals_dir/nr_goals" "1" "valid input"
test_goal "$goals_dir/0"
ensure_write_succ "$goals_dir/nr_goals" "2" "valid input"
test_goal "$goals_dir/0"
test_goal "$goals_dir/1"
ensure_write_succ "$goals_dir/nr_goals" "0" "valid input"
ensure_dir "$goals_dir/0" "not_exist"
ensure_dir "$goals_dir/1" "not_exist"
}
test_quotas()
{
quotas_dir=$1
......@@ -158,6 +184,7 @@ test_quotas()
ensure_file "$quotas_dir/bytes" "exist" 600
ensure_file "$quotas_dir/reset_interval_ms" "exist" 600
test_weights "$quotas_dir/weights"
test_goals "$quotas_dir/goals"
}
test_access_pattern()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment