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.single' 11 PURPOSE = 'Test bluetooth adapter advertising.' 12 CRITERIA = 'Adapter should advertise with correct parameters.' 13 ATTRIBUTES = 'suite:bluetooth' 14 TIME = 'SHORT' 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 a single 23 advertisement with data and parameters correctly. This test case also 24 verifies that the single advertisement could be registered and 25 unregistered continuously. 26 27 Specifically, the subtests included in this autotest verify the 28 following operations and parameters. 29 - test_register_advertisement 30 * A single advertisement is registered successfully. 31 * The advertising min/max intervals are set correctly. 32 . The intervals are set to specified values. 33 . The intervals are set to default values after reset. 34 * The manufacturer id is set correctly. 35 * The service UUIDs are set correctly. 36 * The service data is set correctly. 37 * Advertising is enabled consequently. 38 - test_set_advertising_intervals 39 * The new advertising intervals are set correctly. 40 - test_reset_advertising 41 * The single advertisement instance is removed. 42 * Advertising is disabled consequently. 43 """ 44 45 46 MIN_ADV_INTERVAL_MS = 300 47 MAX_ADV_INTERVAL_MS = 400 48 49 50 args_dict = utils.args_to_dict(args) 51 52 def run(machine): 53 host = hosts.create_host(machine) 54 job.run_test('bluetooth_AdapterLEAdvertising', host=host, 55 advertisements=advertisements_data.ADVERTISEMENTS, 56 multi_advertising=False, 57 min_adv_interval_ms=MIN_ADV_INTERVAL_MS, 58 max_adv_interval_ms=MAX_ADV_INTERVAL_MS) 59 60 parallel_simple(run, machines) 61