Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2252792ybt; Tue, 16 Jun 2020 00:45:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU4I0qAKUAr5t1XTWkiYJ0hAcW7uF+s/1E7gLUI1FJ0QV05/enSjUE3SEXZ1EybHAEqxql X-Received: by 2002:a05:6402:17ce:: with SMTP id s14mr1375459edy.53.1592293524593; Tue, 16 Jun 2020 00:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592293524; cv=none; d=google.com; s=arc-20160816; b=EJbySSZuMKmtrluwdcodTDXeuK8r/fZsqNblOzRSKH+8mAixLFCr7NynrXom8oKJaq 2RsGnTo7J0JepYOelDkRoz7rZ/AOda6uWqZLH9UHhatfJz/gz9XX1dDv5EdKxXiwv7EA wXCErnztP1u3QolbKSY/hml09TqO4nakPPdX9YINmN49H0fXKC18XKgvRNH6yvqMF1EB frNiBHhJjlJeaZGUh1OgML//4H0mL6n1HC3nWQhFNqW/A80cSCnliZv+pODhBSu/d8eL ek+z19pw1VWM10WnjyINSYBrBIx6bu5ljwQeMCvIf+ODV6Rgk+ERyyAs5oucauQ8aqi/ Iu8w== 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=bgHZ+qjtr1sKMn3USf0eN4byXg0fsmojOiQrB5bD9lQq5Lz5TNcGCNeIRxPq6xv/V0 tYPnwCVU6I8dOSGqFGj8uc/4Oc8inzBfIuk4zfuEw3+ipQEcBXHYM1Dmg6oZ9OhMRM5/ b+NNXzIK50t4dlT7mF7bbgJk0kYDmJSDjy+YSTBztn88KawrCsYEqQbw+Bt/IfYDrOAt xZtLlQvYBOONouNJkjoelZGMSFqReY4E/yPsyZ/1XOw+LTkRy9QGgopigW3Lt85dlnHr 14r4rSqWagK6EewkOR6VbzWgsE5i6ONMmzrI0/pZxVcJ5TCiWRZwqIwW+DXH9blbhHcJ N10Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=lK9++ixg; 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 lh17si10653548ejb.672.2020.06.16.00.45.02; Tue, 16 Jun 2020 00:45:24 -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=lK9++ixg; 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 S1726782AbgFPHmq (ORCPT + 99 others); Tue, 16 Jun 2020 03:42:46 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:14460 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725979AbgFPHmp (ORCPT ); Tue, 16 Jun 2020 03:42:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1592293365; x=1623829365; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=b5EEY//uUmxww4MeXLoOfsSYKFHirbB/BqQ/qTWvUzg=; b=lK9++ixg622wUO/YJFkFSykkef8F+w14sOIcRbpQtn3/7nXXH1gYgvGV kzAgTpdVNzYjRMr5G+A/VI48EyAf/0gaBLlZOKNllTayqoPpyjreMaI8X IfwSF8Xwi2WnMk2C6x2qo3z+ruSakcKj8HYB2FPXyd0+eewtY3lal/Ho7 o=; IronPort-SDR: H/u+W+vUKO4G7fygPyPmpLxoBDHRt++9XWCYl8brNZRXnr6pMTwemIBAdgP8MlRzXfG/Cl0WRf IpkNvcKyLYWw== X-IronPort-AV: E=Sophos;i="5.73,518,1583193600"; d="scan'208";a="52568506" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2b-859fe132.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 16 Jun 2020 07:42:44 +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-859fe132.us-west-2.amazon.com (Postfix) with ESMTPS id BE1DF22242D; Tue, 16 Jun 2020 07:42:41 +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, 16 Jun 2020 07:42:41 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.248) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Jun 2020 07:42:02 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v12 6/8] mm/damon/selftests: Add 'schemes' debugfs tests Date: Tue, 16 Jun 2020 09:38:26 +0200 Message-ID: <20200616073828.16509-7-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200616073828.16509-1-sjpark@amazon.com> References: <20200616073828.16509-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.248] X-ClientProxiedBy: EX13D22UWC004.ant.amazon.com (10.43.162.198) 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