Received: by 2002:a17:90a:3541:0:0:0:0 with SMTP id q59csp354648pjb; Tue, 9 Jun 2020 00:00:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeP71lQ+ovZtlcETQbEqN3Pvb9z+ngy1wQbILSjmChyCYxYciK56SBQC38Bo7wnvwVGNnH X-Received: by 2002:a17:906:af84:: with SMTP id mj4mr23255742ejb.473.1591686039608; Tue, 09 Jun 2020 00:00:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591686039; cv=none; d=google.com; s=arc-20160816; b=lLKVgCGJ+X4+bGbKKU1ao4sJ5RRQC/fsAes1NbuVTqQZ1UANd3VrPh4b2tdp6I95TX YuhtW73jvLT2mE2pm8Vb8x9VYl7ghUghnRb7JU9vGYTGxqbDOQyqMQioM8/OGcZf+BEn wTcKKlukP5y9JbbxLCMzy9VlrLQvG7W8OIhb3FrtBWOf9gi2rPyrWxw2ho+gvXr/j4BP Ha/ra5/ZOjTMsM2NFcNenOfYSo3HTLpJ4gsNo8HukSgInGRxZndHy2MJpOxj7PkSxGFZ ehW20tU0f1cD0EERyxFZqU0S/Oq3CPSo9s8uJ3qp5B43uV2u8MUhPYDSsT7OM9QV4A+Y CyRQ== 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=I/oyQtngU14gxkxiZD0fC7KzWzafRP2xliXP382g/FrdEwg6VwqMZOhJTiEWsRUc1B vKbiLxq46mPcerYAA3SOOAZdMWqGy93K5FdkJkOmJ/6V9vl7Wmtp6sbxr3ojS/A+CZ4p OQi7DKLhNWOHU0nkaMQ+y5U95QWFd2Z5gJT4EhZEmgJu7UUQabVxvED6fsPwKIRgJlqR 6gqQk7c3geBe1QieYRW2zU7hHIBmcVOkXHrBlxyCkgQsWKnds9M3sDscQRtOAmsVt5cF Y3PQo6+HbgmgWVW7I1rZphe+2KCK9MDnBC/j6Qt7XxI4LENzsoaojZWJ+k07JpO9gok5 uulg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="m5Hw/goZ"; 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 qh14si10550874ejb.259.2020.06.09.00.00.16; Tue, 09 Jun 2020 00:00: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="m5Hw/goZ"; 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 S1728053AbgFIG4h (ORCPT + 99 others); Tue, 9 Jun 2020 02:56:37 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:22292 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbgFIG4g (ORCPT ); Tue, 9 Jun 2020 02:56:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1591685796; x=1623221796; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=b5EEY//uUmxww4MeXLoOfsSYKFHirbB/BqQ/qTWvUzg=; b=m5Hw/goZHWUb6Q6V1SVqSKzufXgj++Uv0KI4W5qtm/rs50/53c4rw9mh APjUGlM585Sk7Uqq+YXQn4R7xp8KRSglZvG4eEBzXhN+Lb9KpO5UX7Pxl 9AgsnbkS00HGmkhhFxpIueWu6FSE5Ju1m8qR0VIrqBhXu52c7xlTri5W+ U=; IronPort-SDR: uVD0q5e5ywgiQdJu5uIEkbBK/8YLJmjyNX/kwd3+/75AClm//1JZYcd4vSVZCdHJSMWZ4em8BT EriRU/+7/bGA== X-IronPort-AV: E=Sophos;i="5.73,490,1583193600"; d="scan'208";a="42579298" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1a-807d4a99.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 09 Jun 2020 06:56:33 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-807d4a99.us-east-1.amazon.com (Postfix) with ESMTPS id 06438A1CEB; Tue, 9 Jun 2020 06:56:21 +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, 9 Jun 2020 06:56:21 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.53) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 9 Jun 2020 06:56:05 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v11 6/8] mm/damon/selftests: Add 'schemes' debugfs tests Date: Tue, 9 Jun 2020 08:53:18 +0200 Message-ID: <20200609065320.12941-7-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200609065320.12941-1-sjpark@amazon.com> References: <20200609065320.12941-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.53] X-ClientProxiedBy: EX13D31UWA004.ant.amazon.com (10.43.160.217) 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