]> www.infradead.org Git - users/jedix/linux-maple.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>
Fri, 28 Feb 2025 00:58:47 +0000 (16:58 -0800)
commite90376867a9421a33870dfc0650a487dada185ff
tree3117fbba2dd3c7c2aa58059ce51721635ba1191a
parent806a02b8920ebc75b2250f7ce6c24881f8cf7dc3
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