From 8a8893ec030b19583efd65bd0751e66254689ead Mon Sep 17 00:00:00 2001 From: Alexey Semenyuk Date: Thu, 8 May 2025 22:18:56 +0000 Subject: [PATCH] 8356562: SigningAppImageTwoStepsTest test fails Reviewed-by: almatvee --- .../jdk/jpackage/test/JPackageCommand.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java index 8c5a653f5a0..c1f1bc05d51 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java @@ -1001,12 +1001,8 @@ public class JPackageCommand extends CommandArguments { } private void assertAppImageFile() { - Path appImageDir = Path.of(""); - if (isImagePackageType() && hasArgument("--app-image")) { - appImageDir = Path.of(getArgumentValue("--app-image")); - } + final Path lookupPath = AppImageFile.getPathInAppImage(Path.of("")); - final Path lookupPath = AppImageFile.getPathInAppImage(appImageDir); if (!expectAppImageFile()) { assertFileNotInAppImage(lookupPath); } else { @@ -1073,8 +1069,14 @@ public class JPackageCommand extends CommandArguments { return; } - final Path rootDir = isImagePackageType() ? outputBundle() : pathToUnpackedPackageFile( - appInstallationDirectory()); + final Path rootDir; + if (TKit.isOSX() && MacHelper.signPredefinedAppImage(this)) { + rootDir = Path.of(getArgumentValue("--app-image")); + } else if (isImagePackageType()) { + rootDir = outputBundle(); + } else { + rootDir = pathToUnpackedPackageFile(appInstallationDirectory()); + } try ( Stream walk = ThrowingSupplier.toSupplier(() -> { if (TKit.isLinux() && rootDir.equals(Path.of("/"))) {