From d4ef85fbc23ff181e652f4314fb96c07c78595c6 Mon Sep 17 00:00:00 2001 From: Alex Kasko Date: Wed, 17 Nov 2021 17:48:07 +0000 Subject: [PATCH 1/2] Backport b6876649a82bed508d817ccbde1600d00937e4b2 --- jdk/test/java/nio/file/FileStore/Basic.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java index 5c8e53f5d0b..8bbd352a6da 100644 --- a/jdk/test/java/nio/file/FileStore/Basic.java +++ b/jdk/test/java/nio/file/FileStore/Basic.java @@ -134,6 +134,16 @@ static void doTests(Path dir) throws IOException { // reflect whether the space attributes would be accessible // were access to be permitted System.err.format("%s is inaccessible\n", store); + } catch (FileSystemException fse) { + // On Linux, ignore the FSE if the path is one of the + // /run/user/$UID mounts created by pam_systemd(8) as it + // might be mounted as a fuse.portal filesystem and + // its access attempt might fail with EPERM + if (!Platform.isLinux() || store.toString().indexOf("/run/user") == -1) { + throw new RuntimeException(fse); + } else { + System.err.format("%s error: %s\n", store, fse); + } } // two distinct FileStores should not be equal From 2f4d2fa02a69391e12deb2d59489a94a94145b11 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Thu, 16 Oct 2025 11:40:28 +0000 Subject: [PATCH 2/2] Add "@libiray /test/lib" and "import jdk.test.lib.Platform;" --- jdk/test/java/nio/file/FileStore/Basic.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java index 8bbd352a6da..d14ae3fec79 100644 --- a/jdk/test/java/nio/file/FileStore/Basic.java +++ b/jdk/test/java/nio/file/FileStore/Basic.java @@ -25,7 +25,7 @@ * @bug 4313887 6873621 6979526 7006126 7020517 * @summary Unit test for java.nio.file.FileStore * @key intermittent - * @library .. /lib/testlibrary + * @library .. /lib/testlibrary /test/lib * @build jdk.testlibrary.FileUtils * @run main Basic */ @@ -36,6 +36,7 @@ import java.io.IOException; import java.util.*; import jdk.testlibrary.FileUtils; +import jdk.test.lib.Platform; public class Basic {