Call the parent's setup_class() before getting LE supported features
AdvertisingSetTest, Bt5ScanTest, PhyTest: Because LE state is disabled
causing to LE supported features cannot be gotten, need to call the
parent's setup_class() before getting LE supported features.
BluetoothBaseTest: Modify the setup_class() due to TypeError occurs if
Bluetooth state is disabled and then it's called.
Bug: 117965905
Test: Run SL4A, BluetoothBaseTest, AdvertisingSetTest, Bt5ScanTest, PhyTest
Change-Id: Ie092757ea99d0885b37a3c90d2ef730b8243a75c
diff --git a/acts/framework/acts/test_utils/bt/BluetoothBaseTest.py b/acts/framework/acts/test_utils/bt/BluetoothBaseTest.py
index 21d63c7..e093307 100644
--- a/acts/framework/acts/test_utils/bt/BluetoothBaseTest.py
+++ b/acts/framework/acts/test_utils/bt/BluetoothBaseTest.py
@@ -131,8 +131,6 @@
return _safe_wrap_test_case
def setup_class(self):
- self.device_selector = get_device_selector_dictionary(
- self.android_devices)
if "reboot_between_test_class" in self.user_params:
threads = []
for a in self.android_devices:
@@ -144,6 +142,8 @@
t.join()
if not setup_multiple_devices_for_bt_test(self.android_devices):
return False
+ self.device_selector = get_device_selector_dictionary(
+ self.android_devices)
if "bluetooth_proto_path" in self.user_params:
from google import protobuf
diff --git a/acts/tests/google/ble/bt5/AdvertisingSetTest.py b/acts/tests/google/ble/bt5/AdvertisingSetTest.py
index 0f0c352..e06536d 100644
--- a/acts/tests/google/ble/bt5/AdvertisingSetTest.py
+++ b/acts/tests/google/ble/bt5/AdvertisingSetTest.py
@@ -28,15 +28,15 @@
from acts.test_decorators import test_tracker_info
from acts.test_utils.bt.BluetoothBaseTest import BluetoothBaseTest
from acts.test_utils.bt.bt_constants import ble_scan_settings_modes
-from acts.test_utils.bt.bt_test_utils import advertising_set_started
-from acts.test_utils.bt.bt_test_utils import advertising_set_stopped
-from acts.test_utils.bt.bt_test_utils import advertising_set_enabled
-from acts.test_utils.bt.bt_test_utils import advertising_set_data_set
-from acts.test_utils.bt.bt_test_utils import advertising_set_scan_response_set
-from acts.test_utils.bt.bt_test_utils import advertising_set_parameters_update
-from acts.test_utils.bt.bt_test_utils import advertising_set_periodic_parameters_updated
-from acts.test_utils.bt.bt_test_utils import advertising_set_periodic_data_set
-from acts.test_utils.bt.bt_test_utils import advertising_set_periodic_enable
+from acts.test_utils.bt.bt_constants import advertising_set_started
+from acts.test_utils.bt.bt_constants import advertising_set_stopped
+from acts.test_utils.bt.bt_constants import advertising_set_enabled
+from acts.test_utils.bt.bt_constants import advertising_set_data_set
+from acts.test_utils.bt.bt_constants import advertising_set_scan_response_set
+from acts.test_utils.bt.bt_constants import advertising_set_parameters_update
+from acts.test_utils.bt.bt_constants import advertising_set_periodic_parameters_updated
+from acts.test_utils.bt.bt_constants import advertising_set_periodic_data_set
+from acts.test_utils.bt.bt_constants import advertising_set_periodic_enable
from acts.test_utils.bt.bt_test_utils import reset_bluetooth
from acts import signals
@@ -67,6 +67,7 @@
self.adv_ad = self.android_devices[0]
def setup_class(self):
+ super(AdvertisingSetTest, self).setup_class()
if not self.adv_ad.droid.bluetoothIsLeExtendedAdvertisingSupported():
raise signals.TestSkipClass(
"Advertiser does not support LE Extended Advertising")
diff --git a/acts/tests/google/ble/bt5/Bt5ScanTest.py b/acts/tests/google/ble/bt5/Bt5ScanTest.py
index 633489f..a07769e 100644
--- a/acts/tests/google/ble/bt5/Bt5ScanTest.py
+++ b/acts/tests/google/ble/bt5/Bt5ScanTest.py
@@ -28,14 +28,14 @@
from acts.test_utils.bt.BluetoothBaseTest import BluetoothBaseTest
from acts.test_utils.bt.bt_constants import ble_scan_settings_phys
from acts.test_utils.bt.bt_constants import ble_scan_settings_modes
-from acts.test_utils.bt.bt_test_utils import batch_scan_result
+from acts.test_utils.bt.bt_constants import batch_scan_result
from acts.test_utils.bt.bt_test_utils import cleanup_scanners_and_advertisers
from acts.test_utils.bt.bt_test_utils import generate_ble_advertise_objects
from acts.test_utils.bt.bt_test_utils import generate_ble_scan_objects
from acts.test_utils.bt.bt_test_utils import reset_bluetooth
from acts.test_utils.bt.bt_constants import scan_result
-from acts.test_utils.bt.bt_test_utils import advertising_set_on_own_address_read
-from acts.test_utils.bt.bt_test_utils import advertising_set_started
+from acts.test_utils.bt.bt_constants import advertising_set_on_own_address_read
+from acts.test_utils.bt.bt_constants import advertising_set_started
from acts import signals
@@ -66,6 +66,7 @@
self.adv_ad = self.android_devices[1]
def setup_class(self):
+ super(Bt5ScanTest, self).setup_class()
if not self.scn_ad.droid.bluetoothIsLeExtendedAdvertisingSupported():
raise signals.TestSkipClass(
"Scanner does not support LE Extended Advertising")
diff --git a/acts/tests/google/ble/bt5/PhyTest.py b/acts/tests/google/ble/bt5/PhyTest.py
index 5af778d..b892d26 100644
--- a/acts/tests/google/ble/bt5/PhyTest.py
+++ b/acts/tests/google/ble/bt5/PhyTest.py
@@ -40,6 +40,7 @@
class PhyTest(GattConnectedBaseTest):
def setup_class(self):
+ super(PhyTest, self).setup_class()
if not self.cen_ad.droid.bluetoothIsLe2MPhySupported():
raise signals.TestSkipClass(
"Central device does not support LE 2M PHY")