]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
selftests/damon: skip test if DAMON is running
authorSeongJae Park <sj@kernel.org>
Fri, 10 Dec 2021 22:46:46 +0000 (14:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 11 Dec 2021 01:10:56 +0000 (17:10 -0800)
Testing the DAMON debugfs files while DAMON is running makes no sense,
as any write to the debugfs files will fail.  This commit makes the test
be skipped in this case.

Link: https://lkml.kernel.org/r/20211201150440.1088-8-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/damon/debugfs_attrs.sh

index 196b6640bf3783601833f348447d720f71f9f7ec..fc80380c59f02192830673fb3b1b9a1aff76f787 100644 (file)
@@ -44,6 +44,15 @@ test_content() {
 
 source ./_chk_dependency.sh
 
+ksft_skip=4
+
+damon_onoff="$DBGFS/monitor_on"
+if [ $(cat "$damon_onoff") = "on" ]
+then
+       echo "monitoring is on"
+       exit $ksft_skip
+fi
+
 # Test attrs file
 # ===============