Minor cleanup
Change-Id: I0cc37afb0cfa2f8b95da708b9e15b8197471fe14
(cherry picked from commit ad4edd6ab78a5d1f2a71a4275038ef9651934392)
diff --git a/acts/tests/google/ble/system_tests/BleStressTest.py b/acts/tests/google/ble/system_tests/BleStressTest.py
index bfc7caa..79f5a4a 100644
--- a/acts/tests/google/ble/system_tests/BleStressTest.py
+++ b/acts/tests/google/ble/system_tests/BleStressTest.py
@@ -52,6 +52,16 @@
self.log.debug(pprint.pformat(event))
return test_result
+ def _verify_successful_bond(self, target_address):
+ end_time = time.time() + self.PAIRING_TIMEOUT
+ self.log.info("Verifying devices are bonded")
+ while time.time() < end_time:
+ bonded_devices = self.scn_ad.droid.bluetoothGetBondedDevices()
+ if target_address in {d['address'] for d in bonded_devices}:
+ self.log.info("Successfully bonded to device")
+ return True
+ return False
+
@BluetoothBaseTest.bt_test_wrap
def test_loop_scanning_1000(self):
"""Stress start/stop scan instances.
@@ -271,19 +281,6 @@
scan_callback)
return test_result
- def _verify_successful_bond(self, target_address):
- end_time = time.time() + self.PAIRING_TIMEOUT
- self.log.info("Verifying devices are bonded")
- while time.time() < end_time:
- bonded_devices = self.scn_ad.droid.bluetoothGetBondedDevices()
- if target_address in {d['address'] for d in bonded_devices}:
- self.log.info("Successfully bonded to device")
- return True
- return False
-
- def _get_time_in_milliseconds(self):
- return int(round(time.time() * 1000))
-
@BluetoothBaseTest.bt_test_wrap
def test_le_pairing(self):
"""Test LE pairing transport stress
diff --git a/acts/tests/google/bt/pan/BtPanTest.py b/acts/tests/google/bt/pan/BtPanTest.py
index b86c4f3..26e9bcc 100644
--- a/acts/tests/google/bt/pan/BtPanTest.py
+++ b/acts/tests/google/bt/pan/BtPanTest.py
@@ -29,6 +29,7 @@
from queue import Empty
import time
+
class BtPanTest(BluetoothBaseTest):
def __init__(self, controllers):
BluetoothBaseTest.__init__(self, controllers)
@@ -89,7 +90,10 @@
TAGS: Classic, PAN, tethering
Priority: 1
"""
- orchestrate_and_verify_pan_connection(self.pan_dut, self.panu_dut)
+ if not orchestrate_and_verify_pan_connection(self.pan_dut,
+ self.panu_dut):
+ self.log.error("Could not establish a PAN connection.")
+ return False
self.pan_dut.droid.bluetoothPanSetBluetoothTethering(False)
if verify_http_connection(self.log, self.panu_dut):
self.log.error("PANU device still has internet access.")