Skip to content

Commit b8267ca

Browse files
committed
Fix tests
1 parent 1d39d30 commit b8267ca

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2024, Red Hat, Inc.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/*
25+
* @test
26+
* @key cgroups
27+
* @requires os.family == "linux"
28+
* @requires vm.flagless
29+
* @library /test/lib
30+
* @build TestSystemSettings
31+
* @run main/othervm TestSystemSettings
32+
*/
33+
34+
import jdk.test.lib.process.ProcessTools;
35+
import jdk.test.lib.process.OutputAnalyzer;
36+
37+
public class TestSystemSettings {
38+
39+
public static void main(String[] args) throws Exception {
40+
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XshowSettings:system", "-version");
41+
OutputAnalyzer output = new OutputAnalyzer(pb.start());
42+
43+
output.shouldContain("System not containerized.");
44+
}
45+
}

test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,11 @@ private void testAll(Metrics m, boolean inContainer) throws Exception {
7272
testContainerized(m, inContainer);
7373
}
7474

75-
private void testContainerized(m, inContainer) {
75+
private void testContainerized(Metrics m, boolean inContainer) {
7676
if (m.isContainerized() != inContainer) {
7777
throw new RuntimeException("containerized test failed. " +
7878
"Expected isContainerized()==" + inContainer +
7979
" but got '" + m.isContainerized() + "'");
80-
}
8180
}
8281
System.out.println("testContainerized() PASSED!");
8382
}

0 commit comments

Comments
 (0)