diff options
author | Chuanhsiao Tseng <chuanhsiao@google.com> | 2019-02-12 11:33:20 +0800 |
---|---|---|
committer | Vincent Hsieh <vincenthsieh@google.com> | 2019-02-12 06:58:22 +0000 |
commit | d1b25aa73af707c952fe9502ec948ee2a13dd5f0 (patch) | |
tree | e46c7d8414e5c2262a19dd02a61d5c408cf9fa8a | |
parent | a7641e793c5573337bab85deedf554ce530eedb1 (diff) | |
download | platform_tools_test_connectivity-pie-qpr3-b-release.tar.gz platform_tools_test_connectivity-pie-qpr3-b-release.tar.bz2 platform_tools_test_connectivity-pie-qpr3-b-release.zip |
Fix test_max_concurrent_ble_scans_plus_oneandroid-9.0.0_r47android-9.0.0_r45android-9.0.0_r42pie-qpr3-b-release
Fix this test logic error. The verification should confirm that the
(max+1)th ScanCallback whether triggers onScanFailed or not, that is,
the (max+1)th LE scan should not start successfully.
These methods are unnecessary to be called: setting CallbackType, setting
ScanMode and building ScanFilter. Because this test not need to scan LE
advertisement and just verify the (max+1)th LE scan whether fail to start.
Bug: b/115307126
Test: Run SL4A ConcurrentBleScanningTest
Change-Id: I65773fa700486b7157ea85ebc5a35b7d7fcef0af
-rw-r--r-- | acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py b/acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py index 83b5ddc60e..c3e71f24a8 100644 --- a/acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py +++ b/acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py @@ -1,4 +1,4 @@ -#/usr/bin/env python3.4 +#!/usr/bin/env python3 # # Copyright (C) 2016 The Android Open Source Project # @@ -30,7 +30,7 @@ from acts.test_utils.bt.bt_constants import ble_scan_settings_modes from acts.test_utils.bt.bt_constants import adv_succ from acts.test_utils.bt.bt_test_utils import generate_ble_advertise_objects from acts.test_utils.bt.bt_test_utils import reset_bluetooth -from acts.test_utils.bt.bt_test_utils import scan_failed +from acts.test_utils.bt.bt_constants import scan_failed from acts.test_utils.bt.bt_constants import scan_result from acts.test_utils.bt.bt_test_utils import take_btsnoop_logs @@ -205,13 +205,13 @@ class ConcurrentBleScanningTest(BluetoothBaseTest): for callback in scan_callback_list: try: self.scn_ad.ed.pop_event( - scan_result.format(scan_callback), self.default_timeout) + scan_result.format(callback), self.default_timeout) self.log.info( "Found scan event successfully. Iteration {} successful." .format(i)) except Exception: self.log.info("Failed to find a scan result for callback {}" - .format(scan_callback)) + .format(callback)) return False i += 1 for callback in scan_callback_list: @@ -244,12 +244,7 @@ class ConcurrentBleScanningTest(BluetoothBaseTest): Priority: 1 """ test_result = True - self.scn_ad.droid.bleSetScanSettingsCallbackType( - ble_scan_settings_callback_types['all_matches']) - self.scn_ad.droid.bleSetScanSettingsScanMode(ble_scan_settings_modes[ - 'low_latency']) filter_list = self.scn_ad.droid.bleGenFilterList() - self.scn_ad.droid.bleBuildScanFilter(filter_list) scan_settings = self.scn_ad.droid.bleBuildScanSetting() scan_callback_list = [] for i in range(self.max_concurrent_scans): @@ -264,13 +259,13 @@ class ConcurrentBleScanningTest(BluetoothBaseTest): try: self.scn_ad.ed.pop_event( scan_failed.format(scan_callback), self.default_timeout) - self.log.error( - "Unexpected scan event found. Iteration {} successful." - .format(i)) - test_result = False + self.log.info( + "Found scan event successfully. Iteration {} successful." + .format(self.max_concurrent_scans + 1)) except Exception: - self.log.info("No onScanFailed event for callback {} as expected." - .format(scan_callback)) + self.log.error("Failed to find a onScanFailed event for callback {}" + .format(scan_callback)) + test_result = False for callback in scan_callback_list: self.scn_ad.droid.bleStopBleScan(callback) return test_result |