Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp253459pxu; Tue, 6 Oct 2020 05:45:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkPctqbEXcFm7ihR5uABq1AlJ39hYGhxlLwniQXF9zk0+903/7BdmzrvIsfrqs/wqzbVQb X-Received: by 2002:a17:907:94ce:: with SMTP id dn14mr3467336ejc.18.1601988311916; Tue, 06 Oct 2020 05:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601988311; cv=none; d=google.com; s=arc-20160816; b=voW0Se/C/NgTlJnSxp1TyYXQhuAp9sTC1RVi2SbwdFvw9/nBpMkwHZerVjeXutzfgT VWgYvDSUI0SrlMIWQFxGqBzX6HgbmssLXpFAPhfMFM0QFDPG5k3iXrLNJqEAFhNDQcSE xUjlMOqr7Z3u2txN9EC+mE1VaIgg1qqlu875t/Qu+K+0IZPfUUWwePEL35ch+wjBAup3 saDgSyEasb2/0GIrqgmPlt4T3NI9Ib0Erd0rk0ApzAmg9CtoYf57P6U65+Kupok70RgU 6+IjlQVIptRzgo2xaoi60iUxstM8tSvEpUobCc+8Bq8tDLuIWxklJqttMVvZFtnhdTFc xN+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=y54T24GyHij+L4YlC4ErOhrawn7/T9RzI2P4TOBHFCI=; b=QgJzT5gWARuDYegrgXlRNokyG/rK2A98VQkq+E3lKcxSrccnH52Oe/VfpVeM3WqjEm M+m1K3htO4ho1IMs9pvjwWXaW6oO2QTegkQuumHy66/V5CRub5itbAjuXbD8xQq+TMaY dynGx03dh2N+PhlOvRGR7IbLmitiY1L7brLCRSHd/PNoi46JyS11sCf6xxkKw43MUi8U RlLiqitR/WXeTNP2FImmSvylB5nocSCyzBnZPihvwkzXKYZfuqcu0UcQEbqWIIumqtD7 Pmmkpv5nGDgghSH/6s3IS8s2HSlSdTxLSfkaLwg5vLassrF+X8NAzcK3SEuKiS0Daoy9 AyJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ZofapYT4; 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 q22si2289199edg.439.2020.10.06.05.44.49; Tue, 06 Oct 2020 05:45:11 -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=ZofapYT4; 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 S1726709AbgJFMmp (ORCPT + 99 others); Tue, 6 Oct 2020 08:42:45 -0400 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:1028 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgJFMmp (ORCPT ); Tue, 6 Oct 2020 08: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=1601988165; x=1633524165; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=y54T24GyHij+L4YlC4ErOhrawn7/T9RzI2P4TOBHFCI=; b=ZofapYT4slZm2rsIBBXLQro8tsrHWh0f/20UY0jCmU4KkLUVGIwB+FfS mlX+1xuAbQSElQ0SZejRU8MTxV3t3DN+PHpImX6F9hLx5vwiyi8k7+O3R B9EnGQdXs5cUZ03Obzp7bbR+MgYR8jDyeeBWkWVJaJduAROBNQHRPzIY8 s=; X-IronPort-AV: E=Sophos;i="5.77,343,1596499200"; d="scan'208";a="58084622" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2c-c6afef2e.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 06 Oct 2020 12:42:40 +0000 Received: from EX13D31EUA004.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2c-c6afef2e.us-west-2.amazon.com (Postfix) with ESMTPS id E1353A1BDC; Tue, 6 Oct 2020 12:42:37 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.161.237) by EX13D31EUA004.ant.amazon.com (10.43.165.161) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 6 Oct 2020 12:42:19 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v15 6/8] selftests/damon: Add 'schemes' debugfs tests Date: Tue, 6 Oct 2020 14:39:29 +0200 Message-ID: <20201006123931.5847-7-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201006123931.5847-1-sjpark@amazon.com> References: <20201006123931.5847-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.161.237] X-ClientProxiedBy: EX13D18UWA002.ant.amazon.com (10.43.160.199) To EX13D31EUA004.ant.amazon.com (10.43.165.161) 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