8343809: Add requires tag to mark tests that are incompatible with exploded image

Reviewed-by: alanb, dholmes
This commit is contained in:
Leonid Mesnik 2026-01-03 02:52:53 +00:00
parent 2daf12edd2
commit 53824cf2a9
5 changed files with 22 additions and 2 deletions

View File

@ -101,6 +101,7 @@ requires.properties= \
container.support \ container.support \
systemd.support \ systemd.support \
jdk.containerized \ jdk.containerized \
jdk.explodedImage \
jlink.runtime.linkable \ jlink.runtime.linkable \
jlink.packagedModules \ jlink.packagedModules \
jdk.static jdk.static

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,7 @@
* @modules java.base/jdk.internal.loader * @modules java.base/jdk.internal.loader
* java.logging * java.logging
* @requires vm.flagless * @requires vm.flagless
* @requires !jdk.explodedImage
* @library /test/lib * @library /test/lib
* @run driver GetSysPkgTest * @run driver GetSysPkgTest
*/ */

View File

@ -1,4 +1,5 @@
/* /*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, Google Inc. All rights reserved. * Copyright (c) 2019, Google Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -27,6 +28,7 @@
* @bug 8220095 * @bug 8220095
* @requires os.family == "linux" | os.family == "mac" * @requires os.family == "linux" | os.family == "mac"
* @requires vm.flagless * @requires vm.flagless
* @requires !jdk.explodedImage
* @requires !jdk.static * @requires !jdk.static
* @library /test/lib * @library /test/lib
* @modules java.management * @modules java.management

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,7 @@
* @summary Make sure -Xlog:class+load=info works properly with "modules" jimage, * @summary Make sure -Xlog:class+load=info works properly with "modules" jimage,
--patch-module, and with -Xbootclasspath/a --patch-module, and with -Xbootclasspath/a
* @requires vm.flagless * @requires vm.flagless
* @requires !jdk.explodedImage
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* @library /test/lib * @library /test/lib
* @compile PatchModuleMain.java * @compile PatchModuleMain.java

View File

@ -146,6 +146,7 @@ public class VMProps implements Callable<Map<String, String>> {
map.put("jdk.containerized", this::jdkContainerized); map.put("jdk.containerized", this::jdkContainerized);
map.put("vm.flagless", this::isFlagless); map.put("vm.flagless", this::isFlagless);
map.put("jdk.foreign.linker", this::jdkForeignLinker); map.put("jdk.foreign.linker", this::jdkForeignLinker);
map.put("jdk.explodedImage", this::explodedImage);
map.put("jlink.packagedModules", this::packagedModules); map.put("jlink.packagedModules", this::packagedModules);
map.put("jdk.static", this::isStatic); map.put("jdk.static", this::isStatic);
vmGC(map); // vm.gc.X = true/false vmGC(map); // vm.gc.X = true/false
@ -751,6 +752,20 @@ public class VMProps implements Callable<Map<String, String>> {
return "" + "true".equalsIgnoreCase(isEnabled); return "" + "true".equalsIgnoreCase(isEnabled);
} }
private String explodedImage() {
try {
Path jmodFile = Path.of(System.getProperty("java.home"), "jmods", "java.base.jmod");
if (Files.exists(jmodFile)) {
return Boolean.FALSE.toString();
} else {
return Boolean.TRUE.toString();
}
} catch (Throwable t) {
t.printStackTrace();
return errorWithMessage("Error in explodedImage " + t);
}
}
private String packagedModules() { private String packagedModules() {
// Some jlink tests require packaged modules being present (jmods). // Some jlink tests require packaged modules being present (jmods).
// For a runtime linkable image build packaged modules aren't present // For a runtime linkable image build packaged modules aren't present