| # Copyright 2016 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| |
| AUTHOR = "sbasi" |
| NAME = "provision_TestbedUpdate" |
| PURPOSE = "Provision the multiple DUTs in a Testbed setup." |
| TIME = "MEDIUM" |
| TEST_CATEGORY = "System" |
| TEST_CLASS = "provision" |
| TEST_TYPE = "Server" |
| |
| DOC = """ |
| This is a test used by the provision control segment in autoserv to set the |
| testbed-version label of a testbed to the desired setting and reimage the |
| testbed to a specific version. |
| """ |
| |
| |
| from autotest_lib.client.common_lib import error, utils |
| from autotest_lib.client.cros import constants |
| |
| |
| # Autoserv may inject a local variable called value to supply the desired |
| # version. If it does not exist, check if it was supplied as a test arg. |
| if not locals().get('value'): |
| args = utils.args_to_dict(args) |
| if not args.get('value'): |
| raise error.TestError("No provision value!") |
| value = args['value'] |
| |
| |
| def run(machine): |
| testbed = hosts.create_target_machine(machine) |
| job.run_test('provision_TestbedUpdate', host=testbed, value=value) |
| |
| |
| job.parallel_simple(run, machines) |