From patchwork Fri Dec 10 22:46:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12671287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85371C433F5 for ; Fri, 10 Dec 2021 22:54:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C6C446B008A; Fri, 10 Dec 2021 17:47:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C1B916B008C; Fri, 10 Dec 2021 17:47:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B09B86B0092; Fri, 10 Dec 2021 17:47:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id 9EA9F6B008A for ; Fri, 10 Dec 2021 17:47:07 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6A79286995 for ; Fri, 10 Dec 2021 22:46:57 +0000 (UTC) X-FDA: 78903371274.27.3C01526 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf01.hostedemail.com (Postfix) with ESMTP id D42BA4000D for ; Fri, 10 Dec 2021 22:46:54 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 10186CE2D94; Fri, 10 Dec 2021 22:46:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62833C341C8; Fri, 10 Dec 2021 22:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1639176413; bh=j7vMc6yY9pIVL00NDf/jp8vWGXPM6Hke9NvpPZQ7TOM=; h=Date:From:To:Subject:In-Reply-To:From; b=QorWqNOXe27PsLXZIAes6qTkuTFXNfEENLYeKdWTpwg7iZTICcRMx0Tm+LEb1x9pY dVLIqF3ncISERR8HB6ZgfXj2T13sHVRg/vD8nuLFWBB/oA7o7IuxsKP841wqTCcTdp MMU8CL2aFzEiG3PXd6lAOTHDadpcN1FvIJNHiM8Y= Date: Fri, 10 Dec 2021 14:46:52 -0800 From: Andrew Morton To: akpm@linux-foundation.org, brendanhiggins@google.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, shuah@kernel.org, sj@kernel.org, torvalds@linux-foundation.org Subject: [patch 15/21] selftests/damon: test wrong DAMOS condition ranges input Message-ID: <20211210224652.mEAbDc-RE%akpm@linux-foundation.org> In-Reply-To: <20211210144539.663efee2c80d8450e6180230@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=QorWqNOX; dmarc=none; spf=pass (imf01.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: D42BA4000D X-Stat-Signature: 4y4soxpe5hgwz7md4e88eaaqgn3c4yh9 X-HE-Tag: 1639176414-107942 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: SeongJae Park Subject: selftests/damon: test wrong DAMOS condition ranges input A patch titled "mm/damon/schemes: add the validity judgment of thresholds"[1] makes DAMON debugfs interface to validate DAMON scheme inputs. This commit adds a test case for the validation logic in DAMON selftests. [1] https://lore.kernel.org/linux-mm/d78360e52158d786fcbf20bc62c96785742e76d3.1637239568.git.xhao@linux.alibaba.com/ Link: https://lkml.kernel.org/r/20211201150440.1088-10-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/damon/debugfs_attrs.sh | 2 ++ 1 file changed, 2 insertions(+) --- a/tools/testing/selftests/damon/debugfs_attrs.sh~selftests-damon-test-wrong-damos-condition-ranges-input +++ a/tools/testing/selftests/damon/debugfs_attrs.sh @@ -77,6 +77,8 @@ test_write_succ "$file" "1 2 3 4 5 6 4 0 test_write_fail "$file" "1 2 3 4 5 6 3 0 0 0 1 2 3 1 100 3 2 1" "$orig_content" "multi lines" test_write_succ "$file" "" "$orig_content" "disabling" +test_write_fail "$file" "2 1 2 1 10 1 3 10 1 1 1 1 1 1 1 1 2 3" \ + "$orig_content" "wrong condition ranges" echo "$orig_content" > "$file" # Test target_ids file