]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix scan_specific_bssid in case Beacon frame is seen
authorJouni Malinen <jouni@codeaurora.org>
Tue, 12 Mar 2019 14:36:46 +0000 (16:36 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 12 Mar 2019 14:36:46 +0000 (16:36 +0200)
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 <jouni@codeaurora.org>
tests/hwsim/test_scan.py

index 571079ea4f96b48bea08a81a85578590aecb3d73..1c46ae5a3912f0dc5083b80a5e4b15aa34ef1976 100644 (file)
@@ -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")