Skip to content

Commit b687664

Browse files
akashchezhengyu123
authored andcommitted
8277159: Fix java/nio/file/FileStore/Basic.java test by ignoring /run/user/* mount points
Reviewed-by: bpb, shade
1 parent 8f5a8f7 commit b687664

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/jdk/java/nio/file/FileStore/Basic.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ static void doTests(Path dir) throws IOException {
145145
// reflect whether the space attributes would be accessible
146146
// were access to be permitted
147147
System.err.format("%s is inaccessible\n", store);
148+
} catch (FileSystemException fse) {
149+
// On Linux, ignore the FSE if the path is one of the
150+
// /run/user/$UID mounts created by pam_systemd(8) as it
151+
// might be mounted as a fuse.portal filesystem and
152+
// its access attempt might fail with EPERM
153+
if (!Platform.isLinux() || store.toString().indexOf("/run/user") == -1) {
154+
throw new RuntimeException(fse);
155+
} else {
156+
System.err.format("%s error: %s\n", store, fse);
157+
}
148158
}
149159

150160
// two distinct FileStores should not be equal

0 commit comments

Comments
 (0)