130 $xml_in = $srcfile; |
128 $xml_in = $srcfile; |
131 } |
129 } |
132 |
130 |
133 # Parse the input XML into hashref. |
131 # Parse the input XML into hashref. |
134 my $test_drop = XMLin("./$xml_in", keeproot => 1, |
132 my $test_drop = XMLin("./$xml_in", keeproot => 1, |
135 forcearray => [ 'name', 'id', 'owner', 'priority', 'buildid', 'postAction', 'type', 'target', 'device', 'property', 'command', 'param', 'plan'],# |
133 forcearray => [ 'name', 'id', 'owner', 'priority', 'buildid', 'postAction', 'type', 'target', 'device', 'property', 'command', 'param', 'plan', 'session', 'set', 'alias' ],# |
136 keyattr => [] ); |
134 keyattr => [] ); |
137 |
135 |
138 # Insert the specified test drop name, if any. |
136 # Insert the specified test drop name, if any. |
139 $test_drop->{'test'}->{'name'}->[0] = $test_drop_name, if $test_drop_name; |
137 $test_drop->{'test'}->{'name'}->[0] = $test_drop_name, if $test_drop_name; |
140 # Insert the specified build id, if any. |
138 # Insert the specified build id, if any. |
141 $test_drop->{'test'}->{'buildid'}->[0] = $build_id, if $build_id; |
139 $test_drop->{'test'}->{'buildid'}->[0] = $build_id, if $build_id; |
142 # Insert the path to the ROM image |
140 # Insert the path to the ROM image |
143 if ($image_path) { |
141 if ($image_path) { |
144 $test_drop->{'test'}->{'plan'}->[0]->{'flash'}->[0]; |
142 my $set_params; |
145 my $flash_params = $test_drop->{'test'}->{'plan'}->[0]->{'flash'}; |
143 my $flash_params; |
146 $flash_params->[0] = { 'target-alias' => $test_target, 'images' => $image_path }; |
144 foreach $set_params (@{$test_drop->{'test'}->{'plan'}->[0]->{'session'}->[0]->{'set'}}) { |
|
145 $test_target = $set_params->{'target'}->[0]->{'device'}->[0]->{'alias'}; |
|
146 $set_params->{'flash'}->[0]; |
|
147 $flash_params = $set_params->{'flash'}; |
|
148 $flash_params->[0] = { 'target-alias' => $test_target, 'images' => $image_path }; |
|
149 } |
147 } |
150 } |
148 |
151 |
149 # Insert the FileStoreAction parameter |
152 # Insert the FileStoreAction parameter |
150 my $postaction_params = $test_drop->{'test'}->{'postAction'}->[0]->{'params'}->{'param'}, if $publish; |
153 my $postaction_params = $test_drop->{'test'}->{'postAction'}->[0]->{'params'}->{'param'}, if $publish; |
151 $postaction_params->[1] = { 'name' => "to-folder", 'value' => $publish }, if $publish; |
154 $postaction_params->[1] = { 'name' => "to-folder", 'value' => $publish }, if $publish; |