blob: d18aa6ae1fe1dcab2a547516da57fe65e3565464 [file] [log] [blame]
# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This test case verifies that the Bluetooth adapter of the DUT can
# behave as a Bluetooth low-energy device and register multiple
# advertisements with data and parameters correctly. This test case also
# verifies that advertisements could be registered and unregistered
# continuously.
#
# Specifically, this autotest include the following test cases:
# self.test_case_SI200_RA3_CD_UA3()
# self.test_case_SI200_RA3_CD_RA1_CD_UA1_CD_UA3()
# self.test_case_SI200_RA3_CD_RS()
# self.test_case_SI200_RA3_CD_UA1_CD_RS()
# self.test_case_SI200_RA3_CD_UA1_CD_RA2_CD_UA4()
# self.test_case_SI200_RA5_CD_FRA1_CD_UA5()
# self.test_case_RA3_CD_SI200_CD_UA3()
# self.test_case_RA3_CD_SI200_CD_RS()
# self.test_case_RA3_CD_SI200_CD_UA1_CD_RS()
# self.test_case_RA3_CD_SI200_CD_SI2000_CD_UA3()
# self.test_case_RA5_CD_SI200_CD_FRA1_CD_UA5()
# self.test_case_RA3_CD_SI200_CD_FSI10_CD_FSI20000_CD_UA3()
#
#
# Mnemonics of the test cases:
# CD: check advertising duration and intervals
# RA: register advertisements
# UA: unregister advertisements
# SI: set advertising intervals
# RS: reset advertising
# FRA: fail to register extra advertisements when max ones have
# been registered.
# FSI: fail to set advertising intervals beyond legitimate range
# of [20 ms, 10,240 ms].
# PC: power cycle the bluetooth adapter (controller).
# SR: suspend and resume the DUT (chromebook)
#
#
# Every test case consists of a sequence of tests:
# test_register_advertisement
# * All advertisements are registered successfully.
# * The advertising min/max intervals are set correctly.
# . The intervals are set to specified values.
# . The intervals are set to default values after reset.
# * The manufacturer id is set correctly.
# * The service UUIDs are set correctly.
# * The service data is set correctly.
# * Advertising is enabled consequently.
# test_set_advertising_intervals
# * The new advertising intervals are set correctly.
# test_reset_advertising
# * All advertisement instances are removed.
# * Advertising is disabled consequently.
# test_check_duration_and_intervals
# * The duration is correct.
# * The new advertising intervals are set correctly.
# test_fail_to_register_advertisement
# * Max advertisements reached error.
# * Extra advertisement is not added.
# * The advertising min/max intervals remain the same.
# * Advertising remains enabled.
# test_unregister_advertisement
# * The advertisement is removed.
# * Advertising is disabled when the last one is removed.
# test_fail_to_set_advertising_intervals
# * It incurs invalid interval error.
# * The advertising min/max intervals remain the same.
#
# Purpose: Test bluetooth adapter advertising.
# Deprecated variables:
# TIME = 'LONG' # It takes about 15 minutes on Eve.
# TEST_CATEGORY = 'Functional'
NAME = 'bluetooth_AdapterAdvHealth.adv_multiple_advertising_test'
METADATA = {
'contacts': ['chromeos-bt-team@google.com'],
# ChromeOS > Platform > Connectivity > Bluetooth
'bug_component': 'b:167317',
'criteria': 'Adapter should advertise with correct parameters.',
'hw_agnostic': False,
'variant_category': '{"name": "BT_Chipset_Kernel"}',
'life_cycle_stage': 'owner_monitored',
'requirements': ['bt-gen-0001-v01'],
}
ATTRIBUTES = 'suite:bluetooth_sa2'
MAX_RESULT_SIZE_KB = 512000
TEST_TYPE = 'server'
DEPENDENCIES = 'bluetooth_state:NORMAL'
def run(machine):
host = hosts.create_host(machine)
job.run_test('bluetooth_AdapterAdvHealth', host=host, num_iterations=1,
tag='.'.join(NAME.split('.')[1:]),
test_name=NAME.split('.')[1], peer_required=False)
parallel_simple(run, machines)