• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_AdapterAUHealth import (
12        bluetooth_AdapterAUHealth)
13from autotest_lib.server.site_tests.bluetooth_AdapterCLHealth import (
14        bluetooth_AdapterCLHealth)
15from autotest_lib.server.site_tests.bluetooth_AdapterLEHealth import (
16        bluetooth_AdapterLEHealth)
17from autotest_lib.server.site_tests.bluetooth_AdapterMDHealth import (
18        bluetooth_AdapterMDHealth)
19from autotest_lib.server.site_tests.bluetooth_AdapterSAHealth import (
20        bluetooth_AdapterSAHealth)
21from autotest_lib.server.site_tests.bluetooth_AdapterSRHealth import (
22        bluetooth_AdapterSRHealth)
23
24from six.moves import range
25
26
27class bluetooth_AdapterQuickHealth(
28        bluetooth_AdapterAUHealth.bluetooth_AdapterAUHealth,
29        bluetooth_AdapterCLHealth.bluetooth_AdapterCLHealth,
30        bluetooth_AdapterLEHealth.bluetooth_AdapterLEHealth,
31        bluetooth_AdapterSAHealth.bluetooth_AdapterSAHealth,
32        bluetooth_AdapterSRHealth.bluetooth_AdapterSRHealth,
33        bluetooth_AdapterMDHealth.bluetooth_AdapterMDHealth):
34    """This class implements a Bluetooth quick health package, using methods
35    provided in BluetoothAdapterQuickTests,
36    The package is running several sub batches of tests.
37    A batch is defined as a set of tests, preferably with a common subject, e.g
38    'LE Health' batch, or the 'Stand Alone Health' batch.
39    The quick health test package is improving test time by doing the minimal
40    cleanups between each test and test batches, saving the auto-test ramp up
41    time of about 90-120 second per test.
42    """
43
44    def run_once(self,
45                 host,
46                 num_iterations=1,
47                 args_dict=None,
48                 flag='Quick Health'):
49        """Run the package of Bluetooth LE health tests
50
51        @param host: the DUT, usually a chromebook
52        @param num_iterations: the number of rounds to execute the test
53        """
54
55        # Init the quick test and start the package
56        self.quick_test_init(host,
57                             use_btpeer=True,
58                             flag=flag,
59                             args_dict=args_dict)
60        self.quick_test_package_start('BT Quick Health')
61
62        # Run health package
63        for iter in range(1, num_iterations + 1):
64            self.quick_test_package_update_iteration(iter)
65            self.sa_health_batch_run()
66            self.cl_health_batch_run()
67            self.le_health_batch_run()
68            self.md_health_batch_run()
69            self.sr_health_batch_run()
70            self.au_health_batch_run()
71            self.quick_test_print_summary()
72
73        # End and cleanup test package
74        self.quick_test_package_end()
75        self.quick_test_cleanup()
76