[patch 13/21] selftests/damon: skip test if DAMON is running

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: SeongJae Park <sj@xxxxxxxxxx>
Subject: selftests/damon: skip test if DAMON is running

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@xxxxxxxxxx
Signed-off-by: SeongJae Park <sj@xxxxxxxxxx>
Cc: Brendan Higgins <brendanhiggins@xxxxxxxxxx>
Cc: Shuah Khan <shuah@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 tools/testing/selftests/damon/debugfs_attrs.sh |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/tools/testing/selftests/damon/debugfs_attrs.sh~selftests-damon-skip-test-if-damon-is-running
+++ a/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
 # ===============
 
_



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux