• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2017 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
6from autotest_lib.server.cros.bluetooth import advertisements_data
7
8
9AUTHOR = 'rjahagir'
10NAME = 'bluetooth_AdapterLEAdvertising.suspend_resume'
11PURPOSE = 'Test bluetooth adapter advertising.'
12CRITERIA = 'Adapter should advertise with correct parameters.'
13ATTRIBUTES = 'suite:bluetooth, suite:bluetooth_sanity'
14TIME = 'SHORT'  # Takes approximately 5 minutes on elm
15TEST_CATEGORY = 'Functional'
16TEST_CLASS = 'bluetooth'
17TEST_TYPE = 'server'
18DEPENDENCIES = 'bluetooth'
19
20DOC = """
21This test case verifies that the Bluetooth adapter of the DUT can
22behave as a Bluetooth low-energy device and register advertisement
23with data and parameters while suspending and resuming correctly.
24
25This autotest include the following test cases:
26     self.test_case_SI200_RA3_CD_SR_CD_UA3()
27     self.test_case_RA3_CD_SI200_CD_SR_CD_UA3()
28     self.test_case_SI200_RA1_CD_SR_CD_UA1()
29     self.test_case_RA1_CD_SI200_CD_SR_CD_UA1()
30
31Specifically, the subtests included in this autotest verify the
32following operations and parameters.
33    - test_register_advertisement
34      * A single advertisement is registered successfully.
35      * The advertising min/max intervals are set correctly.
36        . The intervals are set to specified values.
37        . The intervals are set to default values after reset.
38      * The manufacturer id is set correctly.
39      * The service UUIDs are set correctly.
40      * The service data is set correctly.
41      * Advertising is enabled consequently.
42    - test_set_advertising_intervals
43      * The new advertising intervals are set correctly.
44    - test_reset_advertising
45      * The single advertisement instance is removed.
46      * Advertising is disabled consequently.
47
48Mnemonics of the test cases:
49    CD: check advertising duration and intervals
50    RA: register advertisements
51    UA: unregister advertisements
52    SI: set advertising intervals
53    RS: reset advertising
54    FRA: fail to register extra advertisements when max ones have
55         been registered.
56    FSI: fail to set advertising intervals beyond legitimate range
57         of [20 ms, 10,240 ms].
58    PC: power cycle the bluetooth adapter (controller).
59    SR: suspend and resume the DUT (chromebook)
60
61"""
62
63args_dict = utils.args_to_dict(args)
64
65def run(machine):
66    host = hosts.create_host(machine)
67    job.run_test('bluetooth_AdapterLEAdvertising', host=host,
68                 advertisements=advertisements_data.ADVERTISEMENTS,
69                 test_type='suspend_resume')
70
71parallel_simple(run, machines)
72