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 4BF03ECAAA1 for ; Thu, 15 Sep 2022 09:02:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D198C6B007E; Thu, 15 Sep 2022 05:02:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C52048D0005; Thu, 15 Sep 2022 05:02:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF2C68D0002; Thu, 15 Sep 2022 05:02:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A1E156B0078 for ; Thu, 15 Sep 2022 05:02:18 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7F8B2140C78 for ; Thu, 15 Sep 2022 09:02:18 +0000 (UTC) X-FDA: 79913728356.29.7961ADA Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf18.hostedemail.com (Postfix) with ESMTP id EC5871C00A4 for ; Thu, 15 Sep 2022 09:02:17 +0000 (UTC) Received: from canpemm500005.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MSrgj4ZpPzNmFg; Thu, 15 Sep 2022 16:57:37 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.63) by canpemm500005.china.huawei.com (7.192.104.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 15 Sep 2022 17:01:49 +0800 From: Zhao Gongyi To: , , , CC: , , , , , Zhao Gongyi Subject: [PATCH -next v2 2/5] selftests/memory-hotplug: Use 'printf' instead of 'echo' Date: Thu, 15 Sep 2022 16:57:54 +0800 Message-ID: <20220915085757.258608-3-zhaogongyi@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220915085757.258608-1-zhaogongyi@huawei.com> References: <20220915085757.258608-1-zhaogongyi@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.63] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500005.china.huawei.com (7.192.104.229) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663232538; a=rsa-sha256; cv=none; b=A4Og14Ub7dIv0xfW10EdGxOdfQDRYn0Jw0azaiMsFAxa8odx3CDbWnCHbv72ukK2tsWYU7 UnoWOLrj2kqRF+IyotwuiwXpkGu6iTTlgOT9A7gFRqeB7SCAO9rm+jqr6C9uRkgczBLgwt Nk6KZC8/DugFdAg/Rhjcgc5YQ1WVt7Q= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of zhaogongyi@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=zhaogongyi@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663232538; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ptvVmzSrRdAVQwrzWIZgnRsScC39RT8DiiEWXDbw1TY=; b=X6eA5oqqnYCFqqHjXEtml2P59t81nfwiRN72fSdms9g75T709rEP8sloh8fR+Slo53dXIk yEz+yvUoBrVYtNMcXvXATvuu0kKKVv6ooim2ZvPspeIKwHsASrJePSTOEm4POnQg7Gctw+ SaKlreOkfnJRzCKaQUzxezLzWFza/H0= Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of zhaogongyi@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=zhaogongyi@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 3drbyrnhwnihu113mj3j65e3cu5uifxz X-Rspamd-Queue-Id: EC5871C00A4 X-HE-Tag: 1663232537-220454 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: Fault injection uses debugfs in a way that the provided values via sysfs are interpreted as u64. Providing negative numbers results in errors: # sh mem-on-off-test.sh ... mem-on-off-test.sh: line 267: echo: write error: Invalid argument ... mem-on-off-test.sh: line 283: echo: write error: Invalid argument ... # Signed-off-by: Zhao Gongyi --- tools/testing/selftests/memory-hotplug/mem-on-off-test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh index 46a97f318f58..f1a9d81b934c 100755 --- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh @@ -264,7 +264,8 @@ done # # Test memory hot-add error handling (offline => online) # -echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error +printf %#x $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/erro + for memory in `hotpluggable_offline_memory`; do online_memory_expect_fail $memory done @@ -280,7 +281,7 @@ done # # Test memory hot-remove error handling (online => offline) # -echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error +printf %#x $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error for memory in `hotpluggable_online_memory`; do if [ $((RANDOM % 100)) -lt $ratio ]; then offline_memory_expect_fail $memory -- 2.17.1