From patchwork Fri Jul 7 18:35:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13305163 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 758ECEB64D9 for ; Fri, 7 Jul 2023 18:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbjGGSgz (ORCPT ); Fri, 7 Jul 2023 14:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjGGSgy (ORCPT ); Fri, 7 Jul 2023 14:36:54 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43301212C; Fri, 7 Jul 2023 11:36:53 -0700 (PDT) X-QQ-mid: bizesmtp62t1688755003thv00ahq Received: from linux-lab-host.localdomain ( [116.30.131.119]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 08 Jul 2023 02:36:41 +0800 (CST) X-QQ-SSF: 01200000000000D0W000000A0000000 X-QQ-FEAT: 1U/NVTUyJNRN0eVRoV/JWKQm+a7U3weNCZBdkyyMVSia0m71d1xtzIa8DOFhA N0TwrxzgpjWXzP9zfmgoZW2Cufl34X2a+7w15wEMPe6E6pCL8x89GM8y3nqpEplu4Jh08NG wsA2vv/+RVoM0f1g++R8yCGzItWPV8YFh2hs0PIVaOxM1GTVKfSTMvGjsCrixlqXAiitUv6 WEBlCPAs6c3IM6uS/mu7sR8aRhMlNeJa35Wq6CsUV2w1C8yFHEd6fvn7pWIDlyDT/oIDv4S tLXiej9Sa9n4XS1/EO3weE9bQntTf7GZ03qvZXlRQjwI62XEXxYTtFL3J0mMHuF6dINvORw XG4QYAA1iwkZljCnA4xHGyADfv6qS7gJA9kjPtRKHs9hNYfVp3Nj1+I7Zbpf9R2szIdGLT2 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 15480877985008218786 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 11/18] selftests/nolibc: add a new rmdir() test case Date: Sat, 8 Jul 2023 02:35:38 +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 A new rmdir_blah test case is added to remove a non-existing /blah, which expects failure with ENOENT errno. Reviewed-by: Thomas Weißschuh Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index cf38df6e036c..deff804e0753 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -745,6 +745,7 @@ int run_syscall(int min, int max) CASE_TEST(poll_fault); EXPECT_SYSER(1, poll((void *)1, 1, 0), -1, EFAULT); break; CASE_TEST(prctl); EXPECT_SYSER(1, prctl(PR_SET_NAME, (unsigned long)NULL, 0, 0, 0), -1, EFAULT); break; CASE_TEST(read_badf); EXPECT_SYSER(1, read(-1, &tmp, 1), -1, EBADF); break; + CASE_TEST(rmdir_blah); EXPECT_SYSER(1, rmdir("/blah"), -1, ENOENT); break; CASE_TEST(sched_yield); EXPECT_SYSZR(1, sched_yield()); break; CASE_TEST(select_null); EXPECT_SYSZR(1, ({ struct timeval tv = { 0 }; select(0, NULL, NULL, NULL, &tv); })); break; CASE_TEST(select_stdout); EXPECT_SYSNE(1, ({ fd_set fds; FD_ZERO(&fds); FD_SET(1, &fds); select(2, NULL, &fds, NULL, NULL); }), -1); break;