From patchwork Fri Oct 1 12:56:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12530581 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4968CC433EF for ; Fri, 1 Oct 2021 12:56:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F40A46103D for ; Fri, 1 Oct 2021 12:56:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F40A46103D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 91551940105; Fri, 1 Oct 2021 08:56:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A00F9400E4; Fri, 1 Oct 2021 08:56:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71802940105; Fri, 1 Oct 2021 08:56:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 5AEE99400E4 for ; Fri, 1 Oct 2021 08:56:34 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 000AA1842389D for ; Fri, 1 Oct 2021 12:56:33 +0000 (UTC) X-FDA: 78647867508.34.8FC7864 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf11.hostedemail.com (Postfix) with ESMTP id AB9F9F00196C for ; Fri, 1 Oct 2021 12:56:33 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 6BC2561AA9; Fri, 1 Oct 2021 12:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633092992; bh=5IMVnxeKQmBGq+kXHX3jRdtYUAtJAhxvUWwsyEEOvVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmj4WfbXy2M53h5olsPyPCxcLcmYrXcIyXenWUIVYkk7W1xo3o74CZjJl0MxtvPa8 hLm7UUxL0eKoaXvBA/oru4AY9S06YY3AV36NkT+d18zfP2NCq9SxbA+EyQIExJ4yiA 7OKhOJ0t1apmY1WiM9RdA3Pcwwtxy29HQcDD++TeUW0mib0O8GnWHVtHpEZ3r4wYty CDhyybsAKd0TGHU1QJgYkKVPdZdz1xS4so6RaYPr6FYdSdAF7C06IU58jb1CAs/hTC HKAO1r8CzBxdDaJzIysq2KhGeBXc0qzgaHfGynDWM2RHWnVCwg+n/z4k2tOo4cI3Hv tws+Fhtj/Xyig== From: SeongJae Park To: akpm@linux-foundation.org Cc: SeongJae Park , Jonathan.Cameron@Huawei.com, amit@kernel.org, benh@kernel.crashing.org, corbet@lwn.net, david@redhat.com, dwmw@amazon.com, elver@google.com, foersleo@amazon.de, gthelen@google.com, markubo@amazon.de, rientjes@google.com, shakeelb@google.com, shuah@kernel.org, linux-damon@amazon.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] selftests/damon: Add 'schemes' debugfs tests Date: Fri, 1 Oct 2021 12:56:03 +0000 Message-Id: <20211001125604.29660-7-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211001125604.29660-1-sj@kernel.org> References: <20211001125604.29660-1-sj@kernel.org> Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hmj4WfbX; spf=pass (imf11.hostedemail.com: domain of sj@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: AB9F9F00196C X-Stat-Signature: 3b1kkeem3wojtrnby9dr4qbwbowau9id X-HE-Tag: 1633092993-920286 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: This commit adds simple selftets for 'schemes' debugfs file of DAMON. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/debugfs_attrs.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/damon/debugfs_attrs.sh b/tools/testing/selftests/damon/debugfs_attrs.sh index bfabb19dc0d3..639cfb6a1f65 100755 --- a/tools/testing/selftests/damon/debugfs_attrs.sh +++ b/tools/testing/selftests/damon/debugfs_attrs.sh @@ -57,6 +57,19 @@ test_write_fail "$file" "1 2 3 5 4" "$orig_content" \ test_content "$file" "$orig_content" "1 2 3 4 5" "successfully written" echo "$orig_content" > "$file" +# Test schemes file +# ================= + +file="$DBGFS/schemes" +orig_content=$(cat "$file") + +test_write_succ "$file" "1 2 3 4 5 6 4" \ + "$orig_content" "valid input" +test_write_fail "$file" "1 2 +3 4 5 6 3" "$orig_content" "multi lines" +test_write_succ "$file" "" "$orig_content" "disabling" +echo "$orig_content" > "$file" + # Test target_ids file # ====================