Thread (19 messages) 19 messages, 2 authors, 2021-06-17

Re: [PATCH v30 12/13] mm/damon: Add user space selftests

From: SeongJae Park <hidden>
Date: 2021-06-17 11:35:24
Also in: linux-mm, lkml

From: SeongJae Park <redacted>

Hello Markus,

On Thu, 17 Jun 2021 11:29:41 +0000 "Boehme, Markus" [off-list ref] wrote:
On Thu, 2021-06-17 at 11:28 +0000, Boehme, Markus wrote:
quoted
On Wed, 2021-06-16 at 07:31 +0000, SeongJae Park wrote:
quoted
From: SeongJae Park <redacted>

This commit adds a simple user space tests for DAMON.  The tests
are
using kselftest framework.

Signed-off-by: SeongJae Park <redacted>
---
 tools/testing/selftests/damon/Makefile        |  7 ++
 .../selftests/damon/_chk_dependency.sh        | 28 +++++++
 .../testing/selftests/damon/debugfs_attrs.sh  | 75
+++++++++++++++++++
 3 files changed, 110 insertions(+)
 create mode 100644 tools/testing/selftests/damon/Makefile
 create mode 100644
tools/testing/selftests/damon/_chk_dependency.sh
 create mode 100755 tools/testing/selftests/damon/debugfs_attrs.sh

[...]
diff --git a/tools/testing/selftests/damon/debugfs_attrs.sh
b/tools/testing/selftests/damon/debugfs_attrs.sh
new file mode 100755
index 000000000000..60342d6c86d8
--- /dev/null
+++ b/tools/testing/selftests/damon/debugfs_attrs.sh
[...]
quoted
quoted
+
+test_content() {
+	file=$1
+	orig_content=$2
+	expected=$3
+	expect_reason=$4
+
+	content=$(cat "$file")
+	if [ "$content" != "$content" ]
That'll always evaluate false and should compare against "expected"
instead.
Good catch, I will fix so in the next spin.
quoted
Feel free to add Reviewed-by: Markus Boehme [off-list ref] when
this is fixed.
Thank you!
quoted
quoted
+	then
+		echo "reading $file expected $expected but $content"
+		echo "expected because: $expect_reason"
+		echo "$orig_content" > "$file"
+		exit 1
+	fi
+}

Thanks,
SeongJae Park

[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help