From patchwork Thu Jun 29 23:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 114484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9984880vqr; Thu, 29 Jun 2023 16:43:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7THzs6Sn//wQ2c6aMBl7ffW65POygC+I1Js2b38bd61njmk6p9EWI8mu6DzBste3lUPUid X-Received: by 2002:a6b:c897:0:b0:780:cb36:6f24 with SMTP id y145-20020a6bc897000000b00780cb366f24mr1216216iof.2.1688082216383; Thu, 29 Jun 2023 16:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688082216; cv=none; d=google.com; s=arc-20160816; b=aYPyOh+fa0vu2UsKPvYiDomyQ12fK66S6BImXI8rZu8ZERuWDdqCpUZyRvuhVkSciO zfd41kZQjp1HO7pPY2za3D1SyQwXLrim6QVx930okzlHGNaRm6EqQaI0jzEzIeA/xsv9 xzWMuUceDCfrcIBEq1xPJIsbatvZjtOsGrDSSvwbtyODw86f6Yh+wiAa1PWoX2CCxGMv yB3l6Ww0UF2UcgPTrU+izNoEryAY01AEeM6/uQ7qv4yZuwCGO9D/wo7CqmI4tkQgCcgs HGAH7Q0+hAjq9CM8Zc4m7RdTBepy3DCniIpVz1C96bJbmRJj2WE+qHCAysebmArNcYqU 8qFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=4bjDI+xCO6zCjdxMmYEm/USzb7hvzifsJf3AcnsnP7I=; fh=GzghTQzqgly4pZn8BwQ4U8bZ8zCadAK8Sl/utskeyEs=; b=X22kPzz7qE4yuecF34I2p0D7AYp7ggQJDCD6uPw+HSyckKuaetmmU6a+WPk11okir0 06F7jrDmyZ6XjiXM5FVgwCZf5o8aWepc9EzsUySiGT3SNdMCiNekDa1IkFTIHaSU89GF +RKgok9rk3w1+xlh/JPZrgT/lpM9zAwZFBdTaIMP4g6H02G/+VhC3YntG5SL1WPyxrMK AaTbRxjBkvBIL/snurouKBXgizw1r9hdhwoOrzREgv7C7dhpw7s6YLSebQr8pfk9L4my oajh0WXEvoQU3q7iYFAJTzdvhsp+YH6Co9nnEP2bBe2/EnSEIPZKPejnCYdR1r43Zpv2 BC/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a654485000000b0055398c3184esi11489596pgq.6.2023.06.29.16.43.21; Thu, 29 Jun 2023 16:43:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbjF2XgM (ORCPT + 99 others); Thu, 29 Jun 2023 19:36:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjF2XgK (ORCPT ); Thu, 29 Jun 2023 19:36:10 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D3A51713; Thu, 29 Jun 2023 16:36:08 -0700 (PDT) X-QQ-mid: bizesmtp64t1688081757tnqk2bme Received: from linux-lab-host.localdomain ( [119.123.131.49]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 30 Jun 2023 07:35:56 +0800 (CST) X-QQ-SSF: 01200000000000D0W000000A0000000 X-QQ-FEAT: 3M0okmaRx3jzXUNZYCjF22Yt5q5NFwMgmhuWKlNMBfQ9f40ThEIsT/5lI1O4U WTU+lHNIjWl6hrnW7p4jSjiM7agpdRFqQPOYCLhDNV+lu8Gw8Ix+6NWlvPgvzPOA03J22Hs xnOaKbUZegQkWE2vf+3+hpyASl6yde1FbI7BjKOd3RWr64jv3jC7X/FKkiY+gbl0I2iV2vp abwjKmGuqvzJszYtKQcASRVuIKUcNRXdwsuK3jMwUIECfGliZDnizInZnNeglxZ0Hh15PpQ 9Zdle0TebbOIE/kaNpct8qijh366/xn6vycmfsA8M9NqWBuOsRh5KNxHkAp2Lfpk/7q+4HP 20AiePlmwg77191+LbqegPp1akzdiPRWn4wvBFR5rBZWkLxit/0Xzf4+I2sfQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 10916663048857480056 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 06/15] selftests/nolibc: stat_timestamps: remove procfs dependency Date: Fri, 30 Jun 2023 07:31:33 +0800 Message-Id: <6fae777966cf710321a8d8369a9194e00b72ecf6.1688078605.git.falcon@tinylab.org> 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770082497941165308?= X-GMAIL-MSGID: =?utf-8?q?1770082497941165308?= '/proc/self/' is a good path which doesn't have stale time info but it is only available for CONFIG_PROC_FS=y. For CONFIG_PROC_FS=n, Let's try '/init' for initramfs and '/' for the others. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 223c00e83abf..1d2be52d44a5 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -582,7 +582,7 @@ static int test_stat_timestamps(void) if (sizeof(st.st_atim.tv_sec) != sizeof(st.st_atime)) return 1; - if (stat("/proc/self/", &st)) + if (stat("/proc/self/", &st) && stat("/init", &st) && stat("/", &st)) return 1; if (st.st_atim.tv_sec != st.st_atime || st.st_atim.tv_nsec > 1000000000)