diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java index 5c8e53f5d0b..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 { @@ -134,6 +135,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