Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1698904ybs; Tue, 26 May 2020 01:10:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaZRigzwYGzAkurT9AV4Cols3Ez5yHyte3tGywhlbVqy3WHqs0pakAdhz8l8pO/J+T4gCs X-Received: by 2002:a17:906:c785:: with SMTP id cw5mr63446ejb.543.1590480600506; Tue, 26 May 2020 01:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590480600; cv=none; d=google.com; s=arc-20160816; b=d6YZiDNfXny7whAUQFDFOWc+OzgjpUj/IAWuUjVMNaSFDfcTxfMpiO97oa+xiHAsi+ w+5z4xu+OcEJIV4i+BqQZX3RMaQjbBuPocnozMwoYwwSLMFnt+9lJFzHy25b4irfj00M 039rB5d7V3fsYnshaGiHKLA6s1hVkPRQO19cU6QbYgen/yr6GNqaT3aJykpjLZF4qup1 1IVXkQFw7xHWBtTPRDkuA1fY2F6sPq/KgMky+ZgDNx4MJHw7ZD8E0F3VbctIvKIMMROd ikXfbmxB0jwKVL2Rk46v0VmvtnIxn/pTZO1eNOeIJuuDgEMt4VR3LZkj8x//cFT+/D4r bxjw== 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=jN9jj+pwWOJMCwZ2PnZ9U6wM0yXrQA0PRQEbI22jWUfGnxwpRStH1k11gFrTeHMXej ElExBeD2300mwsM2g/d5QBN/MjL/qfRR7xrA8e6iVdJtbvgkjenXPnGw9dwmi0W9FyYE RJ+NXIPxrrUupb67TvlUqoGQBS/84A26VGnvmjR+Yb+LOp/xU+6ihd+zCXHD+4kJDV2+ 5EKhTXjuegAYlPVt/QAD9Ijkn9/lNb7pyTZDp4uP6Qjw2EjTHCRDxKpI7FnofPYNesGs HGqr3RuErkMwnl5p7ki4XfJBu/4KmzuBfzVXWb0eXJbgZUzBJ0VFydGjAcRsk17zG1LO 8S9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=kS51WY3w; 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 q6si11315924edj.601.2020.05.26.01.09.37; Tue, 26 May 2020 01:10:00 -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=kS51WY3w; 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 S1731637AbgEZIGC (ORCPT + 99 others); Tue, 26 May 2020 04:06:02 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:3845 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbgEZIGB (ORCPT ); Tue, 26 May 2020 04:06:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1590480361; x=1622016361; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=b5EEY//uUmxww4MeXLoOfsSYKFHirbB/BqQ/qTWvUzg=; b=kS51WY3wYdFV2isbpXSual6S4L0dTc1YeTMpXqcYXG4H66ujafeh8rZn JTV4ue6r+CmzO+aaGiR+jUyeAdTOrBydpaYi0LfQgrEUtyOZ/yCAAgkXI MZvvI/KByXgJIVLddK1jssbrThCKBYIbDTlpYMMu2TQGdM9vJBMnTgvaH 0=; IronPort-SDR: JGSgXW91GlHfvDpYgAJRisz/UJ9GoGeEZUhiLQtz7TQAioUa99AGJ723Stx848YZIKW3b6ZrYZ XjX4aRH0lNbQ== X-IronPort-AV: E=Sophos;i="5.73,436,1583193600"; d="scan'208";a="37617179" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 26 May 2020 08:05:57 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com (Postfix) with ESMTPS id 212EDA1BE7; Tue, 26 May 2020 08:05:45 +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, 26 May 2020 08:05:45 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.161.193) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 26 May 2020 08:05:30 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v9 6/8] mm/damon/selftests: Add 'schemes' debugfs tests Date: Tue, 26 May 2020 09:57:00 +0200 Message-ID: <20200526075702.27339-7-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200526075702.27339-1-sjpark@amazon.com> References: <20200526075702.27339-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.161.193] X-ClientProxiedBy: EX13D08UWB004.ant.amazon.com (10.43.161.232) 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