author | mseledtsov |
Thu, 16 Nov 2017 19:01:01 -0800 | |
changeset 47908 | d6d00f785f39 |
child 48957 | af49718d8cf2 |
permissions | -rw-r--r-- |
47908
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
1 |
/* |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
4 |
* |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
8 |
* |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
13 |
* accompanied this code). |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
14 |
* |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
18 |
* |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
21 |
* questions. |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
22 |
*/ |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
23 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
24 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
25 |
/* |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
26 |
* @test |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
27 |
* @summary Test JVM's awareness of cpu sets (cpus and mems) |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
28 |
* @requires docker.support |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
29 |
* @library /test/lib |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
30 |
* @modules java.base/jdk.internal.misc |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
31 |
* java.management |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
32 |
* jdk.jartool/sun.tools.jar |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
33 |
* @build Common AttemptOOM CPUSetsReader sun.hotspot.WhiteBox PrintContainerInfo |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
34 |
* @run driver ClassFileInstaller -jar whitebox.jar sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
35 |
* @run driver TestCPUSets |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
36 |
*/ |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
37 |
import java.util.List; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
38 |
import jdk.test.lib.containers.docker.DockerRunOptions; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
39 |
import jdk.test.lib.containers.docker.DockerTestUtils; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
40 |
import jdk.test.lib.Asserts; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
41 |
import jdk.test.lib.Platform; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
42 |
import jdk.test.lib.Utils; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
43 |
import jdk.test.lib.process.OutputAnalyzer; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
44 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
45 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
46 |
public class TestCPUSets { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
47 |
private static final String imageName = Common.imageName("cpusets"); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
48 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
49 |
public static void main(String[] args) throws Exception { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
50 |
if (!DockerTestUtils.canTestDocker()) { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
51 |
return; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
52 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
53 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
54 |
Common.prepareWhiteBox(); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
55 |
DockerTestUtils.buildJdkDockerImage(imageName, "Dockerfile-BasicTest", "jdk-docker"); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
56 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
57 |
try { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
58 |
// Sanity test the cpu sets reader and parser |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
59 |
CPUSetsReader.test(); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
60 |
testTheSet("Cpus_allowed_list"); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
61 |
testTheSet("Mems_allowed_list"); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
62 |
} finally { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
63 |
DockerTestUtils.removeDockerImage(imageName); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
64 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
65 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
66 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
67 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
68 |
private static void testTheSet(String setType) throws Exception { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
69 |
String cpuSetStr = CPUSetsReader.readFromProcStatus(setType); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
70 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
71 |
if (cpuSetStr == null) { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
72 |
System.out.printf("The %s test is skipped %n", setType); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
73 |
} else { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
74 |
List<Integer> cpuSet = CPUSetsReader.parseCpuSet(cpuSetStr); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
75 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
76 |
// Test subset of one, full subset, and half of the subset |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
77 |
testCpuSet(CPUSetsReader.listToString(cpuSet, 1)); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
78 |
if (cpuSet.size() > 1) { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
79 |
testCpuSet(CPUSetsReader.listToString(cpuSet)); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
80 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
81 |
if (cpuSet.size() > 2) { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
82 |
testCpuSet(CPUSetsReader.listToString(cpuSet, cpuSet.size()/2 )); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
83 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
84 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
85 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
86 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
87 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
88 |
private static DockerRunOptions commonOpts() { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
89 |
DockerRunOptions opts = new DockerRunOptions(imageName, "/jdk/bin/java", |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
90 |
"PrintContainerInfo"); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
91 |
opts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/"); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
92 |
opts.addJavaOpts("-Xlog:os+container=trace", "-cp", "/test-classes/"); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
93 |
Common.addWhiteBoxOpts(opts); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
94 |
return opts; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
95 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
96 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
97 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
98 |
private static void checkResult(List<String> lines, String lineMarker, String value) { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
99 |
boolean lineMarkerFound = false; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
100 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
101 |
for (String line : lines) { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
102 |
if (line.contains(lineMarker)) { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
103 |
lineMarkerFound = true; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
104 |
String[] parts = line.split(":"); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
105 |
System.out.println("DEBUG: line = " + line); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
106 |
System.out.println("DEBUG: parts.length = " + parts.length); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
107 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
108 |
Asserts.assertEquals(parts.length, 2); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
109 |
String set = parts[1].replaceAll("\\s",""); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
110 |
String actual = CPUSetsReader.listToString(CPUSetsReader.parseCpuSet(set)); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
111 |
Asserts.assertEquals(actual, value); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
112 |
break; |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
113 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
114 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
115 |
Asserts.assertTrue(lineMarkerFound); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
116 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
117 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
118 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
119 |
private static void testCpuSet(String value) throws Exception { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
120 |
Common.logNewTestCase("cpusets.cpus, value = " + value); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
121 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
122 |
DockerRunOptions opts = commonOpts(); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
123 |
opts.addDockerOpts("--cpuset-cpus=" + value); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
124 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
125 |
List<String> lines = Common.run(opts).asLines(); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
126 |
checkResult(lines, "cpuset.cpus is:", value); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
127 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
128 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
129 |
private static void testMemSet(String value) throws Exception { |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
130 |
Common.logNewTestCase("cpusets.mems, value = " + value); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
131 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
132 |
DockerRunOptions opts = commonOpts(); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
133 |
opts.addDockerOpts("--cpuset-mems=" + value); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
134 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
135 |
List<String> lines = Common.run(opts).asLines(); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
136 |
checkResult(lines, "cpuset.mems is:", value); |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
137 |
} |
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
138 |
|
d6d00f785f39
8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
mseledtsov
parents:
diff
changeset
|
139 |
} |