]> www.infradead.org Git - users/hch/misc.git/commit
selftests/damon/damon_nr_regions: sort collected regiosn before checking with min...
authorSeongJae Park <sj@kernel.org>
Tue, 25 Feb 2025 22:23:33 +0000 (14:23 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 6 Mar 2025 05:36:16 +0000 (21:36 -0800)
commit582ccf78f6090d88b1c7066b1e90b3d9ec952d08
tree9ceb2d1ecfc9e55f4e2cd96d735155e082dbf44a
parent695469c07a65547acb6e229b3fdf6aaa881817e3
selftests/damon/damon_nr_regions: sort collected regiosn before checking with min/max boundaries

damon_nr_regions.py starts DAMON, periodically collect number of regions
in snapshots, and see if it is in the requested range.  The check code
assumes the numbers are sorted on the collection list, but there is no
such guarantee.  Hence this can result in false positive test success.
Sort the list before doing the check.

Link: https://lkml.kernel.org/r/20250225222333.505646-4-sj@kernel.org
Fixes: 781497347d1b ("selftests/damon: implement test for min/max_nr_regions")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/damon/damon_nr_regions.py