buildframework/helium/tools/testing/ats/ats.ant.xml
changeset 217 0f5e3a7fb6af
parent 179 d8ac696cc51f
child 587 85df38eb4012
equal deleted inserted replaced
181:59bb7c4d6172 217:0f5e3a7fb6af
    18 
    18 
    19 Description:
    19 Description:
    20 
    20 
    21 ============================================================================
    21 ============================================================================
    22 -->
    22 -->
       
    23 <!--* @package testing -->
    23 <project name="_testing.ats" xmlns:hlm="http://www.nokia.com/helium">
    24 <project name="_testing.ats" xmlns:hlm="http://www.nokia.com/helium">
    24     <description>
    25     <description>
    25         ATS testing targets.
    26     ATS testing targets.
    26     </description>
    27     </description>
       
    28     
       
    29     <!--* @property enabled.ats
       
    30     Value must be set to execute ats-test target.
       
    31     @type boolean
       
    32     @editable required
       
    33     @scope public
       
    34     -->
       
    35     
       
    36     <!--* @property enabled.aste
       
    37     Value must be set to execute ats-aste target.
       
    38     @type boolean
       
    39     @editable required
       
    40     @scope public
       
    41     -->
       
    42     
       
    43     <!--* @property ats.product.name
       
    44     Name of the product to be tested. For example: "PRODUCT"
       
    45     @type string
       
    46     @editable required
       
    47     @scope public
       
    48     -->
       
    49     
       
    50     <!--* @property ats.drop.location
       
    51     Server location (UNC path) to save the ATS3Drop file, before sending to the ATS. For example: \\trwsem00\some_folder\. In case, ``ats.script.type`` is set to "import", ATS doesn't need to have access to ats.drop.location, its value can be any local folder on build machine, for example c:\temp (no network share needed).
       
    52     @type string
       
    53     @editable required
       
    54     @scope public
       
    55     -->
       
    56     
       
    57     <!--* @property ats.server
       
    58     For example: "4fio00105" or "catstresrv001.cats.noklab.net:80". Default server port is "8080", but it is not allowed between intra and Noklab. Because of this we need to define server port as 80. The host can be different depending on site and/or product.
       
    59     @type string
       
    60     @editable required
       
    61     @scope public
       
    62     -->
       
    63     
       
    64     <!--* @property ats.password
       
    65     Password for ATS. This password might be different from NOE or HTTP/UNIX password.
       
    66     @type string
       
    67     @editable required
       
    68     @scope public
       
    69     -->
       
    70     
       
    71     <!--* @property ats.username
       
    72     Username for ATS server. This is NOT the NOE or HTTP/UNIX username.
       
    73     @type string
       
    74     @editable required
       
    75     @scope public
       
    76     -->
       
    77     
       
    78     
    27     <!-- -->
    79     <!-- -->
    28     <fileset id="reference.ats.flash.images" dir="${release.images.dir}">
    80     <fileset id="reference.ats.flash.images" dir="${release.images.dir}">
    29         <include name="**/${build.id}*.core.fpsx" />
    81         <include name="**/*.fpsx" />
    30         <include name="**/${build.id}*.rofs2.fpsx" />
       
    31         <include name="**/${build.id}*.rofs3.fpsx" />
       
    32         <include name="**/*rnd.C00" />
    82         <include name="**/*rnd.C00" />
    33         <include name="**/*rnd.V01" />
    83         <include name="**/*rnd.V01" />
    34         <include name="**/*.fpsx" />
       
    35         <include name="**/*_rnd.fpsx" />
       
    36     </fileset>
    84     </fileset>
    37     
    85     
       
    86     <!-- Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files.
       
    87     @type string
       
    88     @scope public
       
    89     -->
    38     <property name="ats.flashfiles.minlimit" value="2" />
    90     <property name="ats.flashfiles.minlimit" value="2" />
    39 
    91 
    40     <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}">
    92     <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}">
    41         <include name="**/*.sis" />
    93         <include name="**/*.sis" />
    42     </fileset>
    94     </fileset>
       
    95     <!-- Limit of minimum number of sis files to execute matti-test target, otherwise MATTI-drop.zip will not be generated. Default value is "1" files.
       
    96     @type string
       
    97     @scope public
       
    98     -->
    43     <property name="ats.sisfiles.minlimit" value="1" />
    99     <property name="ats.sisfiles.minlimit" value="1" />
    44     
   100     
    45     <var name="drop.file.counter" value="0" />
   101     <var name="drop.file.counter" value="0" />
    46 
   102 
    47     <!-- 
   103     <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS.
    48     The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS. 
   104 
    49     The layer definition, in system definition file, for tsrc directory should look like:
   105     The layer definition, in system definition file, for tsrc directory should look like:
       
   106     
    50     <pre>
   107     <pre>
    51     <layer name="name_test_layer">
   108     <layer name="name_test_layer">
    52         <module name="module_name">
   109         <module name="module_name">
    53             <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/>
   110             <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/>
    54         </module>
   111         </module>
   147     assert int(version.split('_')[1]) > 6, 'Java 6 u7 required'
   204     assert int(version.split('_')[1]) > 6, 'Java 6 u7 required'
   148                 </hlm:python>
   205                 </hlm:python>
   149                 <condition property="ats.import.arg" value="-import" else="">
   206                 <condition property="ats.import.arg" value="-import" else="">
   150                     <equals arg1="${ats.script.type}" arg2="import" />
   207                     <equals arg1="${ats.script.type}" arg2="import" />
   151                 </condition>
   208                 </condition>
   152                 <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true">
   209                 <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
       
   210                     <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
       
   211                 </condition>
       
   212                 <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="512m">
   153                     <classpath>
   213                     <classpath>
   154                         <pathelement path="${java.class.path}"/>
   214                         <pathelement path="${java.class.path}"/>
       
   215                         <fileset dir="${ats4.libs}" includes="*.jar"/>
   155                     </classpath>
   216                     </classpath>
   156                     <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
   217                     <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
   157                 </java>
   218                 </java>
   158             </then>
   219             </then>
   159             <else>
   220             <else>
   179         <hlm:python failonerror="true">
   240         <hlm:python failonerror="true">
   180 <![CDATA[
   241 <![CDATA[
   181 flashfilescount = len(r'${ats.flash.images}'.split(','))
   242 flashfilescount = len(r'${ats.flash.images}'.split(','))
   182 mincount = int(r'${ats.flashfiles.minlimit}')
   243 mincount = int(r'${ats.flashfiles.minlimit}')
   183 if flashfilescount < mincount:
   244 if flashfilescount < mincount:
   184     raise Exception('Not enough flash files, check reference.ats.flash.images')
   245     raise Exception('Not enough flash files, check reference.ats.flash.images and build.id, found: ' + r'${ats.flash.images}' + ', looking in: ' + r'${release.images.dir}')
   185 ]]>
   246 ]]>
   186         </hlm:python>
   247         </hlm:python>
   187     </target>
   248     </target>
   188 
   249 
   189     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
   250     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
   194     </target>
   255     </target>
   195 
   256 
   196     <!-- Sets values common for ATS, this is a dependent target and shouldn't be used as an individual target -->
   257     <!-- Sets values common for ATS, this is a dependent target and shouldn't be used as an individual target -->
   197     <target name="ats-common">
   258     <target name="ats-common">
   198         <property name="ats.config.file" value="" />
   259         <property name="ats.config.file" value="" />
       
   260         <property name="ats.specific.pkg" value="" />
   199         <property name="ats4.enabled" value="False" />
   261         <property name="ats4.enabled" value="False" />
       
   262         <!-- Product HardWare ID (HWID) attached to ATS. By default the value of HWID is not set.
       
   263         @type string
       
   264         @scope public
       
   265         -->
   200         <property name="ats.product.hwid" value="" />
   266         <property name="ats.product.hwid" value="" />
       
   267         <!-- To set test commands execution time limit on ATS3 server, in seconds. Default value is "60".
       
   268         @type string
       
   269         @scope public
       
   270         -->
   201         <property name="ats.test.timeout" value="60" />
   271         <property name="ats.test.timeout" value="60" />
       
   272         <!-- Sets ATS reports store location. Default location is "${publish.dir}/${publish.subdir}"
       
   273         @type string
       
   274         @scope public
       
   275         -->
   202         <property name="ats.report.location" value="${publish.dir}/${publish.subdir}" />
   276         <property name="ats.report.location" value="${publish.dir}/${publish.subdir}" />
   203         <condition property="internal.ats.diamonds.arg" value="--diamonds-build-url=http://${diamonds.host}${diamonds.build.id}" else="">
   277         <condition property="internal.ats.diamonds.arg" value="--diamonds-build-url=http://${diamonds.host}${diamonds.build.id}" else="">
   204             <isset property="diamonds.build.url" />
   278             <isset property="diamonds.build.url" />
   205         </condition>
   279         </condition>
   206     </target>
   280     </target>
   207 
   281 
   208     <!-- Sets default values for the ATS (STIF and EUnit), this is a dependent target and shouldn't be used as an individual target -->
   282     <!-- Sets default values for the ATS (STIF and EUnit), this is a dependent target and shouldn't be used as an individual target -->
   209     <target name="ats-set-defaults-stifeunit" depends="ats-common,lookup-email">
   283     <target name="ats-set-defaults-stifeunit" depends="ats-common,lookup-email">
   210         <!-- Default values for the properties -->
   284         <!-- Default values for the properties -->
       
   285         <!-- The property is needed if you want to get an email from ATS server after the tests are executed. There can be one to many semicolon(s) ";" separated email addresses.
       
   286         @type string
       
   287         @scope public
       
   288         -->
   211         <property name="ats.email.list" value="${email.from}" />
   289         <property name="ats.email.list" value="${email.from}" />
       
   290         <!-- The default value is "data" and refers to the 'data' directory under 'tsrc' directory.
       
   291         @type string
       
   292         @scope public
       
   293         -->
   212         <property name="tsrc.data.dir" value="data" />
   294         <property name="tsrc.data.dir" value="data" />
       
   295         <!-- Modify the plan name if you have understanding of test.xml file or leave it as it is. Default value is "plan"
       
   296         @type string
       
   297         @scope public
       
   298         -->
   213         <property name="ats.plan.name" value="plan" />
   299         <property name="ats.plan.name" value="plan" />
       
   300         <!-- Modify the test-run name if you have understanding of test.xml file or leave it as it is. Default value is a string consist of build id, product name, major and minor versions
       
   301         @type string
       
   302         @scope public
       
   303         -->
   214         <property name="ats.testrun.name" value="${build.id}_${ats.product.name}" />
   304         <property name="ats.testrun.name" value="${build.id}_${ats.product.name}" />
       
   305         <!-- CTC host, provided by CATS used to create coverage measurement reports. MON.sym files are copied to this location, for example "10.0.0.1". If not given, code coverage reports are not created
       
   306         @type string
       
   307         @scope public
       
   308         -->
   215         <property name="ats.ctc.host" value="" />
   309         <property name="ats.ctc.host" value="" />
   216         <condition property="ats.version" value="4" else="3">
   310         <condition property="ats.version" value="4" else="3">
   217             <istrue value="${ats4.enabled}" />
   311             <istrue value="${ats4.enabled}" />
   218         </condition>
   312         </condition>
   219         <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" />
   313         <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" />
   220         
   314         
       
   315         <!-- Sets target platform for compiling test components. Default value is "armv5 urel".
       
   316         @type string
       
   317         @scope public
       
   318         -->
   221         <property name="ats.target.platform" value="armv5 urel" />
   319         <property name="ats.target.platform" value="armv5 urel" />
       
   320         <!-- Should be "True" if tracing is needed during the tests running on ATS3. Default value is "False", the values are case-sensitive.
       
   321         @type string
       
   322         @scope public
       
   323         -->
   222         <property name="ats.trace.enabled" value="False" />
   324         <property name="ats.trace.enabled" value="False" />
       
   325         <!-- Should be "True" if coverage measurement and dynamic analysis (CTC) tool support is to be used by ATS. Default value is "False", the values are case-sensitive.
       
   326         @type string
       
   327         @scope public
       
   328         -->
   223         <property name="ats.ctc.enabled" value="False" />
   329         <property name="ats.ctc.enabled" value="False" />
   224         <property name="ats.multiset.enabled" value="False" />
   330         <property name="ats.multiset.enabled" value="False" />
       
   331         <!-- Flags for EUnit exerunner can be set by setting the value of this variable. The default flags are set to "/E S60AppEnv /R Off".
       
   332         @type string
       
   333         @scope public
       
   334         -->
   225         <property name="eunitexerunner.flags" value="/E S60AppEnv /R Off" />
   335         <property name="eunitexerunner.flags" value="/E S60AppEnv /R Off" />
       
   336         <!-- If the property is set to "True", then the only test components which will have PKG files, will be included into the test.xml as a test-set. Which means, even if there's a test component (executable) but there's no PKG file, it should not be considered as a test component and hence not included into the test.xml as a separate test. By default the property value is False.
       
   337         @type string
       
   338         @scope public
       
   339         -->
   226         <property name="ats.obey.pkgfiles.rule" value="False" />
   340         <property name="ats.obey.pkgfiles.rule" value="False" />
   227     </target>
   341     </target>
   228 
   342 
   229     <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target -->
   343     <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target -->
   230     <target name="ats-set-defaults-aste" depends="ats-common">
   344     <target name="ats-set-defaults-aste" depends="ats-common">
   232         <property name="ats.aste.test.type" value="smoke" />
   346         <property name="ats.aste.test.type" value="smoke" />
   233         <property name="ats.aste.testasset.caseids" value="100,101,102,103,105,106,107,108,109,110,111,112,113,114,115" />
   347         <property name="ats.aste.testasset.caseids" value="100,101,102,103,105,106,107,108,109,110,111,112,113,114,115" />
   234         <property name="ats.aste.software.version" value="${build.id}" />
   348         <property name="ats.aste.software.version" value="${build.id}" />
   235         <property name="ats.aste.language" value="English" />
   349         <property name="ats.aste.language" value="English" />
   236         <property name="ats.aste.software.release" value="${build.name}" />
   350         <property name="ats.aste.software.release" value="${build.name}" />
       
   351         <!-- Modify the plan name if you have understanding of test.xml file or leave it as it is. Default value is "plan"
       
   352         @type string
       
   353         @scope public
       
   354         -->
   237         <property name="ats.aste.plan.name" value="plan" />
   355         <property name="ats.aste.plan.name" value="plan" />
       
   356         <!-- Modify the test-run name if you have understanding of test.xml file or leave it as it is. Default value is a string consist of build id, product name, major and minor versions
       
   357         @type string
       
   358         @scope public
       
   359         -->
   238         <property name="ats.aste.testrun.name" value="${build.id}_${ats.product.name}_${major.version}.${minor.version}" />
   360         <property name="ats.aste.testrun.name" value="${build.id}_${ats.product.name}_${major.version}.${minor.version}" />
       
   361         <!-- The property is needed if you want to get an email from ATS server after the tests are executed. There can be one to many semicolon(s) ";" separated email addresses.
       
   362         @type string
       
   363         @scope public
       
   364         -->
   239         <property name="ats.aste.email.list" value="" />
   365         <property name="ats.aste.email.list" value="" />
   240     </target>
   366     </target>
   241 
   367 
   242     <!-- This macro fetches the tsrc paths from system definition file (layers.sysdef.xml), layer defintion should look like
   368     <!-- This macro fetches the tsrc paths from system definition file (layers.sysdef.xml), layer defintion should look like
   243     <pre>
   369     <pre>
   297                 <for list="${module.list}" delimiter="," param="module">
   423                 <for list="${module.list}" delimiter="," param="module">
   298                     <sequential>
   424                     <sequential>
   299                         <runtarget target="ats-set-defaults-stifeunit" />
   425                         <runtarget target="ats-set-defaults-stifeunit" />
   300                         <echo>${ats.drop.file}</echo>
   426                         <echo>${ats.drop.file}</echo>
   301                         <exec executable="python">
   427                         <exec executable="python">
   302                             <arg value="${helium.dir}/tools/common/python/lib/ats3/__init__.py" />
   428                             <arg line="-m ats3.__init__" />
   303                             <arg value="--device-type=${ats.product.name}" />
   429                             <arg value="--device-type=${ats.product.name}" />
   304                             <arg value="--device-hwid=${ats.product.hwid}" />
   430                             <arg value="--device-hwid=${ats.product.hwid}" />
   305                             <arg value="${internal.ats.diamonds.arg}" />
   431                             <arg value="${internal.ats.diamonds.arg}" />
   306                             <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
   432                             <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
   307                             <arg value="--report-email=${ats.email.list}" />
   433                             <arg value="--report-email=${ats.email.list}" />
   321                             <arg value="--ctc-run-process-params=${ats.ctc.host}#${ats.drop.file}#${ats.drops.count}" /> <!-- Three differnt value are combined with '#' character which is later parsed inside the script -->
   447                             <arg value="--ctc-run-process-params=${ats.ctc.host}#${ats.drop.file}#${ats.drops.count}" /> <!-- Three differnt value are combined with '#' character which is later parsed inside the script -->
   322                             <arg value="--monsym-files=${ats.ctc.monsyms}" />
   448                             <arg value="--monsym-files=${ats.ctc.monsyms}" />
   323                             <arg value="--config=${ats.config.file}" />
   449                             <arg value="--config=${ats.config.file}" />
   324                             <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" />
   450                             <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" />
   325                             <arg value="--ats4-enabled=${ats4.enabled}" />
   451                             <arg value="--ats4-enabled=${ats4.enabled}" />
       
   452                             <arg value="--specific-pkg=${ats.specific.pkg}" />
   326                             <arg value="--verbose" />
   453                             <arg value="--verbose" />
   327                             <arg line="${module.tsrc.@{module}}" />
   454                             <arg line="${module.tsrc.@{module}}" />
   328                         </exec>
   455                         </exec>
   329                         <runtarget target="do-ats-test" />
   456                         <runtarget target="do-ats-test" />
   330                         <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
   457                         <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
   337 
   464 
   338     <!-- Please see ats-aste for description.-->
   465     <!-- Please see ats-aste for description.-->
   339     <target name="do-ats-aste" depends="ats-set-flash-image-path, ats-set-defaults-aste" if="enabled.aste">
   466     <target name="do-ats-aste" depends="ats-set-flash-image-path, ats-set-defaults-aste" if="enabled.aste">
   340         <mkdir dir="${build.output.dir}/ats" />
   467         <mkdir dir="${build.output.dir}/ats" />
   341         <exec executable="python">
   468         <exec executable="python">
   342             <arg value="${helium.dir}/tools/common/python/lib/ats3/aste.py" />
   469             <arg line="-m ats3.aste" />
   343             <arg value="--report-email=${ats.aste.email.list}" />
   470             <arg value="--report-email=${ats.aste.email.list}" />
   344             <arg value="--device-type=${ats.product.name}" />
   471             <arg value="--device-type=${ats.product.name}" />
   345             <arg value="--flash-images=${ats.flash.images}" />
   472             <arg value="--flash-images=${ats.flash.images}" />
   346             <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
   473             <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
   347             <arg value="--plan-name=${ats.aste.plan.name}" />
   474             <arg value="--plan-name=${ats.aste.plan.name}" />
   438                 <echo message="Error: Not enough sis files check reference.ats.sis.images" />
   565                 <echo message="Error: Not enough sis files check reference.ats.sis.images" />
   439             </then>
   566             </then>
   440             <else>
   567             <else>
   441                 <!-- execute the MattiDrops.py script with parameters-->
   568                 <!-- execute the MattiDrops.py script with parameters-->
   442                 <exec executable="python" resultproperty="script.response">
   569                 <exec executable="python" resultproperty="script.response">
   443                     <arg value="${helium.dir}/tools/common/python/lib/ats3/matti/MattiDrops.py" />
   570                     <arg line="-m ats3.matti.MattiDrops" />
   444                     <arg value="--build-drive=${build.drive}" />
   571                     <arg value="--build-drive=${build.drive}" />
   445                     <arg value="--matti-scripts=${matti.scripts}" />
   572                     <arg value="--matti-scripts=${matti.scripts}" />
   446                     <arg value="--flash-images=${ats.flash.images}" />
   573                     <arg value="--flash-images=${ats.flash.images}" />
   447                     <arg value="--harness=STIF" />
   574                     <arg value="--harness=STIF" />
   448                     <arg value="--file-store=${ats.output.dir}" />
   575                     <arg value="--file-store=${ats.output.dir}" />
   461                         <!-- if the response is not 0 then need to create the skip.ats.sending
   588                         <!-- if the response is not 0 then need to create the skip.ats.sending
   462                          flag so that do-ats-test is not run-->
   589                          flag so that do-ats-test is not run-->
   463                         <equals arg1="${script.response}" arg2="0" />
   590                         <equals arg1="${script.response}" arg2="0" />
   464                     </not>
   591                     </not>
   465                     <then>
   592                     <then>
       
   593                         <!-- Skips sending drop package file to ATS/ASTE after its creation.
       
   594                         @type boolean
       
   595                         @scope public
       
   596                         -->
   466                         <property name="skip.ats.sending" value="1" />
   597                         <property name="skip.ats.sending" value="1" />
   467                     </then>
   598                     </then>
   468                 </if>
   599                 </if>
   469                 <runtarget target="do-ats-test" />
   600                 <runtarget target="do-ats-test" />
   470             </else>
   601             </else>
   471         </if>
   602         </if>
   472     </target>
   603     </target>
   473     
   604     
       
   605     <!-- Temp dir
       
   606     @type string
       
   607     @scope private
       
   608     -->
   474     <property name="ats.evalid.pre" value="${temp.build.dir}/${build.id}_atsevalidpre" />
   609     <property name="ats.evalid.pre" value="${temp.build.dir}/${build.id}_atsevalidpre" />
       
   610     <!-- Temp dir
       
   611     @type string
       
   612     @scope private
       
   613     -->
   475     <property name="ats.evalid.post" value="${temp.build.dir}/${build.id}_atsevalidpost" />
   614     <property name="ats.evalid.post" value="${temp.build.dir}/${build.id}_atsevalidpost" />
   476     
   615     
   477     <!-- Call before preperation -->
   616     <!-- Call before preperation -->
   478     <target name="find-files-pre" if="ats.delta.enabled">
   617     <target name="find-files-pre" if="ats.delta.enabled">
   479         <hlm:evalidMacro dir="${ats.evalid.pre}"/>
   618         <hlm:evalidMacro dir="${ats.evalid.pre}"/>