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