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 5AUTHOR = "dhaddock, Chromium OS" 6NAME = "autoupdate_P2P.local" 7PURPOSE = "Test autoupdate via peer to peer(P2P) locally." 8TIME = "MEDIUM" 9TEST_CATEGORY = "Functional" 10TEST_CLASS = "platform" 11TEST_TYPE = "server" 12 13 14DOC = """ 15This tests autoupdate between two devices via peer to peer. 16 17Use this control file to debug the test at your desk. The test requires the 18lab to schedule and provision two DUTs before the test begins. We will need 19to do that setup manually before running the test. 20 21Steps to run from your desk: 221. Lease two DUTs in the lab. They need to be the same make/model. 232. ssh into both and make sure they can ping each other. 243. Provision both DUTs to the same build. You can use cros flash to do this. 254. Pass two args to test_that: host2, job_repo_url. 26 27A job_repo_url is a URL passed to each test that points to the autotest 28packages. The AU tests use that url to figure out the devserver to use for the 29test. When you are running locally you need to pass in a job_repo_url. An 30example is: 31http://100.115.245.194:8082/static/caroline-release/R82-12887.0.0/autotest/packages 32 33test_that <hostname>.cros autoupdate_P2P.local --args="host2=<hostname>.cros job_repo_url=<job_repo_url>" 34 35""" 36 37import logging 38from autotest_lib.server import utils 39 40args_dict = utils.args_to_dict(args) 41 42def run(machine): 43 if all(arg in args_dict for arg in ['host2', 'job_repo_url']): 44 host1 = hosts.create_host(machine) 45 host2 = hosts.create_host(args_dict.get('host2')) 46 job.run_test('autoupdate_P2P', hosts=[host1, host2], job_repo_url=args_dict.get('job_repo_url')) 47 else: 48 logging.info('Please provide both "host2" and "job_repo_url" args to test_that.') 49 50job.parallel_simple(run, machines) 51