• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5"""This class implements a Bluetooth quick sanity package"""
6
7from autotest_lib.server.site_tests.bluetooth_AdapterCLSanity import\
8     bluetooth_AdapterCLSanity
9from autotest_lib.server.site_tests.bluetooth_AdapterLESanity import\
10     bluetooth_AdapterLESanity
11from autotest_lib.server.site_tests.bluetooth_AdapterSASanity import\
12     bluetooth_AdapterSASanity
13
14class bluetooth_AdapterQuickSanity(
15        bluetooth_AdapterCLSanity.bluetooth_AdapterCLSanity,
16        bluetooth_AdapterLESanity.bluetooth_AdapterLESanity,
17        bluetooth_AdapterSASanity.bluetooth_AdapterSASanity):
18    """This class implements a Bluetooth quick sanity package, using methods
19    provided in BluetoothAdapterQuickTests,
20    The package is running several sub batches of tests.
21    A batch is defined as a set of tests, preferably with a common subject, e.g
22    'LE Sanity' batch, or the 'Stand Alone Sanity' batch.
23    The quick sanity test pacakge is imporving test time by doing the minimal
24    cleanups between each test and test batches, saving the auto-test ramp up
25    time of about 90-120 second per test.
26    """
27
28    def run_once(self, host, num_iterations=1, flag='Quick Sanity'):
29        """Run the package of Bluetooth LE sanity tests
30
31        @param host: the DUT, usually a chromebook
32        @param num_iterations: the number of rounds to execute the test
33        """
34
35        # Init the quick test and start the package
36        self.quick_test_init(host, use_chameleon=True, flag=flag)
37        self.quick_test_package_start('BT Quick Sanity')
38
39        # Run sanity package
40        for iter in xrange(1, num_iterations+1):
41            self.quick_test_package_update_iteration(iter)
42            self.sa_sanity_batch_run()
43            self.cl_sanity_batch_run()
44            self.le_sanity_batch_run()
45            self.quick_test_print_summary()
46
47        # End and cleanup test package
48        self.quick_test_package_end()
49        self.quick_test_cleanup()
50