public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: shuah@kernel.org, Cristian Marussi <cristian.marussi@arm.com>,
	Aleksa Sarai <cyphar@cyphar.com>
Subject: [PATCH 5/5] selftests: openat2: Skip testcases that fail with EOPNOTSUPP
Date: Wed, 26 Jan 2022 10:27:23 +0000	[thread overview]
Message-ID: <20220126102723.23300-6-cristian.marussi@arm.com> (raw)
In-Reply-To: <20220126102723.23300-1-cristian.marussi@arm.com>

Skip testcases that fail since the requested valid flags combination is not
supported by the underlying filesystem.

Cc: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 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 1bddbe934204..7fb902099de4 100644
--- a/tools/testing/selftests/openat2/openat2_test.c
+++ b/tools/testing/selftests/openat2/openat2_test.c
@@ -259,6 +259,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
@@ -303,7 +313,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.17.1


  parent reply	other threads:[~2022-01-26 10:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 10:27 [PATCH 0/5] Miscellaneous trivial fixes Cristian Marussi
2022-01-26 10:27 ` [PATCH 1/5] selftests: skip mincore.check_file_mmap when fs lacks needed support Cristian Marussi
2022-01-27 23:23   ` Shuah Khan
2022-01-26 10:27 ` [PATCH 2/5] kselftest: Fix vdso_test_time to pass on skips Cristian Marussi
2022-01-26 12:22   ` Vincenzo Frascino
2022-01-26 12:34     ` Cristian Marussi
2022-01-26 15:26       ` Vincenzo Frascino
2022-01-26 12:26   ` [PATCH] kselftest: Fix vdso_test_abi return status Vincenzo Frascino
2022-01-27 23:18     ` Shuah Khan
2022-01-28 11:09       ` Vincenzo Frascino
2022-01-27 23:02   ` [PATCH 2/5] kselftest: Fix vdso_test_time to pass on skips Shuah Khan
2022-01-26 10:27 ` [PATCH 3/5] selftests: openat2: Print also errno in failure messages Cristian Marussi
2022-01-27 23:11   ` Shuah Khan
2022-01-26 10:27 ` [PATCH 4/5] selftests: openat2: Add missing dependency in Makefile Cristian Marussi
2022-01-27 23:12   ` Shuah Khan
2022-01-26 10:27 ` Cristian Marussi [this message]
2022-01-27 23:13   ` [PATCH 5/5] selftests: openat2: Skip testcases that fail with EOPNOTSUPP Shuah Khan
2022-01-27 23:05 ` [PATCH 0/5] Miscellaneous trivial fixes Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220126102723.23300-6-cristian.marussi@arm.com \
    --to=cristian.marussi@arm.com \
    --cc=cyphar@cyphar.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox