From d91bd8017d2b4709c762af6eb23764fc9fecd58b Mon Sep 17 00:00:00 2001 From: SeongJae Park Date: Thu, 27 Jan 2022 14:36:54 +0800 Subject: [PATCH] selftests/damon: skip test if DAMON is running mainline inclusion from mainline-v5.16-rc5 commit 964e17016cf99902c79a5de095cc5e57e7d58248 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4RTX9 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=964e17016cf99902c79a5de095cc5e57e7d58248 -------------------------------- 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 Cc: Brendan Higgins Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit 964e17016cf99902c79a5de095cc5e57e7d58248) Signed-off-by: Yue Zou Reviewed-by: Kefeng Wang Signed-off-by: Zheng Zengkai --- tools/testing/selftests/damon/debugfs_attrs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/testing/selftests/damon/debugfs_attrs.sh b/tools/testing/selftests/damon/debugfs_attrs.sh index 196b6640bf37..fc80380c59f0 100644 --- a/tools/testing/selftests/damon/debugfs_attrs.sh +++ b/tools/testing/selftests/damon/debugfs_attrs.sh @@ -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 # =============== -- GitLab