From abaa0893f0861a452f7394b34befecc1d7ed3d63 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 12 Mar 2019 16:36:46 +0200 Subject: [PATCH] tests: Fix scan_specific_bssid in case Beacon frame is seen The first scan for the unknown BSSID could have been timed in a manner that allows passive scanning to find the real AP even if that AP's beacon interval was 1000 (e.g., heavy CPU load changed timing so that the AP beaconing started at suitable time). The check for BSS result entry not including Probe Response frame was comparing incorrect BSS entries (bss2 vs. bss1) which resulted in the test case claiming failure even when there was no unexpected Probe Response frame. Fix this by comparing the beacon_ie and ie parameters from the same BSS entry (bss1). Signed-off-by: Jouni Malinen --- tests/hwsim/test_scan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index 571079ea4..1c46ae5a3 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -1454,7 +1454,7 @@ def test_scan_specific_bssid(dev, apdev): if not bss2: raise Exception("Did not find BSS") - if bss1 and 'beacon_ie' in bss1 and 'ie' in bss1 and bss1['beacon_ie'] != bss2['ie']: + if bss1 and 'beacon_ie' in bss1 and 'ie' in bss1 and bss1['beacon_ie'] != bss1['ie']: raise Exception("First scan for unknown BSSID returned unexpected response") if bss2 and 'beacon_ie' in bss2 and 'ie' in bss2 and bss2['beacon_ie'] == bss2['ie']: raise Exception("Second scan did find Probe Response frame")