From mboxrd@z Thu Jan 1 00:00:00 1970 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 28CADC433F5 for ; Mon, 21 Feb 2022 09:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347670AbiBUJKh (ORCPT ); Mon, 21 Feb 2022 04:10:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347941AbiBUJKG (ORCPT ); Mon, 21 Feb 2022 04:10:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3630E1D317; Mon, 21 Feb 2022 01:02:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BEB4EB80EB5; Mon, 21 Feb 2022 09:02:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1397C340E9; Mon, 21 Feb 2022 09:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434149; bh=T0e5nwJQ1XBpLrbjbW/hRHChfr9mGV7tWN6MZ1JrH7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lF8JlerMyG+FJJ+MgHQ2MP9Mqwy3Tz0ZD8RTIVS/ryLyaO9qxrW5hwCEEg29IwFD4 gz7m5b2gcFafDb1N+P2fPbhrYy5y7yrNTiaEhyYIrCgP2ur5r1HI2YHRz2sTjvOx1z 6UYvSeu2YAKm8sC3CMVVe43Q7XG2vkVWbiRzP4Ks= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aleksa Sarai , Cristian Marussi , Shuah Khan , Sasha Levin Subject: [PATCH 5.10 030/121] selftests: openat2: Skip testcases that fail with EOPNOTSUPP Date: Mon, 21 Feb 2022 09:48:42 +0100 Message-Id: <20220221084922.199643179@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084921.147454846@linuxfoundation.org> References: <20220221084921.147454846@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Cristian Marussi [ Upstream commit ac9e0a250bb155078601a5b999aab05f2a04d1ab ] Skip testcases that fail since the requested valid flags combination is not supported by the underlying filesystem. Cc: Aleksa Sarai Signed-off-by: Cristian Marussi Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/openat2/openat2_test.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/openat2/openat2_test.c b/tools/testing/selftests/openat2/openat2_test.c index b386367c606b1..453152b58e7f0 100644 --- a/tools/testing/selftests/openat2/openat2_test.c +++ b/tools/testing/selftests/openat2/openat2_test.c @@ -244,6 +244,16 @@ void test_openat2_flags(void) unlink(path); fd = sys_openat2(AT_FDCWD, path, &test->how); + if (fd < 0 && fd == -EOPNOTSUPP) { + /* + * Skip the testcase if it failed because not supported + * by FS. (e.g. a valid O_TMPFILE combination on NFS) + */ + ksft_test_result_skip("openat2 with %s fails with %d (%s)\n", + test->name, fd, strerror(-fd)); + goto next; + } + if (test->err >= 0) failed = (fd < 0); else @@ -288,7 +298,7 @@ void test_openat2_flags(void) else resultfn("openat2 with %s fails with %d (%s)\n", test->name, test->err, strerror(-test->err)); - +next: free(fdpath); fflush(stdout); } -- 2.34.1