Skip to content

Commit 726f854

Browse files
author
Alexey Semenyuk
committed
8320706: RuntimePackageTest.testUsrInstallDir test fails on Linux
Reviewed-by: almatvee
1 parent 1bb250c commit 726f854

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java

+11-4
Original file line numberDiff line numberDiff line change
@@ -888,10 +888,17 @@ private void assertFileInAppImage(Path filename, Path expectedPath) {
888888
final Path rootDir = isImagePackageType() ? outputBundle() : pathToUnpackedPackageFile(
889889
appInstallationDirectory());
890890

891-
try ( Stream<Path> walk = ThrowingSupplier.toSupplier(() -> Files.walk(
892-
rootDir)).get()) {
893-
List<String> files = walk.filter(path -> path.getFileName().equals(
894-
filename)).map(Path::toString).toList();
891+
try ( Stream<Path> walk = ThrowingSupplier.toSupplier(() -> {
892+
if (TKit.isLinux() && rootDir.equals(Path.of("/"))) {
893+
// Installed package with split app image on Linux. Iterate
894+
// through package file list instead of the entire file system.
895+
return LinuxHelper.getPackageFiles(this);
896+
} else {
897+
return Files.walk(rootDir);
898+
}
899+
}).get()) {
900+
List<String> files = walk.filter(path -> filename.equals(
901+
path.getFileName())).map(Path::toString).toList();
895902

896903
if (expectedPath == null) {
897904
TKit.assertStringListEquals(List.of(), files, String.format(

0 commit comments

Comments
 (0)