Skip to content

Commit 26f7833

Browse files
sercherjerboaa
authored andcommitted
8351382: New test containers/docker/TestMemoryWithSubgroups.java is failing
Reviewed-by: sgehwolf, dholmes
1 parent dd2478c commit 26f7833

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/hotspot/jtreg/containers/docker/TestMemoryWithSubgroups.java

+17
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* questions.
2222
*/
2323

24+
import jdk.test.lib.Container;
2425
import jdk.test.lib.containers.docker.Common;
2526
import jdk.test.lib.containers.docker.DockerTestUtils;
2627
import jdk.test.lib.containers.docker.DockerRunOptions;
@@ -46,6 +47,19 @@ public class TestMemoryWithSubgroups {
4647

4748
private static final String imageName = Common.imageName("subgroup");
4849

50+
static String getEngineInfo(String format) throws Exception {
51+
return DockerTestUtils.execute(Container.ENGINE_COMMAND, "info", "-f", format)
52+
.getStdout();
53+
}
54+
55+
static boolean isRootless() throws Exception {
56+
// Docker and Podman have different INFO structures.
57+
// The node path for Podman is .Host.Security.Rootless, that also holds for
58+
// Podman emulating Docker CLI. The node path for Docker is .SecurityOptions.
59+
return (getEngineInfo("{{.Host.Security.Rootless}}").contains("true") ||
60+
getEngineInfo("{{.SecurityOptions}}").contains("name=rootless"));
61+
}
62+
4963
public static void main(String[] args) throws Exception {
5064
Metrics metrics = Metrics.systemMetrics();
5165
if (metrics == null) {
@@ -56,6 +70,9 @@ public static void main(String[] args) throws Exception {
5670
System.out.println("Unable to run docker tests.");
5771
return;
5872
}
73+
if (isRootless()) {
74+
throw new SkippedException("Test skipped in rootless mode");
75+
}
5976
Common.prepareWhiteBox();
6077
DockerTestUtils.buildJdkContainerImage(imageName);
6178

0 commit comments

Comments
 (0)