Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp365028pxa; Tue, 4 Aug 2020 07:29:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh2U3DhIB0KiOO6MWDjF11aW7p6Wbx5Mo6E3x9gdHKf5E5O5zOC5gj3oqBBvQeU3CjkpWF X-Received: by 2002:aa7:cf06:: with SMTP id a6mr21662557edy.293.1596551363627; Tue, 04 Aug 2020 07:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596551363; cv=none; d=google.com; s=arc-20160816; b=CtN9T09JOxNBR8ypOtQg4MP3mTZihDcrtRE4qQh0ym+2xfGhe4/Nl9zclfmRu1otH7 Q/crm4XZCRDIbsPxG+hKcAr7Nb+B3lHtrFy4sccjKF3KqxHKlgyVt6Ld4kLBxiSwkfqZ SZJT5kw5KtBT/50dyRbgO/EAxsWew6+1wbtR0+0hxGOTwWxCwfTOhER36foANJAfkydZ 4t6ac8fMUfASf2q540Srs6BKNWD75bzA83NPWx9aCzzWcAoseG38dYFJvXcjrC9sqvKU dhYcCd3wJMio4OOOEKLGGdLM3zhSQM94a7YtDEEr6ONYqvOJus7o49MauHvCO5wOs6mS rU1g== 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=y54T24GyHij+L4YlC4ErOhrawn7/T9RzI2P4TOBHFCI=; b=Q82O11E08YJq0cZ7t+4SLVDnYmMP/E6o9F3c2HQ7LtLpjp5E9LtP6eyOwNY77qJLFK cGwSo+2snUupxq0F0T8NiT+1SGhnNzyuwOSbbCDFyGZFhph5irqeUMvqnn8Cy3XGbrw1 P0atvp6+/YI0jPhOvh3Xun8fi8Bf/bZ+RSubFZotOExk0F4fUqJgpgP3kuy4+Jlm0fhA xjyxjlGI30Oqyh2wbmXNrOKt6UmJQXu8SG6OZTOc7elIpUppjSKA9y/+wbxA4XUa74ha hkUKcCoWZ0i5ZqrY6Oqd4K6ogIk/4wm+5bSGsq3vvGoFg16nfksRrua9rh0xJTcEieBk iASg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=JVkDrcyv; 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 m14si12005002ejc.239.2020.08.04.07.28.46; Tue, 04 Aug 2020 07:29:23 -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=JVkDrcyv; 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 S1729161AbgHDO0z (ORCPT + 99 others); Tue, 4 Aug 2020 10:26:55 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:4046 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728911AbgHDO0n (ORCPT ); Tue, 4 Aug 2020 10:26:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1596551203; x=1628087203; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=y54T24GyHij+L4YlC4ErOhrawn7/T9RzI2P4TOBHFCI=; b=JVkDrcyvw8n1tc4n8Qck03RZj6fRFEkRV8mHdpz5gFbYj+GSQycua0sJ NCz2x4wAn9tncFTfRJxhfJtksSmQx7mCxaCWVJ3EXO9WTcz7hfUeYbp25 8et2owlvJRYR+VXI6Fi6uDUiEwUAtoBBx4DBUAm2PpZm5Zer0TKUgm4g7 o=; IronPort-SDR: UtloN8/oEEd/c7fRvmj0wLTBbHDXdFb2EMt1jw92lBVe43QtV3epX1n+gGuLRujMlC4S0PZGPf ootihV4JwJIg== X-IronPort-AV: E=Sophos;i="5.75,434,1589241600"; d="scan'208";a="46072520" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-4e24fd92.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 04 Aug 2020 14:26:39 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-4e24fd92.us-west-2.amazon.com (Postfix) with ESMTPS id C0255A16A1; Tue, 4 Aug 2020 14:26:36 +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, 4 Aug 2020 14:26:36 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.161.203) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 4 Aug 2020 14:26:19 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v14 5/7] mm/damon/selftests: Add 'schemes' debugfs tests Date: Tue, 4 Aug 2020 16:24:28 +0200 Message-ID: <20200804142430.15384-6-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200804142430.15384-1-sjpark@amazon.com> References: <20200804142430.15384-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.161.203] X-ClientProxiedBy: EX13D17UWC004.ant.amazon.com (10.43.162.195) 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 c75557e8ba58..61fd3e5598e9 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 target_ids file file="$DBGFS/target_ids" -- 2.17.1