Modify BleOpportunisticScanTest:test_discover_opportunistic_scan_result_off_secondary_scan_filter
This test case had a bad assumption. Starting opportunistic scan and
non-opportunistic filtered scan should result with only filtered scan
results returned from controller. Having opportunistic scan running should
not impact filter.
Bug: 78533856
Test: sl4a BleOpportunisticScanTest
Change-Id: Ie7aa5d3257d947da07aa4644b21103a9de470c31
(cherry picked from commit 5793209d66364e0b16d81a49889d31b7b546309d)
diff --git a/acts/tests/google/ble/scan/BleOpportunisticScanTest.py b/acts/tests/google/ble/scan/BleOpportunisticScanTest.py
index e907cbb..9803648 100644
--- a/acts/tests/google/ble/scan/BleOpportunisticScanTest.py
+++ b/acts/tests/google/ble/scan/BleOpportunisticScanTest.py
@@ -524,9 +524,9 @@
self):
"""Test opportunistic scan result from secondary scan filter.
- Tests opportunistic scan where the secondary scan instance does not find
- an advertisement but the scan instance with scan mode set to
- opportunistic scan will find an advertisement.
+ Tests opportunistic scan where the filtered scan instance does not find
+ an advertisement and the scan instance with scan mode set to
+ opportunistic scan will also not find an advertisement.
Steps:
1. Initialize advertiser and start advertisement on dut1 (make sure the
@@ -539,6 +539,7 @@
6. Pop onScanResults from the second scanner
7. Expect no events
8. Pop onScanResults from the first scanner
+ 9. Expect no events
Expected Result:
Opportunistic scan instance finds an advertisement.
@@ -573,11 +574,7 @@
if not self._verify_no_events_found(
scan_result.format(scan_callback2)):
return False
- try:
- self.scn_ad.ed.pop_event(
- scan_result.format(scan_callback), self.default_timeout)
- except Empty:
- self.log.error("Opportunistic scan found no scan results.")
+ if not self._verify_no_events_found(scan_result.format(scan_callback)):
return False
return True