linux/tools/testing/selftests/damon
wang wei d25711a9f3 selftests/damon: check correct path in ensure_file() not_exist case
In the ensure_file() function, the "not_exist" code path checks whether
$dir exists as a regular file.  However, the intent is to verify that the
target file ($file) does not exist, not the $dir.  Testing $dir makes the
existence check effectively useless -- it tests the wrong path and thus
never catches the case where the file is unexpectedly present.

Replace $dir with $file so the not_exist verification targets the correct
path.

Link: https://lore.kernel.org/20260706134305.5224-1-a929244872@163.com
Signed-off-by: wang wei <a929244872@163.com>
Reviewed-by: SJ Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-08-04 19:18:29 -07:00
..
_common.sh selftests/damon: introduce _common.sh to host shared function 2025-07-26 15:08:21 -07:00
_damon_sysfs.py selftests/damon/_damon_sysfs: support kdamond refresh_ms 2026-07-28 21:12:11 -07:00
.gitignore selftests/damon: remove tests for DAMON debugfs interface 2025-01-25 20:22:29 -08:00
access_memory_even.c selftests/damon/access_memory_even: remove unused header file 2025-09-13 16:55:02 -07:00
access_memory.c selftests/damon/access_memory: add repeat mode 2026-01-31 14:22:44 -08:00
config selftests/damon/config: enable DAMON_DEBUG_SANITY 2026-04-05 13:53:21 -07:00
damon_nr_regions.py selftests/damon/damon_nr_regions: sort collected regiosn before checking with min/max boundaries 2025-03-05 21:36:16 -08:00
damos_apply_interval.py selftests/damon: fix dead code, skipped checks, and broken lookups 2026-07-28 21:12:10 -07:00
damos_quota_goal.py selftests/damon: fix dead code, skipped checks, and broken lookups 2026-07-28 21:12:10 -07:00
damos_quota.py selftests/damon/damos_quota: make real expectation of quota exceeds 2025-03-05 21:36:16 -08:00
damos_tried_regions.py selftests/damon/damos_tried_regions: fix expectation output and join TypeError 2026-07-28 21:12:10 -07:00
drgn_dump_damon_status.py selftests/damon/drgn_dump_damon_status: do not dump nr_accesses_bp 2026-07-30 19:40:35 -07:00
lru_sort.sh selftests/damon: introduce _common.sh to host shared function 2025-07-26 15:08:21 -07:00
Makefile selftests/damon/sysfs_refresh: test kdamond refresh_ms 2026-07-28 21:12:11 -07:00
reclaim.sh selftests/damon: introduce _common.sh to host shared function 2025-07-26 15:08:21 -07:00
sysfs_memcg_path_leak.sh selftests/damon/sysfs_memcg_path_leak.sh: use kmemleak 2026-01-31 14:22:44 -08:00
sysfs_no_op_commit_break.py selftests/damon: test no-op commit broke DAMON status 2025-09-13 16:54:55 -07:00
sysfs_refresh.py selftests/damon/sysfs_refresh: test kdamond refresh_ms 2026-07-28 21:12:11 -07:00
sysfs_update_removed_scheme_dir.sh selftests/damon: introduce _common.sh to host shared function 2025-07-26 15:08:21 -07:00
sysfs_update_schemes_tried_regions_hang.py selftests/damon: add execute permissions to test scripts 2024-09-03 21:15:57 -07:00
sysfs_update_schemes_tried_regions_wss_estimation.py selftests/damon: fix dead code, skipped checks, and broken lookups 2026-07-28 21:12:10 -07:00
sysfs.py selftests/damon/sysfs.py: validate memcg_path staging readback 2026-07-28 21:12:11 -07:00
sysfs.sh selftests/damon: check correct path in ensure_file() not_exist case 2026-08-04 19:18:29 -07:00