1 # Copyright 2018 The Chromium OS Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 AUTHOR = "dhaddock, Chromium OS" 6 NAME = "autoupdate_P2P.local" 7 PURPOSE = "Test autoupdate via peer to peer(P2P) locally." 8 TIME = "MEDIUM" 9 TEST_CATEGORY = "Functional" 10 TEST_CLASS = "platform" 11 TEST_TYPE = "server" 12 13 14 DOC = """ 15 This tests autoupdate between two devices via peer to peer. 16 17 Use this control file to debug the test at your desk. The test requires the 18 lab to schedule and provision two DUTs before the test begins. We will need 19 to do that setup manually before running the test. 20 21 Steps: 22 1. Lock two DUTs in the lab. They need to be the same make/model. 23 2. Ssh into both and make sure they can ping each other. 24 3. Provision both DUTs to the same build. You can use provision_AutoUpdate or 25 cros flash to do this. 26 4. Pass two args to test_that: host2, job_repo_url. 27 28 test_that <hostname>.cros autoupdate_P2P.local args="host2=<hostname>.cros job_repo_url=<job_repo_url>" 29 30 """ 31 32 import logging 33 from autotest_lib.server import utils 34 35 args_dict = utils.args_to_dict(args) 36 37 def run(machine): 38 if all(arg in args_dict for arg in ['host2', 'job_repo_url']): 39 host1 = hosts.create_host(machine) 40 host2 = hosts.create_host(args_dict.get('host2')) 41 job.run_test('autoupdate_P2P', hosts=[host1, host2], job_repo_url=args_dict.get('job_repo_url')) 42 else: 43 logging.info('Please provide both "host2" and "job_repo_url" args to test_that.') 44 45 job.parallel_simple(run, machines) 46