1# Copyright 2019 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 5from autotest_lib.server import utils 6 7AUTHOR = 'chromeos-bluetooth' 8NAME = 'bluetooth_PeerUpdate' 9PURPOSE = 'Update chameleond on Bluetooth peer device' 10CRITERIA = 'Bluetooth peer should be present' 11ATTRIBUTES = 'suite:bluetooth, suite:bluetooth_wifi_testbed_update' 12TIME = 'SHORT' # This test takes about 1 minutes while running locally 13TEST_CATEGORY = 'Functional' 14TEST_CLASS = 'bluetooth' 15TEST_TYPE = 'server' 16DEPENDENCIES = 'bluetooth, working_bluetooth_btpeer:1' 17PY_VERSION = 3 18 19DOC = """ 20 21This is not a test. This 'test' checks the chameleond version on the 22Bluetooth peer and updates if it is less that expected version in the test. 23 24Use this test if you have made a change to chameleond which should be deployed 25in the lab. 26 27Please follow the steps to update chameleond version in the lab. 28 291) Test and update chameleond code 30- Deploy the change in chameleon in a local bt peer 31 and run bluetooth_AdapterQuickHealth against it. 32- Merge the changes 33 342) After chameleond changes are merged 35- run make in chameleon folder 36- get the git commit using the command 'git log HEAD^..HEAD --pretty=format:"%h"' 37- rename the dist/chameleond-0.0.2.tar.gz to chameleond-0.0.2-<git commit>.tar.gz 38- create a text file named 'latest_bluetooth_commit' with following format 39' 40commit : <git commit> 41' 42- upload the latest file and chameleond-0.0.2-<git commit>.tar.gz to 43 https://pantheon.corp.google.com/storage/browser/chromeos-localmirror/distfiles/bluetooth_peer_bundle 44 45Once the files are uploaded, the test will start updating the peers in the lab. 46 47Note: Due to way the scheduler works, if there is more than one DUT of same 48model, test will be run only on one of them. Thus the process is indeterministic 49now but over a large period of time all the peer devices in the lab should(?) 50be updated. 51 52""" 53 54args_dict = utils.args_to_dict(args) 55btpeer_args = hosts.CrosHost.get_btpeer_arguments(args_dict) 56 57def run(machine): 58 host = hosts.create_host(machine) 59 job.run_test('bluetooth_PeerUpdate', host=host, btpeer_args=btpeer_args) 60 61parallel_simple(run, machines) 62