Message ID | b862299c4d09639024cebd64ba4cec04dcbdda6a.1688134400.git.falcon@tinylab.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp10437826vqr; Fri, 30 Jun 2023 08:06:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlFr/2+ACKdvEb1QBkrAbRfYQYixiyU1mLe/o1JKuq5ddW+6WlY9BIlrxhQ9Ynz+20INUxdc X-Received: by 2002:a17:90a:19cb:b0:25c:2c56:a8ae with SMTP id 11-20020a17090a19cb00b0025c2c56a8aemr2101288pjj.19.1688137585308; Fri, 30 Jun 2023 08:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688137585; cv=none; d=google.com; s=arc-20160816; b=OP8rGUKMs/sCKZBvXjUYGrD89rMdOvvtSWirM9EOiNlgE1AWwAH3xU47hTahaI5Rwl O5bVjPX93qjdZZFrG2xExrZbU2VuqS1KHgKf0k8c1xX20mNuWrgf3wKF/sYexJEcekqf olWfci/xE15FYBaz3lz39Y1VILw4bJf+GZZSBY8pVzxP0Dla88yVMa6zx6SjjtGV7xM9 ER+PnCN/qYMtl7KN1RXSPKhAYGhGWVKl/QIsOv1KqwbAhRxtRer479dNJt66u6Yc0h4r dNMPkp/v8aL6k/TBaqij46zj2rLGKZnVn8RrVw78GweNzJZxBY+x2mSw8/gfsE66qhYk HeKw== 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=sCmHm9vvItUvT5rBa4b4RIRk5qbBHJnEumvqZ4kkkXo=; fh=49fx4+cYYT2jkB1G9v6CSOY1nO+RV0JwAuF3mNCzENI=; b=hQ6C0aVPvB5NQX16GTMyWYOMCpmE2olq7ntnUX2MMncHq0rTPibA5R5zdHuSYNPskH N/Qm7FjME/NuhbhlPJaw52g0weUGJTxs6W6R3xTDixsV+esmLGHw7hWTcbfyACQ7LXfY 9x/Su3MpQHTbv7lqOeXhl3XJXohAAuvmaVMac/i7d6k9ujU5xgLTfZdshGIe4mK47m1o X8CmrNi9/BLEtO+X4o1hT57dM19D5zNBx96gMdXozX5K5BYmPKiUrSCsEdScIq4rG67K oloNVQh8I95zXAcCVhlhJ0+Ju9jcY0CMpcwZdRa9GCK8Fx0zw1ekD4IlyeHsTxiCukyJ 2YBQ== 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 g2-20020a17090adb0200b002637eb7c214si1377250pjv.80.2023.06.30.08.06.09; Fri, 30 Jun 2023 08:06:25 -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 S232564AbjF3OtW (ORCPT <rfc822;nicolai.engesland@gmail.com> + 99 others); Fri, 30 Jun 2023 10:49:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231633AbjF3OtU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 30 Jun 2023 10:49:20 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 901F1171E; Fri, 30 Jun 2023 07:49:17 -0700 (PDT) X-QQ-mid: bizesmtp79t1688136546tlj7qf2s Received: from linux-lab-host.localdomain ( [119.123.131.49]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 30 Jun 2023 22:49:04 +0800 (CST) X-QQ-SSF: 01200000000000D0W000000A0000000 X-QQ-FEAT: 3M0okmaRx3g9FGi2GrgTbWso5GF6j8mNsD9EEsYEj3ftL3NfDx/gEJX7AasWI CPaZaB2hzz3UmKC905zXg3WZwZ/Pw8rlRzBujXkhDTXYkh+YbYwSztk4k6xvNeu9EMYDvqR pDfa64sh3NeBr7EAWIkZNcfeZrzAsJypzUp1XO4zgsmJe1AG68vgYEJP26yaLpVilzLQZ9Y oO1l2vlTBbypgl1CmH2nZDniqAuJ0zeA+IVhPQrdCwEginvotjXC+2BworCYimBtNJA3G5+ BcAHRBl+oWwFN04U4O8qGTPLocpyuS8ryGlfskhNRpPNKLYqrWH8iXGH+URyc2u9ZyYPtdN /GALQMhWZ5ODi9MtWkTD1/AFWcbPSvLRtXY5Uzf31pL9JmzUf8Cthm5LabQgXgFbZGcNDs/ X-QQ-GoodBg: 0 X-BIZMAIL-ID: 519475413023589342 From: Zhangjin Wu <falcon@tinylab.org> To: thomas@t-8ch.de, w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> Subject: [PATCH v3 06/14] selftests/nolibc: stat_timestamps: remove procfs dependency Date: Fri, 30 Jun 2023 22:48:22 +0800 Message-Id: <b862299c4d09639024cebd64ba4cec04dcbdda6a.1688134400.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1688134399.git.falcon@tinylab.org> References: <cover.1688134399.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770140557010937479?= X-GMAIL-MSGID: =?utf-8?q?1770140557010937479?= |
Series |
selftests/nolibc: allow run with minimal kernel config
|
|
Commit Message
Zhangjin Wu
June 30, 2023, 2:48 p.m. UTC
'/proc/self/' is a good path which doesn't have stale time info but it is only available for CONFIG_PROC_FS=y. When CONFIG_PROC_FS=n, use '/init' for initramfs and '/' for the others. Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Zhangjin Wu <falcon@tinylab.org> --- 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 94801961740a..3e2e808e06c2 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)