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