author | stefank |
Thu, 31 May 2018 10:41:36 +0200 | |
changeset 50320 | df02866807b6 |
parent 49630 | 2f1b308b4469 |
child 50339 | ede65c4fb6da |
permissions | -rw-r--r-- |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
1 |
/* |
49008
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
2 |
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
4 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
8 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
13 |
* accompanied this code). |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
14 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
18 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
21 |
* questions. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
22 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
23 |
package requires; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
24 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
25 |
import java.io.IOException; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
26 |
import java.nio.file.Files; |
46238
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
27 |
import java.nio.file.Path; |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
28 |
import java.nio.file.Paths; |
42511
8009d4cba2ea
8170228: register closed @requires property setter
iignatyev
parents:
42006
diff
changeset
|
29 |
import java.nio.file.StandardOpenOption; |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
30 |
import java.util.ArrayList; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
31 |
import java.util.HashMap; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
32 |
import java.util.List; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
33 |
import java.util.Map; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
34 |
import java.util.concurrent.Callable; |
47615
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
35 |
import java.util.concurrent.TimeUnit; |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
36 |
import java.util.regex.Matcher; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
37 |
import java.util.regex.Pattern; |
43389
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
38 |
|
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
39 |
import sun.hotspot.cpuinfo.CPUInfo; |
39377
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
40 |
import sun.hotspot.gc.GC; |
39941
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
41 |
import sun.hotspot.WhiteBox; |
46225
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
42 |
import jdk.test.lib.Platform; |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
43 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
44 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
45 |
* The Class to be invoked by jtreg prior Test Suite execution to |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
46 |
* collect information about VM. |
39941
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
47 |
* Do not use any API's that may not be available in all target VMs. |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
48 |
* Properties set by this Class will be available in the @requires expressions. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
49 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
50 |
public class VMProps implements Callable<Map<String, String>> { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
51 |
|
39941
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
52 |
private static final WhiteBox WB = WhiteBox.getWhiteBox(); |
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
53 |
|
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
54 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
55 |
* Collects information about VM properties. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
56 |
* This method will be invoked by jtreg. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
57 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
58 |
* @return Map of property-value pairs. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
59 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
60 |
@Override |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
61 |
public Map<String, String> call() { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
62 |
Map<String, String> map = new HashMap<>(); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
63 |
map.put("vm.flavor", vmFlavor()); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
64 |
map.put("vm.compMode", vmCompMode()); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
65 |
map.put("vm.bits", vmBits()); |
39199
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
66 |
map.put("vm.flightRecorder", vmFlightRecorder()); |
39198
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
67 |
map.put("vm.simpleArch", vmArch()); |
42006
98146f279bba
8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
39941
diff
changeset
|
68 |
map.put("vm.debug", vmDebug()); |
42512
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
69 |
map.put("vm.jvmci", vmJvmci()); |
43394
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
70 |
map.put("vm.emulatedClient", vmEmulatedClient()); |
43389
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
71 |
map.put("vm.cpu.features", cpuFeatures()); |
46225
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
72 |
map.put("vm.rtm.cpu", vmRTMCPU()); |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
73 |
map.put("vm.rtm.os", vmRTMOS()); |
46238
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
74 |
map.put("vm.aot", vmAOT()); |
46242
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
75 |
// vm.cds is true if the VM is compiled with cds support. |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
76 |
map.put("vm.cds", vmCDS()); |
48155
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
77 |
map.put("vm.cds.custom.loaders", vmCDSForCustomLoaders()); |
49008
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
78 |
map.put("vm.cds.archived.java.heap", vmCDSForArchivedJavaHeap()); |
47576
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
79 |
// vm.graal.enabled is true if Graal is used as JIT |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
80 |
map.put("vm.graal.enabled", isGraalEnabled()); |
47615
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
81 |
map.put("docker.support", dockerSupport()); |
39377
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
82 |
vmGC(map); // vm.gc.X = true/false |
50320
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
83 |
vmOptFinalFlags(map); |
39377
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
84 |
|
42511
8009d4cba2ea
8170228: register closed @requires property setter
iignatyev
parents:
42006
diff
changeset
|
85 |
VMProps.dump(map); |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
86 |
return map; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
87 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
88 |
|
39198
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
89 |
/** |
45823
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
90 |
* Prints a stack trace before returning null. |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
91 |
* Used by the various helper functions which parse information from |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
92 |
* VM properties in the case where they don't find an expected property |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
93 |
* or a propoerty doesn't conform to an expected format. |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
94 |
* |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
95 |
* @return null |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
96 |
*/ |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
97 |
private String nullWithException(String message) { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
98 |
new Exception(message).printStackTrace(); |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
99 |
return null; |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
100 |
} |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
101 |
|
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
102 |
/** |
39198
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
103 |
* @return vm.simpleArch value of "os.simpleArch" property of tested JDK. |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
104 |
*/ |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
105 |
protected String vmArch() { |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
106 |
String arch = System.getProperty("os.arch"); |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
107 |
if (arch.equals("x86_64") || arch.equals("amd64")) { |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
108 |
return "x64"; |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
109 |
} |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
110 |
else if (arch.contains("86")) { |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
111 |
return "x86"; |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
112 |
} else { |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
113 |
return arch; |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
114 |
} |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
115 |
} |
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
116 |
|
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
117 |
|
050eff9d3bcf
8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents:
37400
diff
changeset
|
118 |
|
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
119 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
120 |
* @return VM type value extracted from the "java.vm.name" property. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
121 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
122 |
protected String vmFlavor() { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
123 |
// E.g. "Java HotSpot(TM) 64-Bit Server VM" |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
124 |
String vmName = System.getProperty("java.vm.name"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
125 |
if (vmName == null) { |
45823
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
126 |
return nullWithException("Can't get 'java.vm.name' property"); |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
127 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
128 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
129 |
Pattern startP = Pattern.compile(".* (\\S+) VM"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
130 |
Matcher m = startP.matcher(vmName); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
131 |
if (m.matches()) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
132 |
return m.group(1).toLowerCase(); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
133 |
} |
45823
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
134 |
return nullWithException("Can't get VM flavor from 'java.vm.name'"); |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
135 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
136 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
137 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
138 |
* @return VM compilation mode extracted from the "java.vm.info" property. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
139 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
140 |
protected String vmCompMode() { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
141 |
// E.g. "mixed mode" |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
142 |
String vmInfo = System.getProperty("java.vm.info"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
143 |
if (vmInfo == null) { |
45823
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
144 |
return nullWithException("Can't get 'java.vm.info' property"); |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
145 |
} |
45823
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
146 |
if (vmInfo.toLowerCase().indexOf("mixed mode") != -1) { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
147 |
return "Xmixed"; |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
148 |
} else if (vmInfo.toLowerCase().indexOf("compiled mode") != -1) { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
149 |
return "Xcomp"; |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
150 |
} else if (vmInfo.toLowerCase().indexOf("interpreted mode") != -1) { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
151 |
return "Xint"; |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
152 |
} else { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
153 |
return nullWithException("Can't get compilation mode from 'java.vm.info'"); |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
154 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
155 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
156 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
157 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
158 |
* @return VM bitness, the value of the "sun.arch.data.model" property. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
159 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
160 |
protected String vmBits() { |
45823
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
161 |
String dataModel = System.getProperty("sun.arch.data.model"); |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
162 |
if (dataModel != null) { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
163 |
return dataModel; |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
164 |
} else { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
165 |
return nullWithException("Can't get 'sun.arch.data.model' property"); |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
166 |
} |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
167 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
168 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
169 |
/** |
39199
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
170 |
* @return "true" if Flight Recorder is enabled, "false" if is disabled. |
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
171 |
*/ |
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
172 |
protected String vmFlightRecorder() { |
39941
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
173 |
Boolean isUnlockedCommercialFatures = WB.getBooleanVMFlag("UnlockCommercialFeatures"); |
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
174 |
Boolean isFlightRecorder = WB.getBooleanVMFlag("FlightRecorder"); |
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
175 |
String startFROptions = WB.getStringVMFlag("StartFlightRecording"); |
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
176 |
if (isUnlockedCommercialFatures != null && isUnlockedCommercialFatures) { |
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
177 |
if (isFlightRecorder != null && isFlightRecorder) { |
39199
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
178 |
return "true"; |
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
179 |
} |
39941
fdbe314f004f
8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents:
39377
diff
changeset
|
180 |
if (startFROptions != null && !startFROptions.isEmpty()) { |
39199
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
181 |
return "true"; |
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
182 |
} |
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
183 |
} |
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
184 |
return "false"; |
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
185 |
} |
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
186 |
|
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
187 |
/** |
42006
98146f279bba
8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
39941
diff
changeset
|
188 |
* @return debug level value extracted from the "jdk.debug" property. |
98146f279bba
8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
39941
diff
changeset
|
189 |
*/ |
98146f279bba
8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
39941
diff
changeset
|
190 |
protected String vmDebug() { |
45823
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
191 |
String debug = System.getProperty("jdk.debug"); |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
192 |
if (debug != null) { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
193 |
return "" + debug.contains("debug"); |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
194 |
} else { |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
195 |
return nullWithException("Can't get 'jdk.debug' property"); |
f3cf2ee05985
8183534: [TEST] Make detection of compilation mode more robust
simonis
parents:
43394
diff
changeset
|
196 |
} |
42006
98146f279bba
8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
39941
diff
changeset
|
197 |
} |
98146f279bba
8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
39941
diff
changeset
|
198 |
|
98146f279bba
8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
39941
diff
changeset
|
199 |
/** |
42512
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
200 |
* @return true if VM supports JVMCI and false otherwise |
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
201 |
*/ |
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
202 |
protected String vmJvmci() { |
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
203 |
// builds with jvmci have this flag |
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
204 |
return "" + (WB.getBooleanVMFlag("EnableJVMCI") != null); |
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
205 |
} |
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
206 |
|
9e1dfd06e954
8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents:
42511
diff
changeset
|
207 |
/** |
43394
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
208 |
* @return true if VM runs in emulated-client mode and false otherwise. |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
209 |
*/ |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
210 |
protected String vmEmulatedClient() { |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
211 |
String vmInfo = System.getProperty("java.vm.info"); |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
212 |
if (vmInfo == null) { |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
213 |
return "false"; |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
214 |
} |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
215 |
return "" + vmInfo.contains(" emulated-client"); |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
216 |
} |
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
217 |
|
68ed4de0f9c8
8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents:
43389
diff
changeset
|
218 |
/** |
43389
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
219 |
* @return supported CPU features |
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
220 |
*/ |
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
221 |
protected String cpuFeatures() { |
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
222 |
return CPUInfo.getFeatures().toString(); |
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
223 |
} |
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
224 |
|
53ff01a9206a
8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents:
42512
diff
changeset
|
225 |
/** |
39377
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
226 |
* For all existing GC sets vm.gc.X property. |
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
227 |
* Example vm.gc.G1=true means: |
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
228 |
* VM supports G1 |
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
229 |
* User either set G1 explicitely (-XX:+UseG1GC) or did not set any GC |
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
230 |
* @param map - property-value pairs |
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
231 |
*/ |
49630 | 232 |
protected void vmGC(Map<String, String> map) { |
39377
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
233 |
for (GC gc: GC.values()) { |
49630 | 234 |
boolean isAcceptable = gc.isSupported() && (gc.isSelected() || GC.isSelectedErgonomically()); |
39377
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
235 |
map.put("vm.gc." + gc.name(), "" + isAcceptable); |
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
236 |
} |
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
237 |
} |
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
238 |
|
07739ee0b28a
8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents:
39199
diff
changeset
|
239 |
/** |
50320
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
240 |
* Selected final flag. |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
241 |
* @param map - property-value pairs |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
242 |
* @param flagName - flag name |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
243 |
*/ |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
244 |
private void vmOptFinalFlag(Map<String, String> map, String flagName) { |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
245 |
String value = WB.getBooleanVMFlag(flagName) ? "true" : "false"; |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
246 |
map.put("vm.opt.final." + flagName, value); |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
247 |
} |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
248 |
|
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
249 |
/** |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
250 |
* Selected sets of final flags. |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
251 |
* @param map -property-value pairs |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
252 |
*/ |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
253 |
protected void vmOptFinalFlags(Map<String, String> map) { |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
254 |
vmOptFinalFlag(map, "ClassUnloading"); |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
255 |
vmOptFinalFlag(map, "UseCompressedOops"); |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
256 |
} |
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
257 |
|
df02866807b6
8203923: Add @requires feature to check flag values for the running JVM
stefank
parents:
49630
diff
changeset
|
258 |
/** |
46225
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
259 |
* @return true if VM runs RTM supported OS and false otherwise. |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
260 |
*/ |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
261 |
protected String vmRTMOS() { |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
262 |
boolean isRTMOS = true; |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
263 |
|
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
264 |
if (Platform.isAix()) { |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
265 |
// Actually, this works since AIX 7.1.3.30, but os.version property |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
266 |
// is set to 7.1. |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
267 |
isRTMOS = (Platform.getOsVersionMajor() > 7) || |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
268 |
(Platform.getOsVersionMajor() == 7 && Platform.getOsVersionMinor() > 1); |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
269 |
|
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
270 |
} else if (Platform.isLinux()) { |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
271 |
if (Platform.isPPC()) { |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
272 |
isRTMOS = (Platform.getOsVersionMajor() > 4) || |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
273 |
(Platform.getOsVersionMajor() == 4 && Platform.getOsVersionMinor() > 1); |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
274 |
} |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
275 |
} |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
276 |
return "" + isRTMOS; |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
277 |
} |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
278 |
|
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
279 |
/** |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
280 |
* @return true if VM runs RTM supported CPU and false otherwise. |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
281 |
*/ |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
282 |
protected String vmRTMCPU() { |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
283 |
boolean vmRTMCPU = (Platform.isPPC() ? CPUInfo.hasFeature("tcheck") : CPUInfo.hasFeature("rtm")); |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
284 |
|
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
285 |
return "" + vmRTMCPU; |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
286 |
} |
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
287 |
|
f99654379e9c
8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents:
43394
diff
changeset
|
288 |
/** |
46238
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
289 |
* @return true if VM supports AOT and false otherwise |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
290 |
*/ |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
291 |
protected String vmAOT() { |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
292 |
// builds with aot have jaotc in <JDK>/bin |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
293 |
Path bin = Paths.get(System.getProperty("java.home")) |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
294 |
.resolve("bin"); |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
295 |
Path jaotc; |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
296 |
if (Platform.isWindows()) { |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
297 |
jaotc = bin.resolve("jaotc.exe"); |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
298 |
} else { |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
299 |
jaotc = bin.resolve("jaotc"); |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
300 |
} |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
301 |
return "" + Files.exists(jaotc); |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
302 |
} |
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
303 |
|
661b22bb24d2
8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents:
46225
diff
changeset
|
304 |
/** |
46242
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
305 |
* Check for CDS support. |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
306 |
* |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
307 |
* @return true if CDS is supported by the VM to be tested. |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
308 |
*/ |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
309 |
protected String vmCDS() { |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
310 |
if (WB.isCDSIncludedInVmBuild()) { |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
311 |
return "true"; |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
312 |
} else { |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
313 |
return "false"; |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
314 |
} |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
315 |
} |
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
316 |
|
9465c23e4e0d
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46239
diff
changeset
|
317 |
/** |
48155
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
318 |
* Check for CDS support for custom loaders. |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
319 |
* |
49008
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
320 |
* @return true if CDS provides support for customer loader in the VM to be tested. |
48155
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
321 |
*/ |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
322 |
protected String vmCDSForCustomLoaders() { |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
323 |
if (vmCDS().equals("true") && Platform.areCustomLoadersSupportedForCDS()) { |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
324 |
return "true"; |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
325 |
} else { |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
326 |
return "false"; |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
327 |
} |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
328 |
} |
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
329 |
|
551de50b4ff7
8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents:
47814
diff
changeset
|
330 |
/** |
49008
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
331 |
* Check for CDS support for archived Java heap regions. |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
332 |
* |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
333 |
* @return true if CDS provides support for archive Java heap regions in the VM to be tested. |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
334 |
*/ |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
335 |
protected String vmCDSForArchivedJavaHeap() { |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
336 |
if (vmCDS().equals("true") && WB.isJavaHeapArchiveSupported()) { |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
337 |
return "true"; |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
338 |
} else { |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
339 |
return "false"; |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
340 |
} |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
341 |
} |
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
342 |
|
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48957
diff
changeset
|
343 |
/** |
47576
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
344 |
* Check if Graal is used as JIT compiler. |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
345 |
* |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
346 |
* @return true if Graal is used as JIT compiler. |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
347 |
*/ |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
348 |
protected String isGraalEnabled() { |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
349 |
// Graal is enabled if following conditions are true: |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
350 |
// - we are not in Interpreter mode |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
351 |
// - UseJVMCICompiler flag is true |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
352 |
// - jvmci.Compiler variable is equal to 'graal' |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
353 |
// - TieredCompilation is not used or TieredStopAtLevel is greater than 3 |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
354 |
|
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
355 |
Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler"); |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
356 |
if (useCompiler == null || !useCompiler) |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
357 |
return "false"; |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
358 |
|
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
359 |
Boolean useJvmciComp = WB.getBooleanVMFlag("UseJVMCICompiler"); |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
360 |
if (useJvmciComp == null || !useJvmciComp) |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
361 |
return "false"; |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
362 |
|
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
363 |
// This check might be redundant but let's keep it for now. |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
364 |
String jvmciCompiler = System.getProperty("jvmci.Compiler"); |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
365 |
if (jvmciCompiler == null || !jvmciCompiler.equals("graal")) { |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
366 |
return "false"; |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
367 |
} |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
368 |
|
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
369 |
Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation"); |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
370 |
Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel"); |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
371 |
// if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
372 |
if (tieredCompilation != null && tieredCompilation && compLevel != null && compLevel <= 3) |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
373 |
return "false"; |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
374 |
|
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
375 |
return "true"; |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
376 |
} |
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
377 |
|
47615
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
378 |
|
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
379 |
/** |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
380 |
* A simple check for docker support |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
381 |
* |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
382 |
* @return true if docker is supported in a given environment |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
383 |
*/ |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
384 |
protected String dockerSupport() { |
49344
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
385 |
boolean isSupported = false; |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
386 |
if (Platform.isLinux()) { |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
387 |
// currently docker testing is only supported for Linux, |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
388 |
// on certain platforms |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
389 |
|
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
390 |
String arch = System.getProperty("os.arch"); |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
391 |
|
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
392 |
if (Platform.isX64()) { |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
393 |
isSupported = true; |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
394 |
} |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
395 |
else if (Platform.isAArch64()) { |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
396 |
isSupported = true; |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
397 |
} |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
398 |
else if (Platform.isS390x()) { |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
399 |
isSupported = true; |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
400 |
} |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
401 |
else if (arch.equals("ppc64le")) { |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
402 |
isSupported = true; |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
403 |
} |
48880
ee49ac008730
8196062: Enable docker container related tests for linux ppc64le
mbaesken
parents:
48155
diff
changeset
|
404 |
} |
47615
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
405 |
|
49344
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
406 |
if (isSupported) { |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
407 |
try { |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
408 |
isSupported = checkDockerSupport(); |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
409 |
} catch (Exception e) { |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
410 |
isSupported = false; |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
411 |
} |
e55d7a31cfa7
8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents:
49008
diff
changeset
|
412 |
} |
47615
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
413 |
|
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
414 |
return (isSupported) ? "true" : "false"; |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
415 |
} |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
416 |
|
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
417 |
private boolean checkDockerSupport() throws IOException, InterruptedException { |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
418 |
ProcessBuilder pb = new ProcessBuilder("docker", "ps"); |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
419 |
Process p = pb.start(); |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
420 |
p.waitFor(10, TimeUnit.SECONDS); |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
421 |
|
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
422 |
return (p.exitValue() == 0); |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
423 |
} |
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
424 |
|
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
425 |
|
6210a27c3704
8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents:
47576
diff
changeset
|
426 |
|
47576
7645833d326f
8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents:
46242
diff
changeset
|
427 |
/** |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
428 |
* Dumps the map to the file if the file name is given as the property. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
429 |
* This functionality could be helpful to know context in the real |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
430 |
* execution. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
431 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
432 |
* @param map |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
433 |
*/ |
42511
8009d4cba2ea
8170228: register closed @requires property setter
iignatyev
parents:
42006
diff
changeset
|
434 |
protected static void dump(Map<String, String> map) { |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
435 |
String dumpFileName = System.getProperty("vmprops.dump"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
436 |
if (dumpFileName == null) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
437 |
return; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
438 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
439 |
List<String> lines = new ArrayList<>(); |
39199
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
440 |
map.forEach((k, v) -> lines.add(k + ":" + v)); |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
441 |
try { |
42511
8009d4cba2ea
8170228: register closed @requires property setter
iignatyev
parents:
42006
diff
changeset
|
442 |
Files.write(Paths.get(dumpFileName), lines, StandardOpenOption.APPEND); |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
443 |
} catch (IOException e) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
444 |
throw new RuntimeException("Failed to dump properties into '" |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
445 |
+ dumpFileName + "'", e); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
446 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
447 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
448 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
449 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
450 |
* This method is for the testing purpose only. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
451 |
* @param args |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
452 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
453 |
public static void main(String args[]) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
454 |
Map<String, String> map = new VMProps().call(); |
39199
ec6fd961811c
8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents:
39198
diff
changeset
|
455 |
map.forEach((k, v) -> System.out.println(k + ": '" + v + "'")); |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
456 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
457 |
} |