buildframework/helium/tools/testing/ats/ats.ant.xml
changeset 640 ac0bbc1e5d79
parent 628 7c4a911dc066
child 645 b8d81fa19e7d
equal deleted inserted replaced
639:0e65f93be3cb 640:ac0bbc1e5d79
    24 <project name="_testing.ats" xmlns:hlm="http://www.nokia.com/helium">
    24 <project name="_testing.ats" xmlns:hlm="http://www.nokia.com/helium">
    25     <description>
    25     <description>
    26     ATS testing targets.
    26     ATS testing targets.
    27     </description>
    27     </description>
    28     
    28     
       
    29     <!--* @property ats.enabled
       
    30     Value must be set to execute ats-test target.
       
    31     @type boolean
       
    32     @editable required
       
    33     @scope public
       
    34     @since 11.0
       
    35     -->
       
    36     
       
    37     <!--* @property internal.ats.enabled
       
    38     Set to run ats targests if ats.enabled set to true.
       
    39     @type boolean
       
    40     @scope private
       
    41     -->
       
    42     
    29     <!--* @property enabled.ats
    43     <!--* @property enabled.ats
    30     Value must be set to execute ats-test target.
    44     Value must be set to execute ats-test target. - deprecated: Start using ats.enabled property.
    31     @type boolean
    45     @type boolean
    32     @editable required
    46     @editable required
    33     @scope public
    47     @scope public
       
    48     @deprecated since 11.0
       
    49     -->
       
    50     
       
    51     <!--* @property aste.enabled
       
    52     Value must be set to execute ats-aste target.
       
    53     @type boolean
       
    54     @editable required
       
    55     @scope public
       
    56     @since 11.0
       
    57     -->
       
    58     
       
    59     <!--* @property internal.aste.enabled
       
    60     Set to run aste targets if aste.enabled set to true.
       
    61     @type boolean
       
    62     @scope private
    34     -->
    63     -->
    35     
    64     
    36     <!--* @property enabled.aste
    65     <!--* @property enabled.aste
    37     Value must be set to execute ats-aste target.
    66     Value must be set to execute ats-aste target. - deprecated: Start using aste.enabled property.
    38     @type boolean
    67     @type boolean
    39     @editable required
    68     @editable required
    40     @scope public
    69     @scope public
       
    70     @deprecated since 11.0
       
    71     -->
       
    72     
       
    73     <!--* @property ats4.enabled
       
    74     Value must be set to execute ats4 features.
       
    75     @type boolean
       
    76     @editable required
       
    77     @scope public
       
    78     @since 11.0
       
    79     -->
       
    80     
       
    81     <!--* @property internal.ats4.enabled
       
    82     Set if ats4.enabled is set to true. To run ats4 dependent targets.
       
    83     @type boolean
       
    84     @scope private
    41     -->
    85     -->
    42     
    86     
    43     <!--* @property ats.product.name
    87     <!--* @property ats.product.name
    44     Name of the product to be tested. For example: "PRODUCT"
    88     Name of the product to be tested. For example: "PRODUCT"
    45     @type string
    89     @type string
    46     @editable required
    90     @editable required
    47     @scope public
    91     @scope public
    48     -->
    92     -->
    49     
    93     
    50     <!--* @property ats.drop.location
    94     <!--* @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).
    95     Server location (UNC path) to save the drop 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
    96     @type string
    53     @editable required
    97     @editable required
    54     @scope public
    98     @scope public
    55     -->
    99     -->
    56     
   100     
    74     @editable required
   118     @editable required
    75     @scope public
   119     @scope public
    76     -->
   120     -->
    77     
   121     
    78     <!--* @property ats.create.singledrop.file
   122     <!--* @property ats.create.singledrop.file
       
   123     defined as true if single drop file is required. Define as false or not present for multiple drop files. - deprecated:  Start using ats.singledrop.enabled
       
   124     @type boolean
       
   125     @editable required
       
   126     @scope public
       
   127     @deprecated since 11.0
       
   128     -->
       
   129     
       
   130     <!--* @property ats.singledrop.enabled
    79     defined as true if single drop file is required. Define as false or not present for multiple drop files.
   131     defined as true if single drop file is required. Define as false or not present for multiple drop files.
    80     @type boolean
   132     @type boolean
    81     @editable required
   133     @editable required
    82     @scope public
   134     @scope public
    83     -->
   135     @since 11.0
    84     
   136     -->
    85     <!-- -->
   137     
       
   138     <!--* @property internal.ats.singledrop.enabled
       
   139     set to true if ats.singledrop.enabled set to true.
       
   140     @type boolean
       
   141     @scope private
       
   142     -->
       
   143     
       
   144     <!--* @property ats.emulator.enabled
       
   145     Value must be set to true to run ats with emulator.
       
   146     @type boolean
       
   147     @editable required
       
   148     @scope public
       
   149     @since 11.0
       
   150     -->
       
   151     
       
   152     <!--* @property internal.ats.emulator.enabled
       
   153     Set to run emulator targets if ats.emulator.enabled is set to true.
       
   154     @type boolean
       
   155     @scope private
       
   156     -->
       
   157     
       
   158     <!--* @property ats.emulator.enable
       
   159     Value must be set to true to run ats with emulator. - deprecated: Start using ats.emulator.enabled property.
       
   160     @type boolean
       
   161     @editable required
       
   162     @scope public
       
   163     @deprecated since 11.0
       
   164     -->
       
   165     
       
   166     <!--* @property matti.enabled
       
   167     Value must be set to true to enable testing with matti.
       
   168     @type boolean
       
   169     @editable required
       
   170     @scope public
       
   171     @since 11.0
       
   172     -->
       
   173     
       
   174     <!--* @property internal.matti.enabled
       
   175     Set to run matti targets if matti.enabled is set to true.
       
   176     @type boolean
       
   177     @scope private
       
   178     -->
       
   179     
       
   180     <!--* @property ats.delta.enabled
       
   181     Should be true so only ADOs changed during do-prep-work-area are tested by ATS.
       
   182     @type boolean
       
   183     @editable required
       
   184     @scope public
       
   185     @since 11.0
       
   186     -->
       
   187     
       
   188     <!--* @property ats.delta.enabled
       
   189     Set to run ats delta target if  ats.delta.enabled set to true.
       
   190     @type boolean
       
   191     @scope private
       
   192     -->
       
   193     
       
   194     <!--* @property ats.disable.java.importer
       
   195     To disable java importer for ats. - deprecated: Start using ats.java.importer.enabled property.
       
   196     @type boolean
       
   197     @editable required
       
   198     @scope public
       
   199     @deprecated since 11.0
       
   200     -->
       
   201         
       
   202     <!-- To disable java importer for ats
       
   203     @type boolean
       
   204     @editable required
       
   205     @scope public
       
   206     @since 11.0
       
   207     -->
       
   208     <property name="ats.java.importer.enabled" value="true"/>
       
   209     
       
   210     <!--* @property ats.disable.iconfig
       
   211     To enable/disable iconfig with ats. - deprecated: Start using ats.iconfig.enabled property.
       
   212     @type boolean
       
   213     @editable required
       
   214     @scope public
       
   215     @deprecated since 11.0
       
   216     -->
       
   217         
       
   218     <!-- To enable/disable iconfig with ats
       
   219     @type boolean
       
   220     @editable required
       
   221     @scope public
       
   222     @since 11.0
       
   223     -->
       
   224     <property name="ats.iconfig.enabled" value="true"/>
       
   225     
       
   226     <!--* @property internal.ats.iconfig.enabled
       
   227     To run python if ats.iconfig.enabled is enable/disable.
       
   228     @type boolean
       
   229     @scope private
       
   230     -->
       
   231     
       
   232     <!--* For sending drop package file to ATS/ASTE after its creation.
       
   233     @type boolean
       
   234     @scope public
       
   235     @since 11.0
       
   236     -->
       
   237     <property name="ats.upload.enabled" value="true"/>
       
   238     
       
   239     <!--* @property internal.ats.upload.enabled
       
   240     Set to run sending the test drop targets if ats.upload.enabled is set to true.
       
   241     @type boolean
       
   242     @scope private
       
   243     -->
       
   244     
       
   245     <!--* @property skip.ats.sending
       
   246     For sending drop package file to ATS/ASTE after its creation. - deprecated: Start using ats.upload.enabled property.
       
   247     @type boolean
       
   248     @editable required
       
   249     @scope public
       
   250     @deprecated since 11.0
       
   251     -->
       
   252     
       
   253     <!-- Is it required to send ats test drop to server-->
       
   254     <condition property="internal.ats.upload.enabled">
       
   255         <and>
       
   256             <not>
       
   257                 <isfalse value="${ats.upload.enabled}" />
       
   258             </not>
       
   259             <not>
       
   260                 <isset property="skip.ats.sending"/>
       
   261             </not>
       
   262         </and>
       
   263     </condition>
       
   264     
       
   265     <!-- Check is the ATS enabled -->
       
   266     <condition property="internal.ats.enabled">
       
   267         <or>
       
   268             <istrue value="${ats.enabled}" />
       
   269             <istrue value="${enabled.ats}"/>
       
   270         </or>
       
   271     </condition>
       
   272     
       
   273     <!-- Check is the aste enabled -->
       
   274     <condition property="internal.aste.enabled">
       
   275         <or>
       
   276             <istrue value="${aste.enabled}" />
       
   277             <isset property="enabled.aste"/>
       
   278         </or>
       
   279     </condition>
       
   280     
       
   281     <!-- Check is the ast4 enabled -->
       
   282     <condition property="internal.ats4.enabled" value="true" else="false">
       
   283         <istrue value="${ats4.enabled}" />
       
   284     </condition>
       
   285     
       
   286     <!-- Check is the ats emulator enabled -->
       
   287     <condition property="internal.ats.emulator.enabled">
       
   288         <or>
       
   289             <istrue value="${ats.emulator.enabled}" />
       
   290             <istrue value="${ats.emulator.enable}" />
       
   291         </or>
       
   292     </condition>
       
   293     
       
   294     <!-- Check is the ats matti enabled -->
       
   295     <condition property="internal.matti.enabled">
       
   296         <istrue value="${matti.enabled}" />
       
   297     </condition>
       
   298     
       
   299     <!-- Check is the ats ats delta enabled -->
       
   300     <condition property="internal.ats.delta.enabled">
       
   301         <istrue value="${ats.delta.enabled}" />
       
   302     </condition>
       
   303     
       
   304     <!-- Check is the ats ats delta enabled -->
       
   305     <condition property="internal.ats.iconfig.enabled" value="true" else="false">
       
   306         <and>
       
   307             <not>
       
   308                 <isfalse value="${ats.iconfig.enabled}" />
       
   309             </not>
       
   310             <not>
       
   311                 <isset property="ats.disable.iconfig" />
       
   312             </not>
       
   313         </and>
       
   314     </condition>
       
   315     
       
   316     <!-- Check is the ats ats single drop file enabled -->
       
   317     <condition property="internal.ats.singledrop.enabled">
       
   318         <or>
       
   319             <istrue value="${ats.singledrop.enabled}" />
       
   320             <istrue value="${ats.create.singledrop.file}" />
       
   321         </or>
       
   322     </condition>
       
   323     
       
   324     
       
   325     
       
   326     <!--  -->
    86     <fileset id="reference.ats.flash.images" dir="${release.images.dir}">
   327     <fileset id="reference.ats.flash.images" dir="${release.images.dir}">
    87         <include name="**/*.fpsx" />
   328         <include name="**/*.fpsx" />
    88         <include name="**/*rnd.C00" />
   329         <include name="**/*rnd.C00" />
    89         <include name="**/*rnd.V01" />
   330         <include name="**/*rnd.V01" />
    90     </fileset>
   331     </fileset>
    93     Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files.
   334     Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files.
    94     @type string
   335     @type string
    95     @scope public
   336     @scope public
    96     -->
   337     -->
    97     <condition property="ats.flashfiles.minlimit" value="0" else="2">
   338     <condition property="ats.flashfiles.minlimit" value="0" else="2">
    98         <istrue value="${ats.emulator.enable}" />
   339         <or>
       
   340             <istrue value="${ats.emulator.enabled}" />
       
   341             <istrue value="${ats.emulator.enable}" />
       
   342         </or>
    99     </condition>
   343     </condition>
   100 
   344 
   101     <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}">
   345     <fileset id="reference.ats.sis.images" dir="${ats.sis.images.dir}">
   102         <include name="**/*.sis" />
   346         <include name="**/*.sis" />
   103     </fileset>
   347     </fileset>
   105     @type string
   349     @type string
   106     @scope public
   350     @scope public
   107     -->
   351     -->
   108     <property name="ats.sisfiles.minlimit" value="1" />
   352     <property name="ats.sisfiles.minlimit" value="1" />
   109     
   353     
   110     <var name="drop.file.counter" value="0" />
   354     <property name="drop.file.counter" value="0" />
   111 
       
   112     <condition property="internal.enabled.ats">
       
   113         <istrue value="${enabled.ats}" />
       
   114     </condition>
       
   115 
   355 
   116     <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS.
   356     <!-- The target creates ATSDrop.zip file which also includes test.xml file; and sends the drop to ATS.
   117         
   357         
   118     The layer definition, in system definition file, for tsrc directory should look like:
   358     The layer definition, in system definition file, for tsrc directory should look like:
   119 
   359 
   121             <module name="module_name">
   361             <module name="module_name">
   122                 <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/>
   362                 <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter=""/>
   123             </module>
   363             </module>
   124         </layer>
   364         </layer>
   125     -->
   365     -->
   126     <target name="ats-test" if="internal.enabled.ats">
   366     <target name="ats-test" if="internal.ats.enabled">
   127         <mkdir dir="${test.log.dir}"/>
   367         <mkdir dir="${test.log.dir}"/>
       
   368         <runtarget target="load-property-from-cache-file" />
   128         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
   369         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
   129         <trycatch property="exception" reference="exception">
   370         <trycatch reference="exception">
   130             <try>
   371             <try>
   131                 <runtarget target="ats-delta"/>
   372                 <runtarget target="ats-delta"/>
   132                 <antcall target="create-canonical-sysdef-file" inheritRefs="true">
   373                 <antcall target="create-canonical-sysdef-file" inheritRefs="true">
   133                     <reference refid="ats.system.definition.files" torefid="system.definition.files" />
   374                     <reference refid="ats.system.definition.files" torefid="system.definition.files" />
   134                 </antcall>
   375                 </antcall>
   135                 <runtarget target="copy-mon-sym" />
   376                 <runtarget target="copy-mon-sym" />
   136                 <runtarget target="ats-create-drop" />
   377                 <runtarget target="ats-create-drop" />
   137             </try>
   378             </try>
   138             <catch>
   379             <catch>
   139                 <if>
   380                 <echo>Error: ${toString:exception}</echo>
   140                     <istrue value="${ats.delta.enabled}" />
       
   141                     <then>
       
   142                         <echo message="${exception}"/>
       
   143                     </then>
       
   144                     <else>
       
   145                         <throw refid="exception"/>
       
   146                     </else>
       
   147                 </if>
       
   148             </catch>
   381             </catch>
   149         </trycatch>
   382         </trycatch>
   150         <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_ats.log" append="false"/>
   383         <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_ats.log" append="false"/>
   151         <hlm:metadatarecord database="${metadata.dbfile}">
   384         <hlm:metadatarecord database="${metadata.dbfile}">
   152             <hlm:textmetadatainput>
   385             <hlm:textmetadatainput>
   153                 <fileset casesensitive="false" file="${test.log.dir}/${build.id}_ats.log" />
   386                 <fileset casesensitive="false" file="${test.log.dir}/${build.id}_ats.log" />
   154                 <metadatafilterset refid="filterset.ats" />
   387                 <metadatafilterset refid="filterset.ats" />
   155             </hlm:textmetadatainput>
   388             </hlm:textmetadatainput>
   156         </hlm:metadatarecord>
   389         </hlm:metadatarecord>
   157         <hlm:generateBuildStatus file="${build.id}_ats.log" />
   390         <hlm:generateBuildStatus file="${test.log.dir}/${build.id}_ats.log" />
   158     </target>
   391     </target>
   159 
   392 
   160     <!-- The target creates the ATSdrop.zip file including test.xml for ATS ASTE tests. This target is executable.-->
   393     <!-- The target creates the ATSdrop.zip file including test.xml for ATS ASTE tests. This target is executable.-->
   161     <target name="ats-aste" if="enabled.aste">
   394     <target name="ats-aste" if="internal.aste.enabled">
   162         <mkdir dir="${test.log.dir}"/>
   395         <mkdir dir="${test.log.dir}"/>
       
   396         <runtarget target="load-property-from-cache-file" />
   163         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
   397         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
   164         <runtarget target="do-ats-aste" />
   398         <runtarget target="do-ats-aste" />
   165         <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_aste.log" append="false"/>
   399         <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_aste.log" append="false"/>
   166         <hlm:metadatarecord database="${metadata.dbfile}">
   400         <hlm:metadatarecord database="${metadata.dbfile}">
   167             <hlm:textmetadatainput>
   401             <hlm:textmetadatainput>
   168                 <fileset casesensitive="false" file="${test.log.dir}/${build.id}_aste.log" />
   402                 <fileset casesensitive="false" file="${test.log.dir}/${build.id}_aste.log" />
   169                 <metadatafilterset refid="filterset.aste" />
   403                 <metadatafilterset refid="filterset.aste" />
   170             </hlm:textmetadatainput>
   404             </hlm:textmetadatainput>
   171         </hlm:metadatarecord>
   405         </hlm:metadatarecord>
   172         <hlm:generateBuildStatus file="${build.id}_aste.log" />
   406         <hlm:generateBuildStatus file="${test.log.dir}/${build.id}_aste.log" />
   173     </target>
   407     </target>
   174 
   408 
   175     <!-- The target creates the MATTI_drop.zip file including test.xml for MATTI tests. This target is executable.-->
   409     <!-- The target creates the MATTI_drop.zip file including test.xml for MATTI tests. This target is executable.-->
   176     <target name="matti-test" if="enabled.matti">
   410     <target name="matti-test" if="internal.matti.enabled">
   177         <mkdir dir="${test.log.dir}"/>
   411         <mkdir dir="${test.log.dir}"/>
       
   412         <runtarget target="load-property-from-cache-file" />
   178         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
   413         <hlm:filterRecordStartMacro pattern="${ats.password}" category="ats"/>
   179         <runtarget target="do-ats-matti" />
   414         <runtarget target="do-ats-matti" />
   180         <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_matti.log" append="false"/>
   415         <hlm:filterRecordStopMacro log="${test.log.dir}/${build.id}_matti.log" append="false"/>
   181         <hlm:metadatarecord database="${metadata.dbfile}">
   416         <hlm:metadatarecord database="${metadata.dbfile}">
   182             <hlm:textmetadatainput>
   417             <hlm:textmetadatainput>
   183                 <fileset casesensitive="false" file="${test.log.dir}/${build.id}_matti.log" />
   418                 <fileset casesensitive="false" file="${test.log.dir}/${build.id}_matti.log" />
   184                 <metadatafilterset refid="filterset.matti" />
   419                 <metadatafilterset refid="filterset.matti" />
   185             </hlm:textmetadatainput>
   420             </hlm:textmetadatainput>
   186         </hlm:metadatarecord>
   421         </hlm:metadatarecord>
   187         <hlm:generateBuildStatus file="${build.id}_matti.log" />
   422         <hlm:generateBuildStatus file="${test.log.dir}/${build.id}_matti.log" />
   188     </target>
   423     </target>
   189 
   424 
   190     <!-- Sends drop file to ATS/ASTE. Please see `ats-test` for description. -->
   425     <!-- Sends drop file to ATS/ASTE. Please see `ats-test` for description. -->
   191     <target name="do-ats-test" depends="ats-username, ats-password" unless="skip.ats.sending">
   426     <target name="do-ats-test" depends="ats-username, ats-password" if="internal.ats.upload.enabled">
   192         <property name="ats.sending" value="true" />
   427         <property name="ats.sending" value="true" />
   193         <!-- Make the drop file visible to ATS. -->
   428         <!-- Make the drop file visible to ATS. -->
   194         
   429         
   195         <var name="ats.drop.location.file" unset="true"/>
   430         <var name="ats.drop.location.file" unset="true"/>
   196         <if>
   431         <if>
   202             </then>
   437             </then>
   203             <else>
   438             <else>
   204                 <property name="ats.drop.location.file" location="${build.output.dir}/ats/${ats.drop.file}" />
   439                 <property name="ats.drop.location.file" location="${build.output.dir}/ats/${ats.drop.file}" />
   205             </else>
   440             </else>
   206         </if>
   441         </if>
   207 
   442         
   208         <trycatch property="exception">
   443         <!-- Notify ATS about the drop. -->
   209             <try>
   444         <if>
   210                 <!-- Notify ATS about the drop. -->
   445             <istrue value="${internal.ats4.enabled}" />
   211                 <if>
   446             <then>
   212                     <istrue value="${ats4.enabled}" />
   447                 <hlm:python failonerror="true">
   213                     <then>
       
   214                         <hlm:python failonerror="true">
       
   215 version = r'${java.version}'
   448 version = r'${java.version}'
   216 if '1.6.0' in version:
   449 if '1.6.0' in version:
   217     assert int(version.split('_')[1]) > 6, 'Java 6 u7 required'
   450     assert int(version.split('_')[1]) > 6, 'Java 6 u7 required'
   218                         </hlm:python>
   451                 </hlm:python>
   219                         <condition property="ats.import.arg" value="-import" else="">
   452                 <condition property="ats.import.arg" value="-import" else="">
   220                             <equals arg1="${ats.script.type}" arg2="import" />
   453                     <equals arg1="${ats.script.type}" arg2="import" />
   221                         </condition>
   454                 </condition>
   222                         <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
   455                 <condition property="ats4.libs" value="${helium.dir}/extensions/nokia/external/ats4" else="${helium.dir}/external/antlibs">
   223                             <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
   456                     <available type="dir" file="${helium.dir}/extensions/nokia/external/ats4"/>
   224                         </condition>
   457                 </condition>
   225                         <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="1024m" failonerror="true">
   458                 <java classname="com.nokia.ats.util.server.CommandLineClient" fork="true" maxmemory="1024m" failonerror="true">
       
   459                     <classpath>
       
   460                         <pathelement path="${java.class.path}"/>
       
   461                         <fileset dir="${ats4.libs}" includes="*.jar"/>
       
   462                     </classpath>
       
   463                     <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
       
   464                 </java>
       
   465             </then>
       
   466             <else>
       
   467                 <if>
       
   468                     <and>
       
   469                         <equals arg1="${ats.script.type}" arg2="import" />
       
   470                         <available classname="com.nokia.taitei.util.TestDropImporter"/>
       
   471                         <not>
       
   472                             <or>
       
   473                                 <istrue value="${ats.disable.java.importer}" />
       
   474                                 <isfalse value="${ats.java.importer.enabled}" />
       
   475                             </or>    
       
   476                         </not>
       
   477                     </and>
       
   478                     <then>
       
   479                         <java classname="com.nokia.taitei.util.TestDropImporter" fork="true" maxmemory="1024m" failonerror="true">
   226                             <classpath>
   480                             <classpath>
   227                                 <pathelement path="${java.class.path}"/>
   481                                 <pathelement path="${java.class.path}"/>
   228                                 <fileset dir="${ats4.libs}" includes="*.jar"/>
       
   229                             </classpath>
   482                             </classpath>
   230                             <arg line="-url http://${ats.server}/ServerService -path ${ats.drop.location.file} ${ats.import.arg}"/>
   483                             <arg line="${ats.server} ${ats.drop.location.file} ${ats.username} ${ats.password}"/>
   231                         </java>
   484                         </java>
   232                     </then>
   485                     </then>
   233                     <else>
   486                     <else>
   234                         <if>
   487                         <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
   235                             <and>
   488                             <equals arg1="${ats.script.type}" arg2="import" />
   236                                 <equals arg1="${ats.script.type}" arg2="import" />
   489                         </condition>
   237                                 <available classname="com.nokia.taitei.util.TestDropImporter"/>
   490                         <exec executable="cscript" dir="${build.drive}/" failonerror="true">
   238                                 <not>
   491                             <env key="ats3.username" value="${ats.username}" />
   239                                     <istrue value="${ats.disable.java.importer}" />
   492                             <env key="ats3.password" value="${ats.password}" />
   240                                 </not>
   493                             <env key="ats3.host" value="${ats.server}" />
   241                             </and>
   494                             <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
   242                             <then>
   495                             <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
   243                                 <java classname="com.nokia.taitei.util.TestDropImporter" fork="true" maxmemory="1024m" failonerror="true">
   496                         </exec>
   244                                     <classpath>
       
   245                                         <pathelement path="${java.class.path}"/>
       
   246                                     </classpath>
       
   247                                     <arg line="${ats.server} ${ats.drop.location.file} ${ats.username} ${ats.password}"/>
       
   248                                 </java>
       
   249                             </then>
       
   250                             <else>
       
   251                                 <condition property="ats.wsh.testrun.file" value="wshTestRunImport.vbs" else="wshTestRunX.vbs">
       
   252                                     <equals arg1="${ats.script.type}" arg2="import" />
       
   253                                 </condition>
       
   254                                 <exec executable="cscript" dir="${build.drive}/" failonerror="true">
       
   255                                     <env key="ats3.username" value="${ats.username}" />
       
   256                                     <env key="ats3.password" value="${ats.password}" />
       
   257                                     <env key="ats3.host" value="${ats.server}" />
       
   258                                     <env key="ats3.pathToDrop" value="${ats.drop.location.file}"/>
       
   259                                     <arg value="${helium.dir}/tools/testing/ats/${ats.wsh.testrun.file}" />
       
   260                                 </exec>
       
   261                             </else>
       
   262                         </if>             
       
   263                     </else>
   497                     </else>
   264                 </if>
   498                 </if>             
   265             </try>
   499             </else>
   266             <catch>
   500         </if>
   267                 <echo message="Error: ${exception}"/>
       
   268             </catch>
       
   269         </trycatch>
       
   270     </target>
   501     </target>
   271 
   502 
   272     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
   503     <!-- The target is dependent on "ats-test", should not be called independently. The target fetches flash files location -->
   273     <target name="ats-set-flash-image-path" unless="ats.emulator.enable">
   504     <target name="ats-set-flash-image-path" unless="internal.ats.emulator.enabled">
   274         <pathconvert pathsep="," property="ats.flash.images">
   505         <pathconvert pathsep="," property="ats.flash.images">
   275             <fileset refid="reference.ats.flash.images"/>
   506             <fileset refid="reference.ats.flash.images"/>
   276         </pathconvert>
   507         </pathconvert>
   277         <script language="jython" setbeans="false">
   508         <script language="jython" setbeans="false">
   278 if project.getProperty('ats.disable.iconfig') == None:
   509 if project.getProperty('internal.ats.iconfig.enabled') == 'true':
   279     import atsant
   510     import atsant
   280     ic = None
   511     ic = None
   281     try:
   512     try:
   282         ic = atsant.IConfigATS(project.getProperty('release.images.dir'), project.getProperty('ats.product.name'))
   513         ic = atsant.IConfigATS(project.getProperty('release.images.dir'), project.getProperty('ats.product.name'))
   283     except Exception, ex:
   514     except Exception, ex:
   306 
   537 
   307     <!-- Sets values common for ATS, this is a dependent target and shouldn't be used as an individual target -->
   538     <!-- Sets values common for ATS, this is a dependent target and shouldn't be used as an individual target -->
   308     <target name="ats-common">
   539     <target name="ats-common">
   309         <property name="ats.config.file" value="" />
   540         <property name="ats.config.file" value="" />
   310         <property name="ats.specific.pkg" value="" />
   541         <property name="ats.specific.pkg" value="" />
   311         <property name="ats4.enabled" value="False" />
   542         
   312         <!-- Product HardWare ID (HWID) attached to ATS. By default the value of HWID is not set.
   543         <!-- Product HardWare ID (HWID) attached to ATS. By default the value of HWID is not set.
   313         @type string
   544         @type string
   314         @scope public
   545         @scope public
   315         -->
   546         -->
   316         <property name="ats.product.hwid" value="" />
   547         <property name="ats.product.hwid" value="" />
   317         <!-- To set test commands execution time limit on ATS3 server, in seconds. Default value is "60".
   548         <!-- To set test commands execution time limit on ATS server, in seconds. Default value is "60".
   318         @type string
   549         @type string
   319         @scope public
   550         @scope public
   320         -->
   551         -->
   321         <property name="ats.test.timeout" value="60" />
   552         <property name="ats.test.timeout" value="60" />
   322         <!-- Sets ATS reports store location. Default location is "${publish.dir}/${publish.subdir}"
   553         <!-- Sets ATS reports store location. Default location is "${publish.dir}/${publish.subdir}"
   323         @type string
   554         @type string
   324         @scope public
   555         @scope public
   325         -->
   556         -->
   326         <property name="ats.report.location" value="${publish.dir}/${publish.subdir}" />
   557         <property name="ats.report.location" value="${publish.dir}/${publish.subdir}" />
   327         <condition property="internal.ats.diamonds.arg" value="--diamonds-build-url=http://${diamonds.host}${diamonds.build.id}" else="">
   558         <condition property="internal.ats.diamonds.arg" value="--diamonds-build-url=http://${diamonds.host}:${diamonds.port}${diamonds.build.id}" else="">
   328             <isset property="diamonds.build.url" />
   559             <isset property="diamonds.build.url" />
   329         </condition>
   560         </condition>
   330     </target>
   561     </target>
   331 
   562 
   332     <!-- Sets default values for the ATS (STIF and EUnit), this is a dependent target and shouldn't be used as an individual target -->
   563     <!-- Sets default values for the ATS (STIF and EUnit), this is a dependent target and shouldn't be used as an individual target -->
   361         @type string
   592         @type string
   362         @scope public
   593         @scope public
   363         -->
   594         -->
   364         <property name="ats.ctc.host" value="" />
   595         <property name="ats.ctc.host" value="" />
   365         <condition property="ats.version" value="4" else="3">
   596         <condition property="ats.version" value="4" else="3">
   366             <istrue value="${ats4.enabled}" />
   597             <istrue value="${internal.ats4.enabled}" />
   367         </condition>
   598         </condition>
   368         <var name="ats.drop.file" value="ATS${ats.version}Drop${drop.file.counter}.zip" />
   599         <var name="ats.drop.file" value="${build.id}_ATS${ats.version}Drop${drop.file.counter}.zip" />
   369         
   600         
   370         <!--* @property ats.target.platform
   601         <!--* @property ats.target.platform
   371         Sets target platform for compiling test components. Default value is "armv5 urel".
   602         Sets target platform for compiling test components. Default value is "armv5 urel".
   372         @type string
   603         @type string
   373         @scope public
   604         @scope public
   374         -->
   605         -->
   375         <condition property="ats.target.platform" value="winscw urel" else="armv5 urel">
   606         <condition property="ats.target.platform" value="winscw urel" else="armv5 urel">
   376             <istrue value="${ats.emulator.enable}" />
   607             <or>
       
   608                 <istrue value="${ats.emulator.enabled}" />
       
   609                 <istrue value="${ats.emulator.enable}" />
       
   610             </or>
   377         </condition>
   611         </condition>
   378         <!-- Should be "True" if tracing is needed during the tests running on ATS3. Default value is "False", the values are case-sensitive.
   612         <!-- Should be "true" if tracing is needed during the tests running on ATS. Default value is "false", the values are case-sensitive.
   379         @type string
   613         @type boolean
   380         @scope public
   614         @scope public
   381         -->
   615         @editable required
   382         <property name="ats.trace.enabled" value="False" />
   616         -->
   383         <!-- 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.
   617         <property name="ats.trace.enabled" value="false"/>
   384         @type string
   618         
   385         @scope public
   619         <!-- 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.
   386         -->
   620         @type boolean
   387         <property name="ats.ctc.enabled" value="False" />
   621         @editable required
   388         <property name="ats.multiset.enabled" value="False" />
   622         @scope public
       
   623         -->
       
   624         <property name="ats.ctc.enabled" value="false"/>
       
   625         
       
   626         <!--* @property internal.ats.ctc.enabled
       
   627         Set to run the ats ctc targets.
       
   628         @type boolean
       
   629         @scope private
       
   630         -->
       
   631         <condition property="internal.ats.ctc.enabled">
       
   632             <istrue value="${ats.ctc.enabled}" />
       
   633         </condition>
       
   634         
   389         <!-- Flags for EUnit exerunner can be set by setting the value of this variable. The default flags are set to "/E S60AppEnv /R Off".
   635         <!-- Flags for EUnit exerunner can be set by setting the value of this variable. The default flags are set to "/E S60AppEnv /R Off".
   390         @type string
   636         @type boolean
   391         @scope public
   637         @editable required
   392         -->
   638         @scope public
       
   639         -->
       
   640         <property name="ats.multiset.enabled" value="false"/>
       
   641                     
   393         <property name="eunitexerunner.flags" value="/E S60AppEnv /R Off" />
   642         <property name="eunitexerunner.flags" value="/E S60AppEnv /R Off" />
   394         <!-- 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.
   643             
   395         @type string
   644         <!--* @property ats.obey.pkgfiles.rule.enabled
   396         @scope public
   645         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.
   397         -->
   646         @type boolean
   398         <property name="ats.obey.pkgfiles.rule" value="False" />
   647         @scope public
   399         <fail unless="ats.product.name" message="ats.product.name property not defined" />
   648         -->
   400         <condition property="ats.hti" value="false" else="true">
   649         
   401             <istrue value="${ats.emulator.enable}" />
   650         <!--* @property ats.obey.pkgfiles.rule
       
   651         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. - deprecated: Start using ats.obey.pkgfiles.rule.enabled property
       
   652         @type boolean
       
   653         @scope public
       
   654         @deprecated since 11.0
       
   655         -->
       
   656         
       
   657         <!-- * @property internal.ats.obey.pkgfiles.rule.enabled
       
   658         If the property is set to "true", if ats.obey.pkgfiles.rule.enabled set to true.
       
   659         @type boolean
       
   660         @scope private
       
   661         -->
       
   662         <condition property="internal.ats.obey.pkgfiles.rule.enabled" value="true" else="false">
       
   663             <or>
       
   664                 <istrue value="${ats.obey.pkgfiles.rule.enabled}" />
       
   665                 <istrue value="${ats.obey.pkgfiles.rule}" />
       
   666             </or>
       
   667         </condition>
       
   668         
       
   669         
       
   670         <fail unless="ats.product.name" message="Error: ats.product.name property not defined" />
       
   671         
       
   672         <!--* @property ats.hti.enabled
       
   673         Set to true if  ats.emulator.enabled set to true. To enable hti feature while creating ats test drop.
       
   674         @type boolean
       
   675         @scope private
       
   676         -->        
       
   677         <condition property="ats.hti.enabled" value="false" else="true">
       
   678             <or>
       
   679                 <istrue value="${ats.emulator.enabled}" />
       
   680                 <istrue value="${ats.emulator.enable}" />
       
   681             </or>
   402         </condition>
   682         </condition>
   403     </target>
   683     </target>
   404 
   684 
   405     <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target -->
   685     <!-- Sets default values for the ASTE, this is a dependent target and shouldn't be used as an individual target -->
   406     <target name="ats-set-defaults-aste" depends="ats-common">
   686     <target name="ats-set-defaults-aste" depends="ats-common">
   425         @scope public
   705         @scope public
   426         -->
   706         -->
   427         <property name="ats.aste.email.list" value="" />
   707         <property name="ats.aste.email.list" value="" />
   428     </target>
   708     </target>
   429 
   709 
       
   710     
       
   711     <macrodef name="getModuleTsrcMacro" uri="http://www.nokia.com/helium">
       
   712         <attribute name="property" />
       
   713         <attribute name="prefix"/>        
       
   714         <sequential>
       
   715             <if>
       
   716                 <istrue value="${sysdef3.enabled}" />
       
   717                 <then>
       
   718                     <hlm:filterSysdef epocroot="${build.drive}/" srcfile="${canonical.sysdef.file}" 
       
   719                         destfile="${build.drive}/output/build/canonical_system_definition_filtered_ats_test.xml">
       
   720                         <filterSet>
       
   721                             <filter filter="test" />
       
   722                         </filterSet>
       
   723 
       
   724                         <filterSet refid="${ats.test.filterset}" />
       
   725                     </hlm:filterSysdef>
       
   726                     <hlm:getModuleTsrcInternalMacro property="@{property}" prefix="@{prefix}" sysdef="${build.drive}/output/build/canonical_system_definition_filtered_ats_test.xml" />
       
   727                 </then>
       
   728                 <else>
       
   729                     <hlm:getModuleTsrcInternalMacro property="@{property}" prefix="@{prefix}" sysdef="${canonical.sysdef.file}" />
       
   730                 </else>
       
   731             </if>
       
   732         </sequential>
       
   733     </macrodef>
       
   734     
   430     <!-- This macro fetches the tsrc paths from system definition file (layers.sysdef.xml).
   735     <!-- This macro fetches the tsrc paths from system definition file (layers.sysdef.xml).
   431         
   736         
   432     The layer defintion should look like:
   737     The layer defintion should look like:
   433 
   738 
   434         <layer name="name_test_layer">
   739         <layer name="name_test_layer">
   435             <module name="module_name">
   740             <module name="module_name">
   436                 <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter="" />
   741                 <unit id="unit_id" name="unti_name" bldFile="path_of_tsrc_folder_to_be_built" filter="" />
   437             </module>
   742             </module>
   438         </layer>
   743         </layer>
   439     -->
   744     -->
   440     <scriptdef name="getModuleTsrcMacro" language="jython" uri="http://www.nokia.com/helium">
   745     <scriptdef name="getModuleTsrcInternalMacro" language="jython" uri="http://www.nokia.com/helium">
   441         <attribute name="property" />
   746         <attribute name="property" />
   442         <attribute name="prefix"/>        
   747         <attribute name="prefix"/>        
       
   748         <attribute name="sysdef"/>        
   443 import traceback
   749 import traceback
   444 import os
   750 import os
   445 import atsant
   751 import atsant
   446 from com.nokia.ant.util import Helper
   752 from com.nokia.ant.util import Helper
   447 
   753 
   448 canonicalsysdeffile = Helper.getProperty(project, 'canonical.sysdef.file')
   754 canonicalsysdeffile = attributes.get('sysdef')
   449 createsingledropfile = project.getProperty('ats.create.singledrop.file')
   755 createsingledropfile = project.getProperty('internal.ats.singledrop.enabled')
   450 modules = atsant.files_to_test(canonicalsysdeffile, project.getProperty('exclude.test.layers'), project.getProperty('ido.build.filter'), project.getProperty('build.drive'), createsingledropfile)
   756 sysdef3 = atsant.get_boolean(str(project.getProperty('sysdef3.enabled')))
       
   757 modules = atsant.files_to_test(canonicalsysdeffile, project.getProperty('exclude.test.layers'), project.getProperty('ido.build.filter'), project.getProperty('build.drive'), createsingledropfile, sysdef3)
   451 
   758 
   452 for name in modules.keys():    
   759 for name in modules.keys():    
   453     if modules[name] == []:
   760     if modules[name] == []:
   454         del modules[name]
   761         del modules[name]
   455     else:
   762     else:
   456         project.setProperty("%s.%s" % (attributes.get('prefix'), name), " ".join(modules[name]))
   763         project.setProperty("%s.%s" % (attributes.get('prefix'), name), " ".join(modules[name]))
   457         
   764 
       
   765 if modules == {}:
       
   766     raise Exception('No test modules found in ' + canonicalsysdeffile)
       
   767 
   458 project.setProperty(attributes.get('property'), ",".join(modules.keys()))
   768 project.setProperty(attributes.get('property'), ",".join(modules.keys()))
   459 project.setProperty('ats.drops.count', str(len(modules)))
   769 project.setProperty('ats.drops.count', str(len(modules)))
   460     </scriptdef>
   770     </scriptdef>
   461 
   771 
   462     <!-- The target is dependent on "ats-test", should not be called individually. The target creates the ATSdrop.zip file including test:xml file -->
   772     <!-- The target is dependent on "ats-test", should not be called individually. The target creates the ATSdrop.zip file including test:xml file -->
   463     <target name="ats-create-drop" depends="ats-set-flash-image-path,ats-emulator-zip">
   773     <target name="ats-create-drop" depends="ats-set-flash-image-path,ats-emulator-zip">
   464         <mkdir dir="${build.output.dir}/ats" />
   774         <mkdir dir="${build.output.dir}/ats" />
   465         <hlm:getModuleTsrcMacro property="module.list" prefix="module.tsrc" />
   775         <hlm:getModuleTsrcMacro property="module.list" prefix="module.tsrc" />
   466         <if>
   776         <for list="${module.list}" delimiter="," param="module">
   467             <scriptcondition language="beanshell">
   777             <sequential>
   468                 <![CDATA[
   778                 <runtarget target="ats-set-defaults-stifeunit" />
   469                     String value = project.getProperty("module.list");
   779                 <exec executable="python">
   470                     if (value != null) {
   780                     <arg line="-m ats3.__init__" />
   471                         String[] out = value.split(",");
   781                     <arg value="--device-type=${ats.product.name}" />
   472                         if ((out == null) || (out.length == 0) || ((out.length == 1) && (out[0].length()==0))) {
   782                     <arg value="--device-hwid=${ats.product.hwid}" />
   473                                     self.setValue(true);
   783                     <arg value="${internal.ats.diamonds.arg}" />
   474                             } else {
   784                     <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
   475                                     self.setValue(false);
   785                     <arg value="--report-email=${ats.email.list}" />
   476                             }
   786                     <arg value="--report-type=${ats.report.type}" />
   477                         } else {
   787                     <arg value="--plan-name=${ats.plan.name}" />
   478                             self.log("Error: module.list not defined.");
   788                     <arg value="--testrun-name=${ats.testrun.name}_@{module}" />
   479                             self.setValue(true);
   789                     <arg value="--flash-images=${ats.flash.images}" />
   480                         }
   790                     <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
   481                             ]]>
   791                     <arg value="--target-platform=${ats.target.platform}" />
   482             </scriptcondition>
   792                     <arg value="--data-dir=${tsrc.data.dir}" />
   483             <then>
   793                     <arg value="--test-timeout=${ats.test.timeout}" />
   484                 <echo message="Error: No test modules found!" />
   794                     <arg value="--build-drive=${build.drive}" />
   485             </then>
   795                     <arg value="--trace-enabled=${ats.trace.enabled}" />
   486             <else>
   796                     <arg value="--ctc-enabled=${ats.ctc.enabled}" />
   487                 <for list="${module.list}" delimiter="," param="module">
   797                     <arg value="--multiset-enabled=${ats.multiset.enabled}" />
   488                     <sequential>
   798                     <arg value="--file-store=${ats.report.location}" />
   489                         <runtarget target="ats-set-defaults-stifeunit" />
   799                     <arg value="--eunitexerunner-flags=${eunitexerunner.flags}" />
   490                         <echo>${ats.drop.file}</echo>
   800                     <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 -->
   491                         <exec executable="python">
   801                     <arg value="--monsym-files=${ats.ctc.monsyms}" />
   492                             <arg line="-m ats3.__init__" />
   802                     <arg value="--config=${ats.config.file}" />
   493                             <arg value="--device-type=${ats.product.name}" />
   803                     <arg value="--obey-pkgfiles=${internal.ats.obey.pkgfiles.rule.enabled}" />
   494                             <arg value="--device-hwid=${ats.product.hwid}" />
   804                     <arg value="--ats4-enabled=${internal.ats4.enabled}" />
   495                             <arg value="${internal.ats.diamonds.arg}" />
   805                     <arg value="--specific-pkg=${ats.specific.pkg}" />
   496                             <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
   806                     <arg value="--hti=${ats.hti.enabled}" />
   497                             <arg value="--report-email=${ats.email.list}" />
   807                     <arg value="--verbose" />
   498                             <arg value="--report-type=${ats.report.type}" />
   808                     <arg line="${module.tsrc.@{module}}" />
   499                             <arg value="--plan-name=${ats.plan.name}" />
   809                 </exec>
   500                             <arg value="--testrun-name=${ats.testrun.name}_@{module}" />
   810                 <antcall target="do-ats-test" />
   501                             <arg value="--flash-images=${ats.flash.images}" />
   811                 <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
   502                             <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
   812             </sequential>
   503                             <arg value="--target-platform=${ats.target.platform}" />
   813         </for>
   504                             <arg value="--data-dir=${tsrc.data.dir}" />
       
   505                             <arg value="--test-timeout=${ats.test.timeout}" />
       
   506                             <arg value="--build-drive=${build.drive}" />
       
   507                             <arg value="--trace-enabled=${ats.trace.enabled}" />
       
   508                             <arg value="--ctc-enabled=${ats.ctc.enabled}" />
       
   509                             <arg value="--multiset-enabled=${ats.multiset.enabled}" />
       
   510                             <arg value="--file-store=${ats.report.location}" />
       
   511                             <arg value="--eunitexerunner-flags=${eunitexerunner.flags}" />
       
   512                             <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 -->
       
   513                             <arg value="--monsym-files=${ats.ctc.monsyms}" />
       
   514                             <arg value="--config=${ats.config.file}" />
       
   515                             <arg value="--obey-pkgfiles=${ats.obey.pkgfiles.rule}" />
       
   516                             <arg value="--ats4-enabled=${ats4.enabled}" />
       
   517                             <arg value="--specific-pkg=${ats.specific.pkg}" />
       
   518                             <arg value="--hti=${ats.hti}" />
       
   519                             <arg value="--verbose" />
       
   520                             <arg line="${module.tsrc.@{module}}" />
       
   521                         </exec>
       
   522                         <antcall target="do-ats-test" />
       
   523                         <math result="drop.file.counter" operand1="1" operation="+" operand2="${drop.file.counter}" datatype="int" />
       
   524                     </sequential>
       
   525                 </for>
       
   526             </else>
       
   527         </if>
       
   528     </target>
   814     </target>
   529 
   815 
   530 
   816 
   531     <!-- Please see ats-aste for description.-->
   817     <!-- Please see ats-aste for description.-->
   532     <target name="do-ats-aste" depends="ats-set-flash-image-path, ats-set-defaults-aste" if="enabled.aste">
   818     <target name="do-ats-aste" depends="ats-set-flash-image-path, ats-set-defaults-aste" if="internal.aste.enabled">
   533         <mkdir dir="${build.output.dir}/ats" />
   819         <mkdir dir="${build.output.dir}/ats" />
   534         <exec executable="python">
   820         <exec executable="python">
   535             <arg line="-m ats3.aste" />
   821             <arg line="-m ats3.aste" />
   536             <arg value="--report-email=${ats.aste.email.list}" />
   822             <arg value="--report-email=${ats.aste.email.list}" />
   537             <arg value="--device-type=${ats.product.name}" />
   823             <arg value="--device-type=${ats.product.name}" />
   548             <arg value="--testasset-location=${ats.aste.testasset.location}" />
   834             <arg value="--testasset-location=${ats.aste.testasset.location}" />
   549             <arg value="--testasset-caseids=${ats.aste.testasset.caseids}" />
   835             <arg value="--testasset-caseids=${ats.aste.testasset.caseids}" />
   550             <arg value="--software-version=${ats.aste.software.version}" />
   836             <arg value="--software-version=${ats.aste.software.version}" />
   551             <arg value="--device-language=${ats.aste.language}" />
   837             <arg value="--device-language=${ats.aste.language}" />
   552             <arg value="--software-release=${ats.aste.software.release}" />
   838             <arg value="--software-release=${ats.aste.software.release}" />
   553             <arg value="--ats4-enabled=${ats4.enabled}" />
   839             <arg value="--ats4-enabled=${internal.ats4.enabled}" />
   554             <arg value="--verbose" />
   840             <arg value="--verbose" />
   555         </exec>
   841         </exec>
   556         <runtarget target="do-ats-test" />
   842         <runtarget target="do-ats-test" />
   557     </target>
   843     </target>
   558 
   844 
   559     <!--
   845     <!--
   560         This target search the mon.sym files using unit information from the canonical sysdef file.
   846         This target search the mon.sym files using unit information from the canonical sysdef file.
   561         Then it copies the discovered files under the ftp server defined by ats.ctc.host.
   847         Then it copies the discovered files under the ftp server defined by ats.ctc.host.
   562         The target url is: ftp ://[server]/ctc_helium/[diamonds_id]/mon_syms/[id]/mon.sym 
   848         The target url is: ftp ://[server]/ctc_helium/[diamonds_id]/mon_syms/[id]/mon.sym 
   563     -->
   849     -->
   564     <target name="copy-mon-sym">
   850     <target name="copy-mon-sym" if="internal.ats.ctc.enabled">
   565         <if>
   851         <if>
   566             <istrue value="${ats.ctc.enabled}"/>
   852             <istrue value="${internal.ats4.enabled}"/>
   567             <then>
   853             <then>
   568                 <fmpp sourceFile="${helium.dir}/tools/testing/ats/templates/monsym-file-list.txt.ftl"
   854                 <var name="ats.ctc.host" value="${diamonds.host}"/>
   569                     outputFile="${temp.build.dir}/monsym-file-list.txt">
   855             </then>
   570                     <data expandProperties="yes">
   856         </if>
   571                         data: xml(${canonical.sysdef.file})
   857         <fmpp sourceFile="${helium.dir}/tools/testing/ats/templates/monsym-file-list.txt.ftl"
   572                         ant: antProperties()
   858             outputFile="${temp.build.dir}/monsym-file-list.txt">
   573                     </data>
   859             <data expandProperties="yes">
   574                 </fmpp>
   860                 data: xml(${canonical.sysdef.file})
   575                 <hlm:path2file reference="mon.sym.list" file="${temp.build.dir}/monsym-file-list.txt" />
   861                 ant: antProperties()
   576                 <script language="jython">
   862             </data>
       
   863         </fmpp>
       
   864         <hlm:path2file reference="mon.sym.list" file="${temp.build.dir}/monsym-file-list.txt" />
       
   865         <script language="jython">
   577 import os
   866 import os
   578 import ctc
   867 import ctc
   579 
   868 
   580 if not project.getProperty('ats.ctc.host'):
   869 if not project.getProperty('ats.ctc.host'):
   581     raise Exception('ats.ctc.host property is not defined.')
   870     raise Exception('ats.ctc.host property is not defined.')
   582 if not project.getProperty('diamonds.build.id'):
   871 if not project.getProperty('diamonds.build.id'):
   583     raise Exception('diamonds.build.id property is not defined.')
   872     raise Exception('diamonds.build.id property is not defined.')
   584 
   873 
   585 server = project.getProperty('ats.ctc.host')
   874 server = project.getProperty('ats.ctc.host')
   586 diamondsid = os.path.basename(os.path.dirname(project.getProperty('diamonds.build.id')))
   875 diamondsid = os.path.basename(os.path.dirname(project.getProperty('diamonds.build.id')))
       
   876 if project.getProperty('internal.ats4.enabled') != 'true':
       
   877     diamondsid = r'ctc_helium/' + diamondsid
       
   878 
   587 path = project.getReference('mon.sym.list')
   879 path = project.getReference('mon.sym.list')
   588 if not path:
   880 if not path:
   589     raise Exception('mon.sym.list reference has not been set')
   881     raise Exception('mon.sym.list reference has not been set')
   590 
   882 
   591 uploader = ctc.MonSymFTPUploader(server, path.list(), diamondsid)
   883 uploader = ctc.MonSymFTPUploader(server, path.list(), diamondsid)
   592 monsyms = uploader.upload()
   884 monsyms = uploader.upload()
   593             
   885             
   594 # Using ; to separate the path because the target script is running on windows
   886 # Using ; to separate the path because the target script is running on windows
   595 project.setNewProperty('ats.ctc.monsyms', ';'.join([ "//%s/%s" % (server, x) for x in monsyms]))
   887 project.setNewProperty('ats.ctc.monsyms', ';'.join([ "//%s/%s" % (server, x) for x in monsyms]))
   596                 </script>
   888         </script>
   597                 <echo>ats.ctc.monsyms: ${ats.ctc.monsyms}</echo>
   889         <echo>ats.ctc.monsyms: ${ats.ctc.monsyms}</echo>
   598             </then>
       
   599         </if>
       
   600     </target>
       
   601 
       
   602     <!-- a dependant target please do not call directly use matti-test,
       
   603     target calls the MATTI script that creates the MATTI_drop.zip file and runs the tests
       
   604     listed in test.rb.  ats-set-flash-image-path and ats-set-sis-flash-image-path look for lists of files-->
       
   605     <target name="do-ats-matti" depends="ats-set-flash-image-path, ats-set-sis-flash-image-path" >
       
   606         <runtarget target="ats-set-defaults-stifeunit" />
       
   607         <!--need to set theseup for use by do-ats-test target-->
       
   608         <mkdir dir="${build.output.dir}/ats" />
       
   609         <var name="ats.drop.file" value="ATSMattiDrop.zip" />
       
   610         <if>
       
   611             <!-- get the list of .sis files in the defined folder to pass as a list to the python script-->
       
   612             <scriptcondition language="beanshell">
       
   613                 <![CDATA[
       
   614                     String sisfiles = project.getProperty("ats.sis.images");
       
   615                     String value = project.getProperty("ats.sisfiles.minlimit");
       
   616                     if (sisfiles != null && value != null) {
       
   617                         int cond = Integer.valueOf(value).intValue();
       
   618                         String[] out = sisfiles.split(",");
       
   619                         if (out.length < cond ) {
       
   620                             self.setValue(true);
       
   621                         } else {
       
   622                             self.setValue(false);
       
   623                         }
       
   624                     } else {
       
   625                         self.log("Error: reference.ats.sis.images not defined.");
       
   626                         self.setValue(true);
       
   627                     }
       
   628                         ]]>
       
   629             </scriptcondition>
       
   630             <then>
       
   631                 <echo message="Error: Not enough sis files check reference.ats.sis.images" />
       
   632             </then>
       
   633             <else>
       
   634                 <!-- execute the MattiDrops.py script with parameters-->
       
   635                 <exec executable="python" resultproperty="script.response">
       
   636                     <arg line="-m ats3.matti.MattiDrops" />
       
   637                     <arg value="--build-drive=${build.drive}" />
       
   638                     <arg value="--matti-scripts=${matti.scripts}" />
       
   639                     <arg value="--flash-images=${ats.flash.images}" />
       
   640                     <arg value="--harness=STIF" />
       
   641                     <arg value="--file-store=${ats.output.dir}" />
       
   642                     <arg value="--testrun-name=${ats.testrun.name}" />
       
   643                     <arg value="--device-type=${ats.product.name}" />
       
   644                     <arg value="--device-hwid=${ats.product.hwid}" />
       
   645                     <arg value="--diamonds-build-url=${internal.ats.diamonds.arg}" />
       
   646                     <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
       
   647                     <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
       
   648                     <arg value="--plan-name=${ats.plan.name}" />
       
   649                     <arg value="--sis-files=${ats.sis.images}" />
       
   650                     <arg value="--template-loc=${template.file}" />
       
   651                 </exec>
       
   652                 <if> 
       
   653                     <not>
       
   654                         <!-- if the response is not 0 then need to create the skip.ats.sending
       
   655                          flag so that do-ats-test is not run-->
       
   656                         <equals arg1="${script.response}" arg2="0" />
       
   657                     </not>
       
   658                     <then>
       
   659                         <!-- Skips sending drop package file to ATS/ASTE after its creation.
       
   660                         @type boolean
       
   661                         @scope public
       
   662                         -->
       
   663                         <property name="skip.ats.sending" value="1" />
       
   664                     </then>
       
   665                 </if>
       
   666                 <runtarget target="do-ats-test" />
       
   667             </else>
       
   668         </if>
       
   669     </target>
   890     </target>
   670     
   891     
   671     <!-- Temp dir
   892     <!-- Temp dir
   672     @type string
   893     @type string
   673     @scope private
   894     @scope private
   678     @scope private
   899     @scope private
   679     -->
   900     -->
   680     <property name="ats.evalid.post" value="${temp.build.dir}/${build.id}_atsevalidpost" />
   901     <property name="ats.evalid.post" value="${temp.build.dir}/${build.id}_atsevalidpost" />
   681     
   902     
   682     <!-- Call before preperation -->
   903     <!-- Call before preperation -->
   683     <target name="find-files-pre" if="ats.delta.enabled">
   904     <target name="find-files-pre" if="internal.ats.delta.enabled">
   684         <hlm:evalidMacro dir="${ats.evalid.pre}"/>
   905         <hlm:evalidMacro dir="${ats.evalid.pre}"/>
   685     </target>
   906     </target>
   686     
   907     
   687     <!-- Call after preperation -->
   908     <!-- Call after preperation -->
   688     <target name="find-files-post" if="ats.delta.enabled">
   909     <target name="find-files-post" if="internal.ats.delta.enabled">
   689         <hlm:evalidMacro dir="${ats.evalid.post}"/>
   910         <hlm:evalidMacro dir="${ats.evalid.post}"/>
   690     </target>
   911     </target>
   691     
   912     
   692     <!-- Run evalid on ido directories -->
   913     <!-- Run evalid on ido directories -->
   693     <macrodef name="evalidMacro" uri="http://www.nokia.com/helium">
   914     <macrodef name="evalidMacro" uri="http://www.nokia.com/helium">
   700             </hlm:python>
   921             </hlm:python>
   701         </sequential>
   922         </sequential>
   702     </macrodef>
   923     </macrodef>
   703     
   924     
   704     <!-- Generate sysdef fileset based on evalid data -->
   925     <!-- Generate sysdef fileset based on evalid data -->
   705     <target name="ats-delta" if="ats.delta.enabled">
   926     <target name="ats-delta" if="internal.ats.delta.enabled">
   706         <script language="jython">
   927         <script language="jython">
   707 import ido
   928 import ido
   708 from com.nokia.ant.util import Helper
   929 from com.nokia.ant.util import Helper
   709 import delta_zip
   930 import delta_zip
   710 import os
   931 import os
   726     
   947     
   727     <!-- Common target to run ats, aste and matti -->
   948     <!-- Common target to run ats, aste and matti -->
   728     <target name="run-test" depends="ats-test,ats-aste,matti-test"/>
   949     <target name="run-test" depends="ats-test,ats-aste,matti-test"/>
   729     
   950     
   730     <!-- Zip build area for emulator -->
   951     <!-- Zip build area for emulator -->
   731     <target name="ats-emulator-zip" if="ats.emulator.enable">
   952     <target name="ats-emulator-zip" if="internal.ats.emulator.enabled">
   732         <property name="zips.emulator_zip.spec.name" value="emulator_zip"/>
   953         <property name="zips.emulator_zip.spec.name" value="emulator_zip"/>
   733         <hlm:zipContentMacro type="emulator_zip" file="${helium.dir}/tools/testing/ats/emulator_zip.cfg.xml" />
   954         <hlm:zipContentMacro type="emulator_zip" file="${helium.dir}/tools/testing/ats/emulator_zip.cfg.xml" />
   734 
   955 
   735         <if>
   956         <if>
   736             <isset property="ats.drop.location" />
   957             <isset property="ats.drop.location" />
   763             <arg value="--test-type=${ats.custom.test.type}" />
   984             <arg value="--test-type=${ats.custom.test.type}" />
   764         </exec>
   985         </exec>
   765         <runtarget target="do-ats-test" />
   986         <runtarget target="do-ats-test" />
   766     </target>
   987     </target>
   767 
   988 
       
   989     <!-- a dependant target please do not call directly use matti-test,
       
   990      target calls the MATTI script that creates the MATTI_drop.zip file and runs the tests
       
   991      listed in test.rb.  ats-set-flash-image-path and ats-set-sis-flash-image-path look for lists of files-->
       
   992     <target name="do-ats-matti" depends="ats-set-flash-image-path" >
       
   993         <runtarget target="ats-set-defaults-stifeunit" />
       
   994         <!--need to set theseup for use by do-ats-test target-->
       
   995         <mkdir dir="${build.output.dir}/ats" />
       
   996         <var name="ats.drop.file" value="ATSMattiDrop.zip" />
       
   997         <!-- execute the MattiDrops.py script with parameters-->
       
   998         <exec executable="python" resultproperty="script.response">
       
   999             <arg line="-m ats3.matti2" />
       
  1000             <arg value="--build-drive=${build.drive}" />
       
  1001             <arg value="--test-profiles=${matti.test.profiles}" />      <!--"all, !bat1" -->
       
  1002             <arg value="--sierra-enabled=${matti.sierra.enabled}" />    <!--"true/false" -->
       
  1003             <arg value="--matti-timeout=${matti.test.timeout}" />       <!--"600" -->
       
  1004             <arg value="${internal.ats.diamonds.arg}" />
       
  1005             <arg value="--testasset-location=${matti.asset.location}" />    <!--"local and/or network drive" -->
       
  1006             <arg value="--file-store=${ats.output.dir}" />              <!--"network drive" -->
       
  1007             <arg value="--testrun-name=${ats.testrun.name}" />          <!--"Matti_Profile_Name" -->
       
  1008             <arg value="--alias-name=${ats.alias.name}" />                        <!--"agents_alias_Name" -->
       
  1009             <arg value="--device-type=${ats.product.name}" />
       
  1010             <arg value="--flash-images=${ats.flash.images}" /> 
       
  1011             <arg value="--drop-file=${build.output.dir}/ats/${ats.drop.file}" />
       
  1012             <arg value="--minimum-flash-images=${ats.flashfiles.minlimit}" />
       
  1013             <arg value="--template-loc=${matti.template.file}" />             <!--"local and/or network drive. No comma separated list" -->
       
  1014             <arg value="--email-format=${ats.email.format}" />          <!--"Email Formatting. e.g. simplelogger" -->
       
  1015             <arg value="--email-subject=${ats.email.subject}" />        <!--"Email Subject. e.g. Matti testing" -->
       
  1016             <arg value="--report-email=${ats.email.list}" /> 
       
  1017             <arg value="--ats4-enabled=${internal.ats4.enabled}" />
       
  1018             <arg value="--matti-sis-files=${matti.sis.files}" />        <!--"src#store#dst, src#store#dst" -->
       
  1019             <arg value="--matti-parameters=${matti.parameters}" />
       
  1020             <arg value="--sierra-parameters=${matti.sierra.parameters}" />    <!--Additional sierra parameters for matti task e.g. ordered teardown -->
       
  1021         </exec>
       
  1022         
       
  1023         <!-- Unset the internal property to overwrite with new value-->
       
  1024         <var name="internal.ats.upload.enabled" unset="true"/>
       
  1025         <!-- set internal property if python returns 0 value for matti test drop creation --> 
       
  1026         <condition property="internal.ats.upload.enabled">
       
  1027             <equals arg1="${script.response}" arg2="0" />
       
  1028         </condition>
       
  1029         <runtarget target="do-ats-test" />
       
  1030     </target>
       
  1031 
       
  1032 
   768 </project>
  1033 </project>