Home | History | Annotate | Download | only in bluetooth_AdapterLEAdvertising
      1 # Copyright 2016 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 from autotest_lib.server import utils
      6 from autotest_lib.server.cros.bluetooth import advertisements_data
      7 
      8 
      9 AUTHOR = 'chromeos-chameleon'
     10 NAME = 'bluetooth_AdapterLEAdvertising.multiple'
     11 PURPOSE = 'Test bluetooth adapter advertising.'
     12 CRITERIA = 'Adapter should advertise with correct parameters.'
     13 ATTRIBUTES = 'suite:bluetooth, suite:bluetooth_sanity'
     14 TIME = 'SHORT'  # It takes about 15 minutes on a Samus.
     15 TEST_CATEGORY = 'Functional'
     16 TEST_CLASS = 'bluetooth'
     17 TEST_TYPE = 'server'
     18 DEPENDENCIES = 'bluetooth'
     19 
     20 DOC = """
     21 This test case verifies that the Bluetooth adapter of the DUT can
     22 behave as a Bluetooth low-energy device and register multiple
     23 advertisements with data and parameters correctly. This test case also
     24 verifies that advertisements could be registered and unregistered
     25 continuously.
     26 
     27 Specifically, this autotest include the following test cases:
     28     self.test_case_SI200_RA3_CD_UA3()
     29     self.test_case_SI200_RA3_CD_RA1_CD_UA1_CD_UA3()
     30     self.test_case_SI200_RA3_CD_RS()
     31     self.test_case_SI200_RA3_CD_UA1_CD_RS()
     32     self.test_case_SI200_RA3_CD_UA1_CD_RA2_CD_UA4()
     33     self.test_case_SI200_RA5_CD_FRA1_CD_UA5()
     34     self.test_case_RA3_CD_SI200_CD_UA3()
     35     self.test_case_RA3_CD_SI200_CD_RS()
     36     self.test_case_RA3_CD_SI200_CD_UA1_CD_RS()
     37     self.test_case_RA3_CD_SI200_CD_SI2000_CD_UA3()
     38     self.test_case_RA5_CD_SI200_CD_FRA1_CD_UA5()
     39     self.test_case_RA3_CD_SI200_CD_FSI10_CD_FSI20000_CD_UA3()
     40 
     41 
     42 Mnemonics of the test cases:
     43     CD: check advertising duration and intervals
     44     RA: register advertisements
     45     UA: unregister advertisements
     46     SI: set advertising intervals
     47     RS: reset advertising
     48     FRA: fail to register extra advertisements when max ones have
     49          been registered.
     50     FSI: fail to set advertising intervals beyond legitimate range
     51          of [20 ms, 10,240 ms].
     52     PC: power cycle the bluetooth adapter (controller).
     53     SR: suspend and resume the DUT (chromebook)
     54 
     55 
     56 Every test case consists of a sequence of tests:
     57     test_register_advertisement
     58       * All advertisements are registered successfully.
     59       * The advertising min/max intervals are set correctly.
     60         . The intervals are set to specified values.
     61         . The intervals are set to default values after reset.
     62       * The manufacturer id is set correctly.
     63       * The service UUIDs are set correctly.
     64       * The service data is set correctly.
     65       * Advertising is enabled consequently.
     66     test_set_advertising_intervals
     67       * The new advertising intervals are set correctly.
     68     test_reset_advertising
     69       * All advertisement instances are removed.
     70       * Advertising is disabled consequently.
     71     test_check_duration_and_intervals
     72       * The duration is correct.
     73       * The new advertising intervals are set correctly.
     74     test_fail_to_register_advertisement
     75       * Max advertisements reached error.
     76       * Extra advertisement is not added.
     77       * The advertising min/max intervals remain the same.
     78       * Advertising remains enabled.
     79     test_unregister_advertisement
     80       * The advertisement is removed.
     81       * Advertising is disabled when the last one is removed.
     82     test_fail_to_set_advertising_intervals
     83       * It incurs invalid interval error.
     84       * The advertising min/max intervals remain the same.
     85 """
     86 
     87 
     88 args_dict = utils.args_to_dict(args)
     89 
     90 def run(machine):
     91     host = hosts.create_host(machine)
     92     job.run_test('bluetooth_AdapterLEAdvertising',
     93                  host=host,
     94                  advertisements=advertisements_data.ADVERTISEMENTS,
     95                  test_type='multi_advertising')
     96 
     97 parallel_simple(run, machines)
     98