Skip to content

Commit 79509ec

Browse files
lienzeakpm00
authored andcommitted
selftests/damon/_damon_sysfs: skip testcases if CONFIG_DAMON_SYSFS is disabled
When CONFIG_DAMON_SYSFS is disabled, the selftests fail with the following outputs, not ok 2 selftests: damon: sysfs_update_schemes_tried_regions_wss_estimation.py # exit=1 not ok 3 selftests: damon: damos_quota.py # exit=1 not ok 4 selftests: damon: damos_quota_goal.py # exit=1 not ok 5 selftests: damon: damos_apply_interval.py # exit=1 not ok 6 selftests: damon: damos_tried_regions.py # exit=1 not ok 7 selftests: damon: damon_nr_regions.py # exit=1 not ok 11 selftests: damon: sysfs_update_schemes_tried_regions_hang.py # exit=1 The root cause of this issue is that all the testcases above do not check the sysfs interface of DAMON whether it exists or not. With this patch applied, all the testcases above now pass successfully. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Enze Li <[email protected]> Reviewed-by: SeongJae Park <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent ad6b26b commit 79509ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/testing/selftests/damon/_damon_sysfs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
print('Seems sysfs not mounted?')
1616
exit(ksft_skip)
1717

18+
if not os.path.exists(sysfs_root):
19+
print('Seems DAMON disabled?')
20+
exit(ksft_skip)
21+
1822
def write_file(path, string):
1923
"Returns error string if failed, or None otherwise"
2024
string = '%s' % string

0 commit comments

Comments
 (0)