buildframework/helium/tools/testing/ats/ats.ant.xml
branchhelium-9.0
changeset 618 df88fead2976
parent 587 85df38eb4012
equal deleted inserted replaced
587:85df38eb4012 618:df88fead2976
   197             <else>
   197             <else>
   198                 <property name="ats.drop.location.file" location="${build.output.dir}/ats/${ats.drop.file}" />
   198                 <property name="ats.drop.location.file" location="${build.output.dir}/ats/${ats.drop.file}" />
   199             </else>
   199             </else>
   200         </if>
   200         </if>
   201 
   201 
   202         <!-- Notify ATS about the drop. -->
   202         <trycatch property="exception">
   203         <if>
   203             <try>
   204             <istrue value="${ats4.enabled}" />
   204                 <!-- Notify ATS about the drop. -->
   205             <then>
   205                 <if>
   206                 <hlm:python failonerror="true">
   206                     <istrue value="${ats4.enabled}" />
       
   207                     <then>
       
   208                         <hlm:python failonerror="true">
   207 version = r'${java.version}'
   209 version = r'${java.version}'
   208 if '1.6.0' in version:
   210 if '1.6.0' in version:
   209     assert int(version.split('_')[1]) > 6, 'Java 6 u7 required'
   211     assert int(version.split('_')[1]) > 6, 'Java 6 u7 required'
   210                 </hlm:python>
   212                         </hlm:python>
   211                 <condition property="ats.import.arg" value="-import" else="">
   213                         <condition property="ats.import.arg" value="-import" else="">
   212                     <equals arg1="${ats.script.type}" arg2="import" />
   214                             <equals arg1="${ats.script.type}" arg2="import" />
   213                 </condition>
   215                         </condition>
   214                 <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
   216                         <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
   215                     <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
   217                             <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
   216                 </condition>
   218                         </condition>
   217                 <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="1024m" failonerror="true">
   219                         <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="1024m" failonerror="true">
   218                     <classpath>
       
   219                         <pathelement path="${java.class.path}"/>
       
   220                         <fileset dir="${ats4.libs}" includes="*.jar"/>
       
   221                     </classpath>
       
   222                     <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
       
   223                 </java>
       
   224             </then>
       
   225             <else>
       
   226                 <if>
       
   227                     <and>
       
   228                         <equals arg1="${ats.script.type}" arg2="import" />
       
   229                         <available classname="com.nokia.taitei.util.TestDropImporter"/>
       
   230                     </and>
       
   231                     <then>
       
   232                         <java classname="com.nokia.taitei.util.TestDropImporter" fork="true" maxmemory="1024m" failonerror="true">
       
   233                             <classpath>
   220                             <classpath>
   234                                 <pathelement path="${java.class.path}"/>
   221                                 <pathelement path="${java.class.path}"/>
       
   222                                 <fileset dir="${ats4.libs}" includes="*.jar"/>
   235                             </classpath>
   223                             </classpath>
   236                             <arg line="${ats.server} ${ats.drop.location.file} ${ats.username} ${ats.password}"/>
   224                             <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
   237                         </java>
   225                         </java>
   238                     </then>
   226                     </then>
   239                     <else>
   227                     <else>
   240                         <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
   228                         <if>
   241                             <equals arg1="${ats.script.type}" arg2="import" />
   229                             <and>
   242                         </condition>
   230                                 <equals arg1="${ats.script.type}" arg2="import" />
   243                         <exec executable="cscript" dir="${build.drive}/" failonerror="true">
   231                                 <available classname="com.nokia.taitei.util.TestDropImporter"/>
   244                             <env key="ats3.username" value="${ats.username}" />
   232                                 <not>
   245                             <env key="ats3.password" value="${ats.password}" />
   233                                     <istrue value="${ats.disable.java.importer}" />
   246                             <env key="ats3.host" value="${ats.server}" />
   234                                 </not>
   247                             <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
   235                             </and>
   248                             <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
   236                             <then>
   249                         </exec>
   237                                 <java classname="com.nokia.taitei.util.TestDropImporter" fork="true" maxmemory="1024m" failonerror="true">
       
   238                                     <classpath>
       
   239                                         <pathelement path="${java.class.path}"/>
       
   240                                     </classpath>
       
   241                                     <arg line="${ats.server} ${ats.drop.location.file} ${ats.username} ${ats.password}"/>
       
   242                                 </java>
       
   243                             </then>
       
   244                             <else>
       
   245                                 <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
       
   246                                     <equals arg1="${ats.script.type}" arg2="import" />
       
   247                                 </condition>
       
   248                                 <exec executable="cscript" dir="${build.drive}/" failonerror="true">
       
   249                                     <env key="ats3.username" value="${ats.username}" />
       
   250                                     <env key="ats3.password" value="${ats.password}" />
       
   251                                     <env key="ats3.host" value="${ats.server}" />
       
   252                                     <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
       
   253                                     <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
       
   254                                 </exec>
       
   255                             </else>
       
   256                         </if>             
   250                     </else>
   257                     </else>
   251                 </if>             
   258                 </if>
   252             </else>
   259             </try>
   253         </if>
   260             <catch>
       
   261                 <echo message="Error: ${exception}"/>
       
   262             </catch>
       
   263         </trycatch>
   254     </target>
   264     </target>
   255 
   265 
   256     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
   266     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
   257     <target name="ats-set-flash-image-path" unless="ats.emulator.enable">
   267     <target name="ats-set-flash-image-path" unless="ats.emulator.enable">
   258         <pathconvert pathsep="," property="ats.flash.images">
   268         <pathconvert pathsep="," property="ats.flash.images">
   261         <script language="jython" setbeans="false">
   271         <script language="jython" setbeans="false">
   262 if project.getProperty('ats.disable.iconfig') == None:
   272 if project.getProperty('ats.disable.iconfig') == None:
   263     import atsant
   273     import atsant
   264     ic = None
   274     ic = None
   265     try:
   275     try:
   266         ic = atsant.IConfigATS(project.getProperty('release.images.dir'))
   276         ic = atsant.IConfigATS(project.getProperty('release.images.dir'), project.getProperty('ats.product.name'))
   267     except Exception, ex:
   277     except Exception, ex:
   268         print ex
   278         print ex
   269     if ic:
   279     if ic:
   270         project.setProperty('ats.flash.images', ic.findimages())
   280         project.setProperty('ats.flash.images', ic.findimages())
   271         </script>
   281         </script>
   491                             <arg value="--specific-pkg=${ats.specific.pkg}" />
   501                             <arg value="--specific-pkg=${ats.specific.pkg}" />
   492                             <arg value="--hti=${ats.hti}" />
   502                             <arg value="--hti=${ats.hti}" />
   493                             <arg value="--verbose" />
   503                             <arg value="--verbose" />
   494                             <arg line="${module.tsrc.@{module}}" />
   504                             <arg line="${module.tsrc.@{module}}" />
   495                         </exec>
   505                         </exec>
   496                         <runtarget target="do-ats-test" />
   506                         <antcall target="do-ats-test" />
   497                         <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
   507                         <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
   498                     </sequential>
   508                     </sequential>
   499                 </for>
   509                 </for>
   500             </else>
   510             </else>
   501         </if>
   511         </if>
   715             <else>
   725             <else>
   716                 <property name="ats.flash.images" value="${build.output.dir}/ats/${build.id}_emulator_urel.zip"/>
   726                 <property name="ats.flash.images" value="${build.output.dir}/ats/${build.id}_emulator_urel.zip"/>
   717             </else>
   727             </else>
   718         </if>        
   728         </if>        
   719     </target>
   729     </target>
       
   730     
       
   731     <!-- Generate and upload drop using custom template -->
       
   732     <target name="ats-custom-drop">
       
   733         <mkdir dir="${build.output.dir}/ats" />
       
   734         <runtarget target="ats-set-flash-image-path" />
       
   735         <runtarget target="ats-set-defaults-stifeunit" />
       
   736         <property name="ats.custom.template" value="${helium.dir}/tools/testing/ats/templates/ats4_naviengine_template.xml"/>
       
   737         <exec executable="python">
       
   738             <arg line="-Wignore -m ats3.custom" />
       
   739             <arg value="--custom-template=${ats.custom.template}" />
       
   740             <arg value="--device-type=${ats.product.name}" />
       
   741             <arg value="${internal.ats.diamonds.arg}" />
       
   742             <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
       
   743             <arg value="--report-email=${ats.email.list}" />
       
   744             <arg value="--testrun-name=${ats.testrun.name}" />
       
   745             <arg value="--flash-images=${ats.flash.images}" />
       
   746             <arg value="--test-timeout=${ats.test.timeout}" />
       
   747             <arg value="--test-type=${ats.custom.test.type}" />
       
   748         </exec>
       
   749         <runtarget target="do-ats-test" />
       
   750     </target>
       
   751 
   720 </project>
   752 </project>