Modified ats_specialise_test_drop to automatically set test-target param based on device alias
authorMaciej Seroka <maciejs@symbian.org>
Tue, 04 May 2010 08:41:59 +0100
changeset 1006 75c9a2f0ae9e
parent 1005 a65c8f61a120
child 1007 8c24dee61a8f
Modified ats_specialise_test_drop to automatically set test-target param based on device alias
common/build.test.xml
common/tools/ats/ats_specialise_test_drop.pl
--- a/common/build.test.xml	Tue May 04 01:04:57 2010 +0100
+++ b/common/build.test.xml	Tue May 04 08:41:59 2010 +0100
@@ -167,7 +167,6 @@
               <arg value="--build-id=http://${sf.spec.publish.diamonds.server}${diamonds.build.id}"/>	
               <arg value="--publish=${publish.dir}\ats_reports"/>
               <arg value="--bld-drive=${build.drive}"/>
-              <arg value="--test-target=Syborg_tef"/>
               <arg value="--image-path=${sf.spec.test.imagepath}"/>
             </exec>
           </then>
--- a/common/tools/ats/ats_specialise_test_drop.pl	Tue May 04 01:04:57 2010 +0100
+++ b/common/tools/ats/ats_specialise_test_drop.pl	Tue May 04 08:41:59 2010 +0100
@@ -56,7 +56,6 @@
                 'help' => \$help,
                 'publish' => \$publish,
                 'bld-drive' => \$bld_drive,
-                'test-target' => \$test_target,
                 'image-path' => \$image_path);
 
 GetOptions(\%optmap,
@@ -68,7 +67,6 @@
           'help!',
           'publish=s', 
           'bld-drive=s',
-          'test-target=s',
           'image-path=s') 
           or usage_error();
 
@@ -132,7 +130,7 @@
 
 # Parse the input XML into hashref.
 my $test_drop = XMLin("./$xml_in", keeproot => 1,
-    forcearray => [ 'name', 'id', 'owner', 'priority', 'buildid', 'postAction', 'type', 'target', 'device', 'property', 'command', 'param', 'plan'],#
+    forcearray => [ 'name', 'id', 'owner', 'priority', 'buildid', 'postAction', 'type', 'target', 'device', 'property', 'command', 'param', 'plan', 'session', 'set', 'alias' ],#
         keyattr => [] );
     
 # Insert the specified test drop name, if any.
@@ -141,9 +139,14 @@
 $test_drop->{'test'}->{'buildid'}->[0] = $build_id, if $build_id;
 # Insert the path to the ROM image
 if ($image_path) {
-    $test_drop->{'test'}->{'plan'}->[0]->{'flash'}->[0];
-    my $flash_params = $test_drop->{'test'}->{'plan'}->[0]->{'flash'};
-    $flash_params->[0] = { 'target-alias' => $test_target, 'images' => $image_path };
+	my $set_params;
+	my $flash_params;
+	foreach $set_params (@{$test_drop->{'test'}->{'plan'}->[0]->{'session'}->[0]->{'set'}}) {
+		$test_target = $set_params->{'target'}->[0]->{'device'}->[0]->{'alias'};
+		$set_params->{'flash'}->[0];
+		$flash_params = $set_params->{'flash'};
+		$flash_params->[0] = { 'target-alias' => $test_target, 'images' => $image_path };
+	}
 }
 
 # Insert the FileStoreAction parameter