| # Copyright 2018 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| AUTHOR = "dhaddock, ChromiumOS" |
| NAME = "autoupdate_P2P.local" |
| METADATA = { |
| "contacts": [ |
| "chromeos-core-services@google.com", |
| "chromeos-sw-engprod@google.com" |
| ], |
| "bug_component": "b:908319", |
| "criteria": "Tests autoupdate via peer to peer(P2P) locally." |
| } |
| TIME = "MEDIUM" |
| TEST_TYPE = "server" |
| |
| DOC = """ |
| This tests autoupdate between two devices via peer to peer. |
| |
| Use this control file to debug the test at your desk. The test requires the |
| lab to schedule and provision two DUTs before the test begins. We will need |
| to do that setup manually before running the test. |
| |
| Steps to run from your desk: |
| 1. Lease two DUTs in the lab. They need to be the same make/model and near |
| each other. |
| 2. ssh into both and make sure they can ping each other. |
| 3. Provision both DUTs to the same build. You can use cros flash to do this. |
| 4. Pass the companion_hosts arg to test_that. |
| |
| You can use different test_that args to control which subtest to run. |
| - with_dlc=True for the control.with_dlc subtest. |
| - too_many_attempts=True for control.too_many_attempts. |
| - deadline_expired=True for control.deadline_expired.delta |
| |
| See autoupdate_Basic's control.delta for general info on running autoupdate |
| tests locally. |
| |
| test_that <hostname>.cros autoupdate_P2P.local --companion_hosts="<hostname2>.cros" --args="with_dlc=True build=RXX-XXXXX.XX.X" |
| |
| """ |
| |
| import logging |
| from autotest_lib.server import utils |
| |
| args_dict = utils.args_to_dict(args) |
| |
| def run(machine): |
| host1 = hosts.create_host(machine) |
| companions = hosts.create_companion_hosts(companion_hosts) |
| job.run_test('autoupdate_P2P', host=host1, companions=companions, running_at_desk=True, **args_dict) |
| |
| job.parallel_simple(run, machines) |