lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <592c117d55bea3e5f97c49cbe9a79f0093e03dcb.camel@amazon.de>
Date:   Thu, 17 Jun 2021 11:28:08 +0000
From:   "Boehme, Markus" <markubo@...zon.de>
To:     "sj38.park@...il.com" <sj38.park@...il.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
CC:     "benh@...nel.crashing.org" <benh@...nel.crashing.org>,
        "Foerster, Leonard" <foersleo@...zon.de>,
        "guoju.fgj@...baba-inc.com" <guoju.fgj@...baba-inc.com>,
        "brendanhiggins@...gle.com" <brendanhiggins@...gle.com>,
        "riel@...riel.com" <riel@...riel.com>,
        "greg@...ah.com" <greg@...ah.com>,
        "Heyne, Maximilian" <mheyne@...zon.de>,
        "david@...hat.com" <david@...hat.com>,
        "rientjes@...gle.com" <rientjes@...gle.com>,
        "linux-damon@...zon.com" <linux-damon@...zon.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "corbet@....net" <corbet@....net>,
        "Gowans, James" <jgowans@...zon.com>,
        "Park, Seongjae" <sjpark@...zon.de>,
        "snu@...le79.org" <snu@...le79.org>,
        "Jonathan.Cameron@...wei.com" <Jonathan.Cameron@...wei.com>,
        "Sieber, Fernand" <sieberf@...zon.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "namhyung@...nel.org" <namhyung@...nel.org>,
        "rppt@...nel.org" <rppt@...nel.org>,
        "shuah@...nel.org" <shuah@...nel.org>,
        "vbabka@...e.cz" <vbabka@...e.cz>,
        "zgf574564920@...il.com" <zgf574564920@...il.com>,
        "mgorman@...e.de" <mgorman@...e.de>,
        "amit@...nel.org" <amit@...nel.org>,
        "fan.du@...el.com" <fan.du@...el.com>,
        "minchan@...nel.org" <minchan@...nel.org>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "acme@...nel.org" <acme@...nel.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "alexander.shishkin@...ux.intel.com" 
        <alexander.shishkin@...ux.intel.com>,
        "gthelen@...gle.com" <gthelen@...gle.com>,
        "shakeelb@...gle.com" <shakeelb@...gle.com>,
        "elver@...gle.com" <elver@...gle.com>,
        "vdavydov.dev@...il.com" <vdavydov.dev@...il.com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "Woodhouse, David" <dwmw@...zon.co.uk>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v30 12/13] mm/damon: Add user space selftests

On Wed, 2021-06-16 at 07:31 +0000, SeongJae Park wrote:
> From: SeongJae Park <sjpark@...zon.de>
> 
> This commit adds a simple user space tests for DAMON.  The tests are
> using kselftest framework.
> 
> Signed-off-by: SeongJae Park <sjpark@...zon.de>
> ---
>  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
> @@ -0,0 +1,75 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +test_write_result() {
> +	file=$1
> +	content=$2
> +	orig_content=$3
> +	expect_reason=$4
> +	expected=$5
> +
> +	echo "$content" > "$file"
> +	if [ $? -ne "$expected" ]
> +	then
> +		echo "writing $content to $file doesn't return $expected"
> +		echo "expected because: $expect_reason"
> +		echo "$orig_content" > "$file"
> +		exit 1
> +	fi
> +}
> +
> +test_write_succ() {
> +	test_write_result "$1" "$2" "$3" "$4" 0
> +}
> +
> +test_write_fail() {
> +	test_write_result "$1" "$2" "$3" "$4" 1
> +}
> +
> +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.

> +	then
> +		echo "reading $file expected $expected but $content"
> +		echo "expected because: $expect_reason"
> +		echo "$orig_content" > "$file"
> +		exit 1
> +	fi
> +}
> 
> [...]


Otherwise looking good.

Best regards,
Markus



Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ