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_e2e, suite:bluetooth_mtbf' 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' 17 18DOC = """ 19 20This is not a test. This 'test' checks the chameleond version on the 21Bluetooth peer and updates if it is less that expected version in the test. 22 23Use this test if you have made a change to chameleond which should be deployed 24in the lab. 25 26Please follow the steps to update chameleond version in the lab. 27 281) Test and update chameleond code 29- Deploy the change in chameleon in a local bt peer 30 and run bluetooth_AdapterQuickHealth against it. 31- Merge the changes 32 332) After chameleond changes are merged 34- run make in chameleon folder 35- get the git commit using the command 'git log HEAD^..HEAD --pretty=format:"%h"' 36- rename the dist/chameleond-0.0.2.tar.gz to chameleond-0.0.2-<git commit>.tar.gz 37- create a text file named 'latest_bluetooth_commit' with following format 38' 39commit : <git commit> 40' 41- upload the latest file and chameleond-0.0.2-<git commit>.tar.gz to 42 https://pantheon.corp.google.com/storage/browser/chromeos-localmirror/distfiles/bluetooth_peer_bundle 43 44Once the files are uploaded, the test will start updating the peers in the lab. 45 46Note: Due to way the scheduler works, if there is more than one DUT of same 47model, test will be run only on one of them. Thus the process is indeterministic 48now but over a large period of time all the peer devices in the lab should(?) 49be updated. 50 51""" 52 53args_dict = utils.args_to_dict(args) 54btpeer_args = hosts.CrosHost.get_btpeer_arguments(args_dict) 55 56def run(machine): 57 host = hosts.create_host(machine) 58 job.run_test('bluetooth_PeerUpdate', host=host, btpeer_args=btpeer_args) 59 60parallel_simple(run, machines) 61