# HG changeset patch # User Maciej Seroka # Date 1272958919 -3600 # Node ID 75c9a2f0ae9e81387c68d8aecf5b0099c93c034d # Parent a65c8f61a120dd3626e0c1e8ed4e4a253597aab2 Modified ats_specialise_test_drop to automatically set test-target param based on device alias diff -r a65c8f61a120 -r 75c9a2f0ae9e common/build.test.xml --- 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 @@ - diff -r a65c8f61a120 -r 75c9a2f0ae9e common/tools/ats/ats_specialise_test_drop.pl --- 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