Skip to content

Commit

Permalink
8341138: Rename jtreg property docker.support as container.support
Browse files Browse the repository at this point in the history
Reviewed-by: sgehwolf, mseledtsov
  • Loading branch information
Ramkumar Sunderbabu authored and lmesnik committed Oct 12, 2024
1 parent 2e1c193 commit 41ee582
Show file tree
Hide file tree
Showing 26 changed files with 54 additions and 48 deletions.
2 changes: 1 addition & 1 deletion test/hotspot/jtreg/TEST.ROOT
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ requires.properties= \
vm.compiler2.enabled \
vm.musl \
vm.flagless \
docker.support \
container.support \
systemd.support \
jdk.containerized

Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/DockerBasicTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,7 +25,7 @@
/*
* @test
* @summary Basic (sanity) test for JDK-under-test inside a docker image.
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/ShareTmpDir.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,7 +27,7 @@
* @bug 8286030
* @key cgroups
* @summary Test for hsperfdata file name conflict when two containers share the same /tmp directory
* @requires docker.support
* @requires container.support
* @library /test/lib
* @build WaitForFlagFile
* @run driver ShareTmpDir
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/TestCPUAwareness.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,7 +26,7 @@
* @test
* @key cgroups
* @summary Test JVM's CPU resource awareness when running inside docker container
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.base/jdk.internal.platform
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/TestCPUSets.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,7 +26,7 @@
* @test
* @key cgroups
* @summary Test JVM's awareness of cpu sets (cpus and mems)
* @requires docker.support
* @requires container.support
* @requires (os.arch != "s390x")
* @library /test/lib
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @test
* @summary Test container info for cgroup v2
* @key cgroups
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
Expand Down
2 changes: 1 addition & 1 deletion test/hotspot/jtreg/containers/docker/TestJFREvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* when run inside Docker container, such as available CPU and memory.
* Also make sure that PIDs are based on value provided by container,
* not by the host system.
* @requires (docker.support & os.maxMemory >= 2g)
* @requires (container.support & os.maxMemory >= 2g)
* @modules java.base/jdk.internal.platform
* @library /test/lib
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,7 +27,7 @@
* @summary Test JFR network related events inside a container; make sure
* the reported host ip and host name are correctly reported within
* the container.
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/TestJFRWithJMX.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,7 +25,7 @@
/*
* @test
* @summary Test JFR recording controlled via JMX across container boundary.
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/TestJcmd.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,7 +26,7 @@
* @test
* @summary Test JCMD across container boundary. The JCMD runs on a host system,
* while sending commands to a JVM that runs inside a container.
* @requires docker.support
* @requires container.support
* @requires vm.flagless
* @modules java.base/jdk.internal.misc
* java.management
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -29,7 +29,7 @@
* and other uses. In side car pattern the main application/service container
* is paired with a sidecar container by sharing certain aspects of container
* namespace such as PID namespace, specific sub-directories, IPC and more.
* @requires docker.support
* @requires container.support
* @requires vm.flagless
* @modules java.base/jdk.internal.misc
* java.management
Expand Down
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/containers/docker/TestLimitsUpdating.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2023, Red Hat, Inc.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -28,7 +29,7 @@
* @bug 8308090
* @key cgroups
* @summary Test container limits updating as they get updated at runtime without restart
* @requires docker.support
* @requires container.support
* @library /test/lib
* @build jdk.test.whitebox.WhiteBox LimitUpdateChecker
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar whitebox.jar jdk.test.whitebox.WhiteBox
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,7 +27,7 @@
* @bug 8146115 8292083
* @key cgroups
* @summary Test JVM's memory resource awareness when running inside docker container
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.base/jdk.internal.platform
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/containers/docker/TestMisc.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,7 +25,7 @@
/*
* @test
* @summary Test miscellanous functionality related to JVM running in docker container
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
Expand Down
2 changes: 1 addition & 1 deletion test/hotspot/jtreg/containers/docker/TestPids.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @test
* @key cgroups
* @summary Test JVM's awareness of pids controller
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/TEST.ROOT
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ requires.properties= \
vm.jvmci.enabled \
vm.jvmti \
vm.cpu.features \
docker.support \
container.support \
systemd.support \
release.implementor \
jdk.containerized \
Expand Down
3 changes: 2 additions & 1 deletion test/jdk/jdk/internal/platform/docker/TestDockerBasic.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Red Hat, Inc.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,7 +27,7 @@
* @bug 8293540
* @summary Verify that -XshowSettings:system works
* @key cgroups
* @requires docker.support
* @requires container.support
* @library /test/lib
* @run main/timeout=360 TestDockerBasic
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -34,7 +34,7 @@
* @test
* @key cgroups
* @summary Test JDK Metrics class when running inside docker container
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.platform
* @build MetricsCpuTester
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @test
* @key cgroups
* @summary Test JDK Metrics class when running inside docker container
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.platform
* @build MetricsMemoryTester
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2020, 2022 THL A29 Limited, a Tencent company. All rights reserved.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,7 +26,7 @@
* @test
* @key cgroups
* @bug 8242480
* @requires docker.support
* @requires container.support
* @library /test/lib
* @build GetFreeSwapSpaceSize
* @run driver TestGetFreeSwapSpaceSize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2023, Red Hat, Inc.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -28,7 +29,7 @@
* @bug 8308090
* @key cgroups
* @summary Test container limits updating as they get updated at runtime without restart
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.platform
* @build LimitUpdateChecker
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/jdk/internal/platform/docker/TestPidsLimit.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -27,7 +27,7 @@
* @key cgroups
* @summary Test JDK Metrics class when running inside a docker container with limited pids
* @bug 8266490
* @requires docker.support
* @requires container.support
* @library /test/lib
* @build TestPidsLimit
* @run driver TestPidsLimit
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/jdk/internal/platform/docker/TestSystemMetrics.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,7 +25,7 @@
* @test
* @key cgroups
* @summary Test JDK Metrics class when running inside docker container
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.platform
* @run main TestSystemMetrics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2020, Red Hat, Inc.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -24,7 +25,7 @@
/*
* @test
* @summary UseContainerSupport flag should reflect Metrics being available
* @requires docker.support
* @requires container.support
* @library /test/lib
* @modules java.base/jdk.internal.platform
* @build CheckUseContainerSupport
Expand Down
18 changes: 9 additions & 9 deletions test/jtreg-ext/requires/VMProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public Map<String, String> call() {
map.put("vm.libgraal.jit", this::isLibgraalJIT);
map.put("vm.compiler1.enabled", this::isCompiler1Enabled);
map.put("vm.compiler2.enabled", this::isCompiler2Enabled);
map.put("docker.support", this::dockerSupport);
map.put("container.support", this::containerSupport);
map.put("systemd.support", this::systemdSupport);
map.put("vm.musl", this::isMusl);
map.put("release.implementor", this::implementor);
Expand Down Expand Up @@ -585,16 +585,16 @@ protected String isCompiler2Enabled() {
}

/**
* A simple check for docker support
* A simple check for container support
*
* @return true if docker is supported in a given environment
* @return true if container is supported in a given environment
*/
protected String dockerSupport() {
log("Entering dockerSupport()");
protected String containerSupport() {
log("Entering containerSupport()");

boolean isSupported = false;
if (Platform.isLinux()) {
// currently docker testing is only supported for Linux,
// currently container testing is only supported for Linux,
// on certain platforms

String arch = System.getProperty("os.arch");
Expand All @@ -610,17 +610,17 @@ protected String dockerSupport() {
}
}

log("dockerSupport(): platform check: isSupported = " + isSupported);
log("containerSupport(): platform check: isSupported = " + isSupported);

if (isSupported) {
try {
isSupported = checkProgramSupport("checkDockerSupport()", Container.ENGINE_COMMAND);
isSupported = checkProgramSupport("checkContainerSupport()", Container.ENGINE_COMMAND);
} catch (Exception e) {
isSupported = false;
}
}

log("dockerSupport(): returning isSupported = " + isSupported);
log("containerSupport(): returning isSupported = " + isSupported);
return "" + isSupported;
}

Expand Down
Loading

0 comments on commit 41ee582

Please sign in to comment.