tests.xml revision 4978
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher<!--
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! CDDL HEADER START
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher !
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! The contents of this file are subject to the terms of the
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! Common Development and Distribution License, Version 1.0 only
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! (the "License"). You may not use this file except in compliance
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! with the License.
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher !
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! You can obtain a copy of the license at
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! See the License for the specific language governing permissions
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! and limitations under the License.
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher !
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! When distributing Covered Code, include this CDDL HEADER in each
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! file and include the License file at
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! add the following below this CDDL HEADER, with the fields enclosed
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! by brackets "[]" replaced with your own identifying information:
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! Portions Copyright [yyyy] [name of copyright owner]
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher !
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! CDDL HEADER END
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher !
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher !
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! Copyright 2008-2009 Sun Microsystems, Inc.
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher ! -->
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher<project name="tests">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <description>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher Execute the tests.
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </description>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <target name="specs">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <javac srcdir="${shared.dir}/java/parsingtool"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher destdir="${shared.dir}/java/parsingtool"
749cfb5d3270b5daf389d51a0dbd3fd2aec6e05dJakub Hrozek debug="true"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher debuglevel="lines,vars,source"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher verbose="yes"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher />
9aa117a93e315f790a1922d9ac7bd484878b621eJakub Hrozek <delete dir="${logs.dir}/specs" failonerror="false"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <mkdir dir="${logs.dir}/specs"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <java classpath="${shared.dir}/java/parsingtool"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher classname="GenerateOpenDSTestSpecs" fork="true">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <!-- uncomment "agentlib" if need debugger waiting for you
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <jvmarg value="-agentlib:jdwp=transport=dt_socket,suspend=y,server=y,address=7778"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher -->
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <arg value="${tests.dir}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <arg value="${logs.dir}/specs"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <arg value="xml" />
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </java>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek </target>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <target name="run">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <tstamp>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <format property="tests.run.time" pattern="yyyy.MM.dd-HH.mm.ss"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </tstamp>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <!-- clean up tmp dir -->
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${tests.mode}" arg2="local"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <delete dir="${tests.tmp.dir}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <mkdir dir="${tests.tmp.dir}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </if>
749cfb5d3270b5daf389d51a0dbd3fd2aec6e05dJakub Hrozek
9aa117a93e315f790a1922d9ac7bd484878b621eJakub Hrozek <!-- make all the necessary directories for this test run -->
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <mkdir dir="${tests.run.dir}/${tests.run.time}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <mkdir dir="${tests.run.dir}/${tests.run.time}/config"/>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek <!-- these will serve for after-the-fact archiving the logs -->
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek <mkdir dir="${tests.run.dir}/${tests.run.time}/staf-logs"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${test.plan.custom}" arg2=""/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <var name="test.plan.custom" value="${test.plan.default}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <!-- generate the config file that will be used for this run -->
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <copy file="${tests.config.stubs}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher tofile="${tests.run.dir}/${tests.run.time}/config/${tests.config.file}">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <filterchain>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <expandproperties/>
749cfb5d3270b5daf389d51a0dbd3fd2aec6e05dJakub Hrozek </filterchain>
9aa117a93e315f790a1922d9ac7bd484878b621eJakub Hrozek </copy>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
749cfb5d3270b5daf389d51a0dbd3fd2aec6e05dJakub Hrozek <!-- generate the topology files that will be used for this run -->
749cfb5d3270b5daf389d51a0dbd3fd2aec6e05dJakub Hrozek <copy todir="${tests.run.dir}/${tests.run.time}/config">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <fileset dir="${tests.topology.dir}">
61ab73554e03a2eea4ef51bc5ef02676632eaf6aJakub Hrozek <include name="**/*.txt"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </fileset>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek <filterchain>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <expandproperties/>
9aa117a93e315f790a1922d9ac7bd484878b621eJakub Hrozek </filterchain>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </copy>
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <!-- this is a windows-specific measure to replace the windows file
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher separator by a forward slash. Staf otherwise fails to find the files. -->
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <replace file="${tests.run.dir}/${tests.run.time}/config/${tests.config.file}" token="\" value="/"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="tests.request" value="EXECUTE FILE ${tests.xml} JOBNAME OpenDS_${tests.type} SCRIPTFILE ${tests.run.dir}/${tests.run.time}/config/${tests.config.file} WAIT CLEARLOGS"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo>While the tests are running you may tail the job logs at</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo>${staf.install.dir}/${staf.name}/logs/MACHINE/${host.name}</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo>Running tests. This will take more than a while.</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="CLASSPATH" value="${staf.lib.dir}/JSTAF.jar:."/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <exec
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher dir="${staf.bin.dir}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher executable="${staf.executable}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher >
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <arg line="LOCAL STAX ${tests.request}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar:."/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <env key="LD_LIBRARY_PATH" value="${staf.lib.dir}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <env key="STAFCONVDIR" value="${staf.install.dir}/${staf.name}/codepage"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <env key="STAFCODEPAGE" value="LATIN_1"/>
e4ba22c165be4b0ccd0e1b9fc92f2f1e35f78a82Petr Cech </exec>
e4ba22c165be4b0ccd0e1b9fc92f2f1e35f78a82Petr Cech
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <symlink link="${tests.run.dir}/latest" resource="${tests.run.time}" overwrite="true"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo>Report is available at</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo>${tests.run.dir}/latest</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </target>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <target name="configure">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo>* Tests configuration</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Run the tests on the local machine or on a remote machine?"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="local"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher validargs="local,remote"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="tests.mode.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter local hostname:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${local.hostname}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="local.hostname.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${tests.mode.input}" arg2="remote"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov <input message=" Enter remote hostname:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue=""
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="remote.hostname.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <!-- Tests-defined values -->
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov <if>
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov <available file="${basedir}/${tests.type}-${local.hostname.input}-${remote.hostname.input}.properties"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <var file="${basedir}/${tests.type}-${local.hostname.input}-${remote.hostname.input}.properties"/>
64ddff90c7fcc02ccb06824ac93af7d5f361a88fJan Zeleny </then>
64ddff90c7fcc02ccb06824ac93af7d5f361a88fJan Zeleny </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="remote.hostname.input" value="${local.hostname.input}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <!-- Tests-defined values -->
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <available file="${basedir}/${tests.type}-${local.hostname.input}.properties"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <var file="${basedir}/${tests.type}-${local.hostname.input}.properties"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${tests.type}" arg2="stress-tests"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter client hostname:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${client.hostname}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="client.hostname.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter ldclt path (on client machine):"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${ldclt.dir}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="ldclt.dir.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="client.hostname.input" value="${client.hostname}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="ldclt.dir.input" value="${ldclt.dir}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter path to logs directory:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${logs.dir}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="logs.dir.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter path to OpenDS archive:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${opends.dir}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="opends.dir.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter OpenDS name:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${opends.name}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="opends.name.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter java home:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${local.javahome}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="local.javahome.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${tests.mode.input}" arg2="remote" />
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter java home (on remote machine):"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${remote.javahome}"
749cfb5d3270b5daf389d51a0dbd3fd2aec6e05dJakub Hrozek addproperty="remote.javahome.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="remote.javahome.input" value="${local.javahome.input}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${tests.mode.input}" arg2="remote" />
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter directory instance directory (on remote machine):"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${tests.tmp.dir}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="tests.tmp.dir.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter directory instance directory:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${tests.tmp.dir}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="tests.tmp.dir.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter OpenDMK lib directory:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${snmp.opendmk.lib.dir}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="snmp.opendmk.lib.dir.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Use default directory instance?"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${tests.default}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher validargs="true,false"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="tests.default.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${tests.default.input}" arg2="false"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter OpenDS ldap port:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${opends.port.ldap}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="opends.port.ldap.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter OpenDS admin port:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${opends.port.admin}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="opends.port.admin.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter OpenDS secure ldap port:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${opends.port.ldaps}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="opends.port.ldaps.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter OpenDS admin DN (also called root DN):"
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek defaultvalue="${opends.admin.dn}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="opends.admin.dn.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Enter OpenDS admin password:"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${opends.admin.pwd}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="opends.admin.pwd.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="opends.port.ldap.input" value="${opends.port.ldap}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="opends.port.admin.input" value="${opends.port.admin}"/>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek <property name="opends.port.ldaps.input" value="${opends.port.ldaps}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="opends.admin.dn.input" value="${opends.admin.dn}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="opends.admin.pwd.input" value="${opends.admin.pwd}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </else>
4fcc50e133f90cd4c5931a3ac48c84cb628b16fcMichal Zidek </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Run tests using verbose mode?"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="${verbose.mode}"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher validargs="true,false"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="verbose.mode.input"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo>* Test plan configuration</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${test.plan.custom}" arg2=""/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo> No previous customized test plan found.</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <property name="prompt" value="y"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <else>
4fcc50e133f90cd4c5931a3ac48c84cb628b16fcMichal Zidek <echo> A previously customized test plan was detected:</echo>
4fcc50e133f90cd4c5931a3ac48c84cb628b16fcMichal Zidek <echo> ${test.plan.custom}</echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <echo></echo>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Do you want to change the list of suites to run?"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher validargs="y,n"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="n"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="prompt"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${prompt}" arg2="y" />
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <var name="test.plan.custom" value=""/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <input message=" Do you want to execute all the tests?"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher validargs="y,n"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher defaultvalue="y"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher addproperty="answer"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${answer}" arg2="y" />
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <if>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <equals arg1="${tests.type}" arg2="functional-tests"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <var name="test.plan.custom" value="${test.plan.functional.default}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </then>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <else>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <var name="test.plan.custom" value="${test.plan.stress.default}"/>
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher </else>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek </if>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek </then>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek <else>
ca344fdecdf127c80ad1074047aeba21e1165313Jakub Hrozek <for param="item">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <dirset dir="${tests.dir}/testcases"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher includes="*"
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher excludes="quickstart,sample">
796463906a54e259bd5b582ce84af4297a58eafcStephen Gallagher <type type="dir"/>
</dirset>
<sequential>
<var name="test" unset="true"/>
<var name="answer" unset="true"/>
<basename property="test" file="@{item}"/>
<input message=" Do you want to execute ${test}?"
validargs="y,n"
defaultvalue="y"
addproperty="answer"/>
<if>
<equals arg1="${answer}" arg2="y" />
<then>
<if>
<equals arg1="${test.plan.custom}" arg2=""/>
<then>
<var name="test.plan.custom" value="${test}"/>
</then>
<else>
<var name="test.plan.custom" value="${test.plan.custom},${test}"/>
</else>
</if>
</then>
</if>
</sequential>
</for>
</else>
</if>
</then>
</if>
<echo>Saving ...</echo>
<if>
<equals arg1="${tests.mode.input}" arg2="remote"/>
<then>
<property name="property.file" value="${tests.type}-${local.hostname.input}-${remote.hostname.input}.properties"/>
</then>
<else>
<property name="property.file" value="${tests.type}-${local.hostname.input}.properties"/>
</else>
</if>
<echo file="${basedir}/${property.file}"># Tests-defined values
# This file is generated by "build tests-configure" command
tests.mode=${tests.mode.input}
local.hostname=${local.hostname.input}
local.javahome=${local.javahome.input}
remote.hostname=${remote.hostname.input}
remote.javahome=${remote.javahome.input}
client.hostname=${client.hostname.input}
logs.dir=${logs.dir.input}
opends.dir=${opends.dir.input}
opends.name=${opends.name.input}
tests.tmp.dir=${tests.tmp.dir.input}
tests.default=${tests.default.input}
opends.port.ldap=${opends.port.ldap.input}
opends.port.admin=${opends.port.admin.input}
opends.port.ldaps=${opends.port.ldaps.input}
opends.admin.dn=${opends.admin.dn.input}
opends.admin.pwd=${opends.admin.pwd.input}
snmp.opendmk.lib.dir=${snmp.opendmk.lib.dir.input}
ldclt.dir=${ldclt.dir.input}
verbose.mode=${verbose.mode.input}
wc.type=tomcat
test.plan.custom=${test.plan.custom}</echo>
</target>
<target name="coverage-init">
<path id="emma.lib">
<pathelement location="${project.home}/ext/emma/lib/emma.jar" />
<pathelement location="${project.home}/ext/emma/lib/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
</target>
<target name="coverage-on" depends="coverage-init">
<property name="coverage.on" value="true"/>
</target>
<target name="coverage-instrument" if="coverage.on">
<delete dir="${tests.tmp.dir}/coverage-instr" />
<mkdir dir="${tests.tmp.dir}/coverage-instr" />
<!-- unzip the original package in a temporary location to make the
changes necessary so that the coverage tool is called
-->
<unzip src="${opends.dir}/${opends.name}.zip"
dest="${tests.tmp.dir}/coverage-instr"/>
<!-- Add emma in the package along with the other librairies
this has the advantage of being automatically picked up by the scripts
-->
<copy file="${project.home}/ext/emma/lib/emma.jar"
tofile="${tests.tmp.dir}/coverage-instr/${opends.name}/lib/emma.jar"/>
<!-- move the original product package to make room for the coverage
enabled package
-->
<move file="${opends.dir}/${opends.name}.zip" tofile="${opends.dir}/${opends.name}.zip.nocov"/>
<!-- intrument the OpenDS java archive to gather coverage -->
<java classpath="${tests.tmp.dir}/coverage-instr/${opends.name}/lib/emma.jar"
classname="emma" fork="true">
<jvmarg value="-Demma.metadata.out.file=${tests.tmp.dir}/coverage-instr/${opends.name}/coverage.em" />
<arg value="instr" />
<arg value="-m" />
<arg value="overwrite" />
<arg value="-ix" />
<arg value="-org.opends.guitools.*" />
<arg value="-ix" />
<arg value="-org.opends.quicksetup.*" />
<arg value="-ix" />
<arg value="org.*" />
<arg value="-ix" />
<arg value="com.*" />
<arg value="-ip" />
<arg value="${tests.tmp.dir}/coverage-instr/${opends.name}/lib/OpenDS.jar:${tests.tmp.dir}/coverage-instr/${opends.name}/lib/extensions/snmp-mib2605.jar" />
</java>
<copy file="${tests.tmp.dir}/coverage-instr/${opends.name}/coverage.em"
tofile="${tests.run.dir}/${tests.run.time}/coverage/coverage.em"/>
<!-- Repackage the product with coverage enabled scripts -->
<zip basedir="${tests.tmp.dir}/coverage-instr" destfile="${opends.dir}/${opends.name}.zip">
<zipfileset dir="${tests.tmp.dir}/coverage-instr"
includes="${opends.name}/setup,${opends.name}/uninstall,${opends.name}/upgrade,${opends.name}/bin/*,${opends.name}/lib/*.sh"
filemode="755" dirmode="755" />
</zip>
<!-- <delete dir="${tests.tmp.dir}/coverage-instr"/> -->
</target>
<target name="restore-pkg" if="coverage.on">
<delete file="${opends.dir}/${opends.name}.zip"/>
<move file="${opends.dir}/${opends.name}.zip.nocov" tofile="${opends.dir}/${opends.name}.zip"/>
</target>
<target name="testwithcoverage" depends="coverage-on,coverage-instrument,run,restore-pkg"/>
</project>