Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4213365ybb; Tue, 7 Apr 2020 03:04:53 -0700 (PDT) X-Google-Smtp-Source: APiQypJ8DYh/G9DBlNAxe93UFiXhvmZbHNQQ13qBPQGSzVvh0jDb4UJ0P1wQ4W5DuwUqxPlZPtfy X-Received: by 2002:aca:b144:: with SMTP id a65mr1052336oif.75.1586253893032; Tue, 07 Apr 2020 03:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586253893; cv=none; d=google.com; s=arc-20160816; b=fNLMmYIttLDabOvK+tiNVooZ1SWmPo2/5LxItJA3X15+mQ31XK1q6Hl4WF/+v5O2Lt W411XqRQk2T3Rm7qWN3RmRy9plKkuNF64At8ZwyflrNGUnVdWdxfYQOaX5ixjtdQdtal lru2uA9K0KXL2LePAsXF2GqL/2oL27/bEEkD4E9PjSnXkSalGCliqQzGgIaHra1IIch4 FMr94oRGjTdcmMcFKDgRURVxwX1k/EQnUF5QtxvvrNkNDpS6Na0Qj4XIxPER9Kjvl8LE Dqw7oAzQ6Gp3WN/CswjLY/1tSdVlTQ5Uxm26m8QMkC8/JeIAy56uDxqcLgSJMvAG8CKF tKKw== 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=AfZdgosPLkgxDYx/vttdIDHx6gLMDj6EfkdVr1Nl7z2UHPBmWN87vnV4OwlZ/yFQ3Y Ccw8LF/05rjsdtfWay3prJI6QGY5JhJiksNaKxnUaDWoJkSQBoQwjYuz4pP5n0Z4ZggQ sYxml77y58sQ2igbkinXRJq0jB1nJc1oaDaAVH1huX7C/ndb1VCiNVjAsF5tvFH7JHqR HR0AErtTV3HaoCoxAvXjdx+xsKP1tc3jIF2mY6fAQnxuRST2p/xuQfSE7KVUE0P9ynlE 7qXI2CTmLoUm1kn2Kh5eZiAQza+WH0jkwypSw6indADShC48aGLzRUqB8meOpkKo2wVW Z8WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=VcfS6OnG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id s199si448941oih.169.2020.04.07.03.04.41; Tue, 07 Apr 2020 03:04:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=VcfS6OnG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728250AbgDGKDX (ORCPT + 99 others); Tue, 7 Apr 2020 06:03:23 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:60909 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbgDGKDX (ORCPT ); Tue, 7 Apr 2020 06:03:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1586253804; x=1617789804; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=b5EEY//uUmxww4MeXLoOfsSYKFHirbB/BqQ/qTWvUzg=; b=VcfS6OnGV91Df67jFDzWiv+rmJX78Egei8q94b62DLcyhj28amVRREyB KUunOQ0MzKYgUOr54bdySTFw32Kzk8XmRMB+NpqUCTnHTOdZM7ki5lo58 XjNogahB7/9EFCVZL6sOqXKIlRoCi8cvJeFl4yj8uELw7xRfhsLY0pFPF 8=; IronPort-SDR: w/NPdx/m+BFA8SjxwJvJxcYrL3HELj3QS92tNcWew1/HoTt00/+0lxaEC6zPKN0ToZ5R00Cb9P 8ssK59Q8AfTw== X-IronPort-AV: E=Sophos;i="5.72,353,1580774400"; d="scan'208";a="37096941" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2b-c7131dcf.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 07 Apr 2020 10:03:23 +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-c7131dcf.us-west-2.amazon.com (Postfix) with ESMTPS id 76576A187B; Tue, 7 Apr 2020 10:03:18 +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, 7 Apr 2020 10:03:18 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.171) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 7 Apr 2020 10:03:04 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v6 6/7] mm/damon/selftests: Add 'schemes' debugfs tests Date: Tue, 7 Apr 2020 12:00:05 +0200 Message-ID: <20200407100007.3894-7-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407100007.3894-1-sjpark@amazon.com> References: <20200407100007.3894-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.171] X-ClientProxiedBy: EX13D34UWA002.ant.amazon.com (10.43.160.245) 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