1# Lint as: python2, python3 2# Copyright 2019 The Chromium OS Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5"""This class implements a Bluetooth quick health package""" 6 7from __future__ import absolute_import 8from __future__ import division 9from __future__ import print_function 10 11from autotest_lib.server.site_tests.bluetooth_AdapterAdvMonitor import ( 12 bluetooth_AdapterAdvMonitor) 13from autotest_lib.server.site_tests.bluetooth_AdapterAUHealth import ( 14 bluetooth_AdapterAUHealth) 15from autotest_lib.server.site_tests.bluetooth_AdapterCLHealth import ( 16 bluetooth_AdapterCLHealth) 17from autotest_lib.server.site_tests.bluetooth_AdapterLEHealth import ( 18 bluetooth_AdapterLEHealth) 19from autotest_lib.server.site_tests.bluetooth_AdapterMDHealth import ( 20 bluetooth_AdapterMDHealth) 21from autotest_lib.server.site_tests.bluetooth_AdapterSAHealth import ( 22 bluetooth_AdapterSAHealth) 23from autotest_lib.server.site_tests.bluetooth_AdapterSRHealth import ( 24 bluetooth_AdapterSRHealth) 25 26from six.moves import range 27 28 29class bluetooth_AdapterQuickHealth( 30 bluetooth_AdapterAdvMonitor.bluetooth_AdapterAdvMonitor, 31 bluetooth_AdapterAUHealth.bluetooth_AdapterAUHealth, 32 bluetooth_AdapterCLHealth.bluetooth_AdapterCLHealth, 33 bluetooth_AdapterLEHealth.bluetooth_AdapterLEHealth, 34 bluetooth_AdapterSAHealth.bluetooth_AdapterSAHealth, 35 bluetooth_AdapterSRHealth.bluetooth_AdapterSRHealth, 36 bluetooth_AdapterMDHealth.bluetooth_AdapterMDHealth): 37 """This class implements a Bluetooth quick health package, using methods 38 provided in BluetoothAdapterQuickTests, 39 The package is running several sub batches of tests. 40 A batch is defined as a set of tests, preferably with a common subject, e.g 41 'LE Health' batch, or the 'Stand Alone Health' batch. 42 The quick health test package is improving test time by doing the minimal 43 cleanups between each test and test batches, saving the auto-test ramp up 44 time of about 90-120 second per test. 45 """ 46 47 def run_once(self, 48 host, 49 num_iterations=1, 50 args_dict=None, 51 flag='Quick Health'): 52 """Run the package of Bluetooth LE health tests 53 54 @param host: the DUT, usually a chromebook 55 @param num_iterations: the number of rounds to execute the test 56 """ 57 58 # Init the quick test and start the package 59 self.quick_test_init(host, 60 use_btpeer=True, 61 flag=flag, 62 args_dict=args_dict) 63 self.quick_test_package_start('BT Quick Health') 64 65 # Run health package 66 for iter in range(1, num_iterations + 1): 67 self.quick_test_package_update_iteration(iter) 68 self.sa_health_batch_run() 69 self.cl_health_batch_run() 70 self.le_health_batch_run() 71 self.md_health_batch_run() 72 self.sr_health_batch_run() 73 self.au_health_batch_run() 74 self.advmon_health_batch_run() 75 self.quick_test_print_summary() 76 77 # End and cleanup test package 78 self.quick_test_package_end() 79 self.quick_test_cleanup() 80