Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/RasapiTest/test.xml
6000 views
1
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
<!--
3
Copyright (c) 2016, 2022 IBM Corp. and others
4
5
This program and the accompanying materials are made available under
6
the terms of the Eclipse Public License 2.0 which accompanies this
7
distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
or the Apache License, Version 2.0 which accompanies this distribution and
9
is available at https://www.apache.org/licenses/LICENSE-2.0.
10
11
This Source Code may also be made available under the following
12
Secondary Licenses when the conditions for such availability set
13
forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
General Public License, version 2 with the GNU Classpath
15
Exception [1] and GNU General Public License, version 2 with the
16
OpenJDK Assembly Exception [2].
17
18
[1] https://www.gnu.org/software/classpath/license.html
19
[2] http://openjdk.java.net/legal/assembly-exception.html
20
21
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
22
-->
23
<project name="Launcher script for com.ibm.jvm.ras.tests" default="help" basedir=".">
24
<target name="help">
25
<echo>Ant script to run the tests for the com.ibm.jvm.Dump API.
26
First it runs the suite of tests defined in DumpAPISuite
27
Then it runs the Security tests with security on and the permission not granted.
28
This should show the correct methods are blocked.
29
Then it adds com.ibm.jvm.DumpPermssion to the security file and reruns the Basic and
30
QuerySetReset tests to confirm they work when security is on.
31
</echo>
32
</target>
33
34
<target name="launch_test">
35
<!--Depending on the machine we run on the ant launcher script may hardcode the VM
36
we end up using. We want to use the VM we are testing so that ant can manage the
37
security properties.
38
We can't fork the tests as then the permissions settings are ignored.
39
So we're just going to have to launch it manually...
40
(Luckily the ant manual gives the java task you need to launch ant:
41
http://ant.apache.org/manual/running.html#viajava )
42
-->
43
44
<java jvm="${test.java.home}/bin/java"
45
classname="org.apache.tools.ant.launch.Launcher"
46
fork="true"
47
failonerror="true"
48
dir="${basedir}"
49
timeout="1800000"
50
taskname="test">
51
<classpath>
52
<pathelement location="${ant.home}/lib/ant-launcher.jar" />
53
</classpath>
54
<jvmarg value="-showversion" />
55
<jvmarg value="-Xmx128M" />
56
<arg value="-buildfile" />
57
<arg file="${ant.file}" />
58
<arg value="test" />
59
</java>
60
</target>
61
62
<target name="test">
63
<!-- Run most tests with security disabled. -->
64
<echo message="Running com.ibm.jvm.ras.tests.DumpAPIBasicTests" />
65
<junit fork="yes" showoutput="true" haltonfailure="true">
66
<jvmarg value="-showversion" />
67
<jvmarg value="-Xgcpolicy:optthruput" />
68
<jvmarg value="-Xms1200M" />
69
<jvmarg value="-Xmx1200M" />
70
<classpath>
71
<pathelement location="junit4.jar" />
72
<pathelement location="com.ibm.jvm.ras.tests.jar" />
73
</classpath>
74
<formatter type="plain" usefile="false" />
75
<test name="com.ibm.jvm.ras.tests.DumpAPIBasicTests" />
76
</junit>
77
<echo message="Running com.ibm.jvm.ras.tests.DumpAPITriggerTests" />
78
<junit fork="yes" showoutput="true" haltonfailure="true">
79
<jvmarg value="-showversion" />
80
<jvmarg value="-Xgcpolicy:optthruput" />
81
<jvmarg value="-Xms1200M" />
82
<jvmarg value="-Xmx1200M" />
83
<classpath>
84
<pathelement location="junit4.jar" />
85
<pathelement location="com.ibm.jvm.ras.tests.jar" />
86
</classpath>
87
<formatter type="plain" usefile="false" />
88
<test name="com.ibm.jvm.ras.tests.DumpAPITriggerTests" />
89
</junit>
90
<echo message="Running com.ibm.jvm.ras.tests.DumpAPIQuerySetReset" />
91
<junit fork="yes" showoutput="true" haltonfailure="true">
92
<jvmarg value="-showversion" />
93
<jvmarg value="-Xgcpolicy:optthruput" />
94
<jvmarg value="-Xms1200M" />
95
<jvmarg value="-Xmx1200M" />
96
<classpath>
97
<pathelement location="junit4.jar" />
98
<pathelement location="com.ibm.jvm.ras.tests.jar" />
99
</classpath>
100
<formatter type="plain" usefile="false" />
101
<test name="com.ibm.jvm.ras.tests.DumpAPIQuerySetReset" />
102
</junit>
103
<echo message="Running com.ibm.jvm.ras.tests.DumpAPITokensTests" />
104
<junit fork="yes" showoutput="true" haltonfailure="true">
105
<jvmarg value="-showversion" />
106
<jvmarg value="-Xgcpolicy:optthruput" />
107
<jvmarg value="-Xms1200M" />
108
<jvmarg value="-Xmx1200M" />
109
<classpath>
110
<pathelement location="junit4.jar" />
111
<pathelement location="com.ibm.jvm.ras.tests.jar" />
112
</classpath>
113
<formatter type="plain" usefile="false" />
114
<test name="com.ibm.jvm.ras.tests.DumpAPITokensTests" />
115
</junit>
116
<echo message="Running com.ibm.jvm.ras.tests.DumpAPISetTestXdumpdynamic with Xdump:dynamic" />
117
<junit fork="yes" showoutput="true" haltonfailure="true">
118
<jvmarg value="-showversion" />
119
<jvmarg value="-Xgcpolicy:optthruput" />
120
<jvmarg value="-Xms1200M" />
121
<jvmarg value="-Xmx1200M" />
122
<jvmarg value="-Xdump:dynamic" />
123
<classpath>
124
<pathelement location="junit4.jar" />
125
<pathelement location="com.ibm.jvm.ras.tests.jar" />
126
</classpath>
127
<formatter type="plain" usefile="false" />
128
<test name="com.ibm.jvm.ras.tests.DumpAPISetTestXdumpdynamic" />
129
</junit>
130
<!-- Run security tests (that assume dumping will fail) with security enabled. -->
131
<!-- These need to be run with fork="no" to preserve the security settings -->
132
<echo message="Running com.ibm.jvm.ras.tests.[Dump|Log|Trace]APISecurityTests" />
133
<junit fork="no" showoutput="true" haltonfailure="true">
134
<permissions>
135
<!--Turn on security, remove the dump permissions. -->
136
<grant class="java.security.AllPermission" />
137
<revoke class="com.ibm.jvm.DumpPermission" />
138
<revoke class="com.ibm.jvm.LogPermission" />
139
<revoke class="com.ibm.jvm.ToolDumpPermission" />
140
<revoke class="com.ibm.jvm.TracePermission" />
141
</permissions>
142
<classpath>
143
<pathelement location="junit4.jar" />
144
<pathelement location="com.ibm.jvm.ras.tests.jar" />
145
</classpath>
146
<formatter type="plain" usefile="false" />
147
<test name="com.ibm.jvm.ras.tests.DumpAPISecurityTests" />
148
<test name="com.ibm.jvm.ras.tests.LogAPISecurityTests" />
149
<test name="com.ibm.jvm.ras.tests.TraceAPISecurityTests" />
150
</junit>
151
<!-- Run tool dump security test and one normal test with DumpPermission but without ToolDumpPermission -->
152
<echo message="Running com.ibm.jvm.ras.tests.DumpAPIToolSecuritySuite" />
153
<junit fork="no" showoutput="true" haltonfailure="true">
154
<permissions>
155
<!--Turn on security, remove the tool dump permission. -->
156
<grant class="java.security.AllPermission" />
157
<revoke class="com.ibm.jvm.ToolDumpPermission" />
158
</permissions>
159
<classpath>
160
<pathelement location="junit4.jar" />
161
<pathelement location="com.ibm.jvm.ras.tests.jar" />
162
</classpath>
163
<formatter type="plain" usefile="false" />
164
<test name="com.ibm.jvm.ras.tests.DumpAPIToolSecuritySuite" />
165
</junit>
166
<echo message="ALL TESTS PASSED" />
167
</target>
168
</project>
169
170