From patchwork Wed Jun 21 13:11:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 111017 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4366043vqr; Wed, 21 Jun 2023 06:31:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+HdN+4Bn57/u6Dkp/CeKIpcrq7zEB+mlz6FZPOMOfH/vxEhRWxRJXALLK2uCsFvhfHYkm X-Received: by 2002:a05:6a00:1814:b0:668:99aa:3f17 with SMTP id y20-20020a056a00181400b0066899aa3f17mr5116913pfa.16.1687354268000; Wed, 21 Jun 2023 06:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687354267; cv=none; d=google.com; s=arc-20160816; b=n0UvllgsDUUpTFUkCj38YiFF4kaAO97K0N+8phGeqVYW2pyJOty7jvHq2TYYKI52At XvpoIr/RT5JdPe/hZYMMkFmKcSWuVJRDVCj4qCMV4ekzAl98fJ7ToV1/d01dLDN3oWN2 I+nWG48CG7dvYazJF93KnC0gL8iZp9cH+1A1n7bzyrAZjQbXxXfc4w2giUyzMjOEWxZE Sy5aCyqfGqYHs72BJv8jvXAx0ogfYLyTs0Ayk03+kYV0YZRss+yongtMxXau9EjT7aVW 872M5OWssmPbjClZiY09njnVjAW+dgKyJR7Y6wHVQHyKdy5PKPAP/eTREuf3a4bERdI1 gNJQ== 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=z9TGvPI1Jwnlu8JlCE3cWaoPymRCO2z5SnBhn9eJ8IY=; b=vrR5EFrThjqD9HZGyNUFdbE/z2/ZJrwqVusriNMw23Lh0jGJt9Igp2uAPYQiSCud6C A6KugM4BUTjzg02yCSgxVhFAQ0zIPDFeRAB9n803d3054LTnUQ5f7yrugdhUc1p7aa51 nM1+nV8Vqsi8Y/i+cQ3v4Zjle8RKS5vTVl7WrtBwc0/Jh3gPl7vhsEIc9bWqLp5b5nrv H460o6nYwjHkdwBr0yCGZ/PXtYtQ2HZJBsmRRKMJ8Tq6Qw7YIfQyn74AbFwtUqT2OsNY G14FY9l+5UmDtdW4NiQOKrmskfXueJqbk9B+1DFTMZ/VMuUTe+kKG79tReoYNzl2MWPQ avXA== 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 i190-20020a6387c7000000b0052c2904e37dsi388286pge.362.2023.06.21.06.30.48; Wed, 21 Jun 2023 06:31:07 -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 S231183AbjFUNM3 (ORCPT + 99 others); Wed, 21 Jun 2023 09:12:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbjFUNM1 (ORCPT ); Wed, 21 Jun 2023 09:12:27 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194EC10FE; Wed, 21 Jun 2023 06:12:25 -0700 (PDT) X-QQ-mid: bizesmtp79t1687353136ti9ply3z Received: from linux-lab-host.localdomain ( [116.30.126.60]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 21 Jun 2023 21:12:15 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: ce7j0yCWOO300dz/qw3LjQJFpPjn/M2tGvj15EaaWyGZ7jQ34jzlkDsETFo63 5aHnpY9/cJbGfNm1ErXtDISSMacncgj0SJiF9d599VDJss/siAYVzQNvE8c/KBB5B9696OZ uQDkh8UvcJt3tI+Byg7n6q6jKpcJ+PceHzyEmmp8maSf+ay/khMLvh/Kg6fiuwP0eTmhMd+ 9eEMXT9K5JYtkdvpAYcwNiyn+JYP+fzCSxvYpKtgLwpsmFWPXOPCq9W2FhTO4wYJ6i22/kJ Oo3JK6UiZMbPjwpaQdS+H6I2UgA9QRdKN0GdXzuATVU0yKuDwEfavz21S8hF850ZV6LZwkg 9/sBrKaS2quXoMIQpBz2VrZyn/x19Ho2wkJNXEWjtRIiAqBkLURaIEstt7QVw== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 5200152729963748297 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v1 13/17] selftests/nolibc: link_cross: support tmpfs Date: Wed, 21 Jun 2023 21:11:35 +0800 Message-Id: <575fd573110280bd8fcf39adc87edbcdd7288008.1687344643.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:qybglogicsvrsz:qybglogicsvrsz3a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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?1769319188731406051?= X-GMAIL-MSGID: =?utf-8?q?1769319188731406051?= When CONFIG_NET is not enabled, there would be no /proc/self/net, use /tmp/blah in such case. This allows to test link_cross with tmpfs even when procfs is not there. 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 eca0070151b6..c900564219e8 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -620,7 +620,7 @@ int run_syscall(int min, int max) CASE_TEST(link_root1); EXPECT_SYSER(1, link("/", "/"), -1, EEXIST); break; CASE_TEST(link_blah); EXPECT_SYSER(1, link("/proc/self/blah", "/blah"), -1, ENOENT); break; CASE_TEST(link_dir); EXPECT_SYSER(is_root, link("/", "/blah"), -1, EPERM); break; - CASE_TEST(link_cross); EXPECT_SYSER(has_proc, link("/proc/self/net", "/blah"), -1, EXDEV); break; + CASE_TEST(link_cross); EXPECT_SYSER(has_tmpdir, link(tmpdir, "/blah"), -1, EXDEV); break; CASE_TEST(lseek_m1); EXPECT_SYSER(1, lseek(-1, 0, SEEK_SET), -1, EBADF); break; CASE_TEST(lseek_0); EXPECT_SYSER(1, lseek(0, 0, SEEK_SET), -1, ESPIPE); break; CASE_TEST(mkdir_root); EXPECT_SYSER(1, mkdir("/", 0755), -1, EEXIST); break;