Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2652886ybk; Tue, 12 May 2020 04:59:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi91b3vtOGf9XkYWQKSIjSq7SRdNcwImpdZ/F0ou2jc58p62Ts1PB34XDbtnfgX4QIcinI X-Received: by 2002:a17:906:4dcc:: with SMTP id f12mr8877922ejw.272.1589284779732; Tue, 12 May 2020 04:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589284779; cv=none; d=google.com; s=arc-20160816; b=MZJwAvuX2GM/CXE7LM8hjq4vrOx+c706D+l5OSHeLPBHWFiYlddm7g7ZEnOiTxJ5mB jqCTuM64ZRbMfiuN4H/xxvm2fkTSq+9jzZouITw/9iYTo5r+rn0GY1ck71pjSwF91+Xi dd7+mdluDcZ12QudPd9LQmANAYuhz/tqog04208gbBODpiUEtpKH6xAe2Cmjqnb44BDW S52FS5xm3z1nY+hBCke3W6FGwm62IDflnNGsiieIYPJPLGRlG0bCf0lo5a5rEgpILZDA kRFKlfRzxJw42BnGgvXVBPu5Iek/bVGgWhdQfREeQUm1ribg8PVoeUJX5qcus6GwAag+ UtoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=b5EEY//uUmxww4MeXLoOfsSYKFHirbB/BqQ/qTWvUzg=; b=KojnKxW9FlLeZ0VolRYUkXX97EAXtyKZjd71mSyN9walPCJHfjn8rfU7tJr3cNvtkX 18hf157iBXNk7I73yGWUSUdhedGVL0J6lrGzB78JzbTd5Wc0xS6aqO9L85hl8iy3fG+l GUsXhu+auyWQ7raG8TRnLwHVeOSD8iHjrywKoy9oZNKPIz6S3QFhTojNqndMFvvg1Drs 1VVtNKkCByuTnofugp9TbX/NHCJ4cq+kqt/NMhIjTXzoU5igwxluTPC8qEMollnM9y7Y KK74d75mNQJO76svhemjWbZhu9ifHLtwf2W3Km8CiU0InFWghoeyCothI1NgrgDOOk3q /rDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=FlXTdY+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h10si2306112ejf.487.2020.05.12.04.59.16; Tue, 12 May 2020 04:59:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=FlXTdY+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729678AbgELL5c (ORCPT + 99 others); Tue, 12 May 2020 07:57:32 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:34573 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbgELL5c (ORCPT ); Tue, 12 May 2020 07:57:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1589284652; x=1620820652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=b5EEY//uUmxww4MeXLoOfsSYKFHirbB/BqQ/qTWvUzg=; b=FlXTdY+xqk8bda6LKAz85pnuzZ0td4EJkBPJXqIflc9/gdWYxFuIysU8 K7NJn351ObUg2Di3T6Y7bi50dtykfVWxeYam8XWMzR2pAqMEQEnYys1aN qN+BqMT4MBTjJXmgMQ+NA19cIqC1DHiLER9dHGKqebDN6iVv8X2pTr54j U=; IronPort-SDR: ejNf0aZUOQgrG6D2Se+cY95b0P5q2djIYRTNVCjzWxmqO17I93n81TmrWtamFp7SOjWJWZa/pL pwHLjs+HxXsQ== X-IronPort-AV: E=Sophos;i="5.73,383,1583193600"; d="scan'208";a="44227096" Received: from sea32-co-svc-lb4-vlan2.sea.corp.amazon.com (HELO email-inbound-relay-2c-6f38efd9.us-west-2.amazon.com) ([10.47.23.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 12 May 2020 11:57:31 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2c-6f38efd9.us-west-2.amazon.com (Postfix) with ESMTPS id 19462A069E; Tue, 12 May 2020 11:57:29 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 12 May 2020 11:57:28 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.160.100) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 12 May 2020 11:57:12 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v8 6/8] mm/damon/selftests: Add 'schemes' debugfs tests Date: Tue, 12 May 2020 13:53:41 +0200 Message-ID: <20200512115343.27699-7-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200512115343.27699-1-sjpark@amazon.com> References: <20200512115343.27699-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.100] X-ClientProxiedBy: EX13D17UWB003.ant.amazon.com (10.43.161.42) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park This commit adds simple selftets for 'schemes' debugfs file of DAMON. Signed-off-by: SeongJae Park --- .../testing/selftests/damon/debugfs_attrs.sh | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tools/testing/selftests/damon/debugfs_attrs.sh b/tools/testing/selftests/damon/debugfs_attrs.sh index d5188b0f71b1..4aeb2037a67e 100755 --- a/tools/testing/selftests/damon/debugfs_attrs.sh +++ b/tools/testing/selftests/damon/debugfs_attrs.sh @@ -97,6 +97,35 @@ fi echo $ORIG_CONTENT > $file +# Test schemes file +file="$DBGFS/schemes" + +ORIG_CONTENT=$(cat $file) +echo "1 2 3 4 5 6 3" > $file +if [ $? -ne 0 ] +then + echo "$file write fail" + echo $ORIG_CONTENT > $file + exit 1 +fi + +echo "1 2 +3 4 5 6 3" > $file +if [ $? -eq 0 ] +then + echo "$file multi line write success (expected fail)" + echo $ORIG_CONTENT > $file + exit 1 +fi + +echo > $file +if [ $? -ne 0 ] +then + echo "$file empty string writing fail" + echo $ORIG_CONTENT > $file + exit 1 +fi + # Test pids file file="$DBGFS/pids" -- 2.17.1