All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH vz10] selftests: binderfs: skip the stress test without binderfs
Date: Tue,  1 Sep 2026 02:50:36 +0300	[thread overview]
Message-ID: <20260831235046.1651611-1-eva.kurchatova@virtuozzo.com> (raw)

binderfs_test_stress mounts binderfs 32 times and asserts on the first
mount, so on a kernel without CONFIG_ANDROID_BINDERFS the case fails
rather than reporting that the filesystem is not there.

Probe once with a mount into a temporary directory and skip when the
kernel answers ENODEV. Only ENODEV means the filesystem is missing;
anything else is a real failure and still fails, as does a temporary
directory we cannot create.

https://virtuozzo.atlassian.net/browse/VSTOR-142449
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 .../selftests/filesystems/binderfs/binderfs_test.c    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
index 319567f0fae1..5d47e27e9dab 100644
--- a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
+++ b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
@@ -379,6 +379,17 @@ static void *binder_version_thread(void *data)
  */
 TEST(binderfs_stress)
 {
+	char probe[] = P_tmpdir "/binderfs_probe_XXXXXX";
+	int probe_ret;
+
+	ASSERT_NE(NULL, mkdtemp(probe));
+	probe_ret = mount(NULL, probe, "binder", 0, 0);
+	if (!probe_ret)
+		umount2(probe, MNT_DETACH);
+	rmdir(probe);
+	if (probe_ret && errno == ENODEV)
+		SKIP(return, "The Android binderfs filesystem is not available");
+
 	int fds[1000];
 	int syncfds[2];
 	pid_t pid;
-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

             reply	other threads:[~2026-08-31 23:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 23:50 Eva Kurchatova [this message]
2026-09-02 12:35 ` Konstantin Khorenko

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=20260831235046.1651611-1-eva.kurchatova@virtuozzo.com \
    --to=eva.kurchatova@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.