]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/damon/sysfs.py: test runtime reduction of DAMON parameters
authorSeongJae Park <sj@kernel.org>
Sun, 20 Jul 2025 17:16:52 +0000 (10:16 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 26 Jul 2025 22:08:21 +0000 (15:08 -0700)
sysfs.py is testing if non-default additional parameters can be committed.
Add a test case for further reducing the parameters to the default set.

Link: https://lkml.kernel.org/r/20250720171652.92309-23-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/damon/sysfs.py

index 1bf9508cd44df97bfbaf3c4b4af364528f4186e0..2666c6f0f1a55b0db23807bd4b9783a9f25d4d5f 100755 (executable)
@@ -252,6 +252,20 @@ def main():
 
     assert_ctxs_committed(kdamonds.kdamonds[0].contexts, status['contexts'])
 
+    # test online commitment of minimum context.
+    context = _damon_sysfs.DamonCtx()
+    context.idx = 0
+    context.kdamond = kdamonds.kdamonds[0]
+    kdamonds.kdamonds[0].contexts = [context]
+    kdamonds.kdamonds[0].commit()
+
+    status, err = dump_damon_status_dict(kdamonds.kdamonds[0].pid)
+    if err is not None:
+        print(err)
+        exit(1)
+
+    assert_ctxs_committed(kdamonds.kdamonds[0].contexts, status['contexts'])
+
     kdamonds.stop()
 
 if __name__ == '__main__':