From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19789C433EF for ; Fri, 10 Dec 2021 22:53:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A0DC6B0088; Fri, 10 Dec 2021 17:47:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 64E736B0089; Fri, 10 Dec 2021 17:47:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53E3F6B008A; Fri, 10 Dec 2021 17:47:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 461676B0088 for ; Fri, 10 Dec 2021 17:47:04 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 171D48249980 for ; Fri, 10 Dec 2021 22:46:54 +0000 (UTC) X-FDA: 78903371148.25.EE3CB1C Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf20.hostedemail.com (Postfix) with ESMTP id 298811C000F for ; Fri, 10 Dec 2021 22:46:52 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D1694CE2D7E; Fri, 10 Dec 2021 22:46:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31AC3C00446; Fri, 10 Dec 2021 22:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1639176410; bh=i3iVDPV89gphsAABrhY9Ycqi2ruK+fz+sfEkcrmmibo=; h=Date:From:To:Subject:In-Reply-To:From; b=ci0sz+TOKXsLH0tr4ls8q8JvbsWau+Vk+3/0dzE0+hOoMNCRsn8BJRj2N+PM7B+xd f0QGM1CjHwwPQnTH+lC/oF5N/ne0wT/rArzGhtPyF74GVksV1d5hijJe7fBPArVF0h lP9bl3d0bmfvvkm+Ff+8GmOB8GgKLIHiZprpxVJk= Date: Fri, 10 Dec 2021 14:46:49 -0800 From: Andrew Morton To: akpm@linux-foundation.org, brendanhiggins@google.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, shuah@kernel.org, sj@kernel.org, torvalds@linux-foundation.org Subject: [patch 14/21] selftests/damon: test DAMON enabling with empty target_ids case Message-ID: <20211210224649.ZcRmEwxc7%akpm@linux-foundation.org> In-Reply-To: <20211210144539.663efee2c80d8450e6180230@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 298811C000F X-Stat-Signature: x4yc5p8cqgx94roibwxknx8stbzhnupa Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=ci0sz+TO; spf=pass (imf20.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1639176412-599454 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: SeongJae Park Subject: selftests/damon: test DAMON enabling with empty target_ids case DAMON debugfs didn't check empty targets when starting monitoring, and the issue is fixed with commit b5ca3e83ddb0 ("mm/damon/dbgfs: add adaptive_targets list check before enable monitor_on"). To avoid future regression, this commit adds a test case for that in DAMON selftests. Link: https://lkml.kernel.org/r/20211201150440.1088-9-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/damon/debugfs_attrs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/tools/testing/selftests/damon/debugfs_attrs.sh~selftests-damon-test-damon-enabling-with-empty-target_ids-case +++ a/tools/testing/selftests/damon/debugfs_attrs.sh @@ -94,4 +94,13 @@ test_write_succ "$file" "" "$orig_conten test_content "$file" "$orig_content" "" "empty input written" echo "$orig_content" > "$file" +# Test empty targets case +# ======================= + +orig_target_ids=$(cat "$DBGFS/target_ids") +echo "" > "$DBGFS/target_ids" +orig_monitor_on=$(cat "$DBGFS/monitor_on") +test_write_fail "$DBGFS/monitor_on" "on" "orig_monitor_on" "empty target ids" +echo "$orig_target_ids" > "$DBGFS/target_ids" + echo "PASS" _