From patchwork Fri Jul 7 18:38:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13305165 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BF48EB64D9 for ; Fri, 7 Jul 2023 18:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbjGGSjS (ORCPT ); Fri, 7 Jul 2023 14:39:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbjGGSjR (ORCPT ); Fri, 7 Jul 2023 14:39:17 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA4832684; Fri, 7 Jul 2023 11:39:14 -0700 (PDT) X-QQ-mid: bizesmtp62t1688755145t75gkm14 Received: from linux-lab-host.localdomain ( [116.30.131.119]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 08 Jul 2023 02:39:04 +0800 (CST) X-QQ-SSF: 01200000000000D0W000000A0000000 X-QQ-FEAT: KvvwR/hcPA3zMYK1CcceBKsYTp/4/3pjRiGuKwCnZov/MPcdg6J8HujwWwHn5 /8+dmG2yvIOgNqB0jCgFmPi5Ha91Smk+4wKn891hXp8XbdYOjS79GGq20AcOIqAKxPAl8/0 4Cz0RXglli0Mvtl8Yq9J6jkbxTgmjSd16/syAnHj5NP8vI2kdNHnj4e5lM/CiJjdEv/GHL+ 97VoOznzLptB5D3ml4BUFJHo4EbLyPAS4mFOXcyXji3b9CNlU5SCnSwGILew7dI1cBLOl8y HhUDN+VuesWus3Y8xdcf3anZt6OUgJrj69kSKyIhv8LnqVl7ZK36w1QsGhaH42/m1v3jAcz gnjSZjbRmd4zusUN7+Bcc0TlLy63T2l89IpnXOhwe1rNEufsfDLVAoqfiFX6g== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 13821968345218044229 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, thomas@t-8ch.de, =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= Subject: [PATCH v4 13/18] selftests/nolibc: prepare /tmp for tmpfs or ramfs Date: Sat, 8 Jul 2023 02:38:57 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org create a /tmp directory and mount tmpfs there, if tmpfs is not mountable, use ramfs as tmpfs. tmpfs will be used instead of procfs for some tests. Reviewed-by: Thomas Weißschuh Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 5497ee86cf40..6b863f7b677c 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -1063,6 +1063,10 @@ int prepare(void) } } + /* try to mount /tmp if not mounted, if not mountable, use ramfs as tmpfs */ + mkdir("/tmp", 0755); + mount("none", "/tmp", "tmpfs", 0, 0); + return 0; }