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 5 from autotest_lib.server import utils 6 from autotest_lib.server.cros.bluetooth import advertisements_data 7 8 9 AUTHOR = 'rjahagir' 10 NAME = 'bluetooth_AdapterLEAdvertising.suspend_resume.stress_50' 11 PURPOSE = 'Test bluetooth adapter advertising.' 12 CRITERIA = 'Adapter should advertise with correct parameters.' 13 ATTRIBUTES = 'suite:bluetooth, suite:bluetooth_stress' 14 TIME = 'SHORT' # Takes approximately 4 hours on elm 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 advertisement 23 with data and parameters while suspending and resuming correctly multiple times. 24 25 This 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 31 Specifically, the subtests included in this autotest verify the 32 following 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 48 Mnemonics 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 63 args_dict = utils.args_to_dict(args) 64 65 def 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', num_iterations=50) 70 71 parallel_simple(run, machines) 72