1# Copyright 2020 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 5AUTHOR = 'chromeos-bluetooth' 6NAME = 'bluetooth_AdapterAdvHealth.adv_single_advertising_test' 7PURPOSE = 'Test bluetooth adapter advertising.' 8CRITERIA = 'Adapter should advertise with correct parameters.' 9ATTRIBUTES = 'suite:bluetooth_flaky' 10TIME = 'SHORT' # ~4 minutes on Eve 11MAX_RESULT_SIZE_KB = 128000 12TEST_CATEGORY = 'Functional' 13TEST_CLASS = 'bluetooth' 14TEST_TYPE = 'server' 15DEPENDENCIES = 'bluetooth' 16 17DOC = """ 18This test case verifies that the Bluetooth adapter of the DUT can 19behave as a Bluetooth low-energy device and register a single 20advertisement with data and parameters correctly. This test case also 21verifies that the single advertisement could be registered and 22unregistered continuously. 23 24This autotest include the following test cases: 25 self.test_case_SI200_RA1_CD_UA1() 26 self.test_case_SI200_RA1_CD_RS() 27 self.test_case_RA1_CD_SI200_CD_UA1() 28 self.test_case_RA1_CD_SI200_CD_RS() 29 self.test_case_RA1_CD_SI200_CD_FSI10_UA1_RA1_CD_UA1() 30 self.test_case_RA1_CD_SI200_CD_FSI20000_UA1_RA1_CD_UA1() 31 32Specifically, the subtests included in this autotest verify the 33following operations and parameters. 34 - test_register_advertisement 35 * A single advertisement is registered successfully. 36 * The advertising min/max intervals are set correctly. 37 . The intervals are set to specified values. 38 . The intervals are set to default values after reset. 39 * The manufacturer id is set correctly. 40 * The service UUIDs are set correctly. 41 * The service data is set correctly. 42 * Advertising is enabled consequently. 43 - test_set_advertising_intervals 44 * The new advertising intervals are set correctly. 45 - test_reset_advertising 46 * The single advertisement instance is removed. 47 * Advertising is disabled consequently. 48 49Mnemonics of the test cases: 50 CD: check advertising duration and intervals 51 RA: register advertisements 52 UA: unregister advertisements 53 SI: set advertising intervals 54 RS: reset advertising 55 FRA: fail to register extra advertisements when max ones have 56 been registered. 57 FSI: fail to set advertising intervals beyond legitimate range 58 of [20 ms, 10,240 ms]. 59 PC: power cycle the bluetooth adapter (controller). 60 SR: suspend and resume the DUT (chromebook) 61 62""" 63 64def run(machine): 65 host = hosts.create_host(machine) 66 job.run_test('bluetooth_AdapterAdvHealth', host=host, num_iterations=1, 67 test_name=NAME.split('.')[1], peer_required=False) 68 69parallel_simple(run, machines) 70