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.reboot.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. 24 25 This autotest include the following test cases: 26 self.test_case_SI200_RA3_CD_PC_CD_UA3() 27 self.test_case_RA3_CD_SI200_CD_PC_CD_UA3() 28 self.test_case_RA1_CD_SI200_CD_PC_CD_UA1() 29 30 Specifically, the subtests included in this autotest verify the 31 following operations and parameters. 32 - test_register_advertisement 33 * A single advertisement is registered successfully. 34 * The advertising min/max intervals are set correctly. 35 . The intervals are set to specified values. 36 . The intervals are set to default values after reset. 37 * The manufacturer id is set correctly. 38 * The service UUIDs are set correctly. 39 * The service data is set correctly. 40 * Advertising is enabled consequently. 41 - test_set_advertising_intervals 42 * The new advertising intervals are set correctly. 43 - test_reset_advertising 44 * The single advertisement instance is removed. 45 * Advertising is disabled consequently. 46 47 Mnemonics of the test cases: 48 CD: check advertising duration and intervals 49 RA: register advertisements 50 UA: unregister advertisements 51 SI: set advertising intervals 52 RS: reset advertising 53 FRA: fail to register extra advertisements when max ones have 54 been registered. 55 FSI: fail to set advertising intervals beyond legitimate range 56 of [20 ms, 10,240 ms]. 57 PC: power cycle the bluetooth adapter (controller). 58 SR: suspend and resume the DUT (chromebook) 59 60 """ 61 62 args_dict = utils.args_to_dict(args) 63 64 def run(machine): 65 host = hosts.create_host(machine) 66 job.run_test('bluetooth_AdapterLEAdvertising', host=host, 67 advertisements=advertisements_data.ADVERTISEMENTS, 68 test_type='reboot', num_iterations=50) 69 70 parallel_simple(run, machines) 71