tests: Make ap_wps_pbc_overlap_2* less likely to cause issues

Both of these test cases were leaving out BSS entries with active PBC
mode at the end of the test. This could result in the next text case
failing, e.g., in "ap_wps_pbc_overlap_2ap grpform_ext_listen" and
"ap_wps_pbc_overlap_2sta grpform_ext_listen" sequences. Fix this by
flushing the scan results more carefully at the end of the PBC overlap
test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-06-18 21:59:05 +03:00
parent 9f622398e4
commit 492c3a9180

View file

@ -757,6 +757,9 @@ def test_ap_wps_pbc_overlap_2ap(dev, apdev):
ev = dev[0].wait_event(["WPS-OVERLAP-DETECTED"], timeout=15) ev = dev[0].wait_event(["WPS-OVERLAP-DETECTED"], timeout=15)
if ev is None: if ev is None:
raise Exception("PBC session overlap not detected") raise Exception("PBC session overlap not detected")
hapd.request("DISABLE")
hapd2.request("DISABLE")
dev[0].flush_scan_cache()
def test_ap_wps_pbc_overlap_2sta(dev, apdev): def test_ap_wps_pbc_overlap_2sta(dev, apdev):
"""WPS PBC session overlap with two active STAs""" """WPS PBC session overlap with two active STAs"""
@ -779,15 +782,22 @@ def test_ap_wps_pbc_overlap_2sta(dev, apdev):
raise Exception("PBC session overlap not detected (dev0)") raise Exception("PBC session overlap not detected (dev0)")
if "config_error=12" not in ev: if "config_error=12" not in ev:
raise Exception("PBC session overlap not correctly reported (dev0)") raise Exception("PBC session overlap not correctly reported (dev0)")
dev[0].request("WPS_CANCEL")
dev[0].request("DISCONNECT")
ev = dev[1].wait_event(["WPS-M2D"], timeout=15) ev = dev[1].wait_event(["WPS-M2D"], timeout=15)
if ev is None: if ev is None:
raise Exception("PBC session overlap not detected (dev1)") raise Exception("PBC session overlap not detected (dev1)")
if "config_error=12" not in ev: if "config_error=12" not in ev:
raise Exception("PBC session overlap not correctly reported (dev1)") raise Exception("PBC session overlap not correctly reported (dev1)")
dev[1].request("WPS_CANCEL")
dev[1].request("DISCONNECT")
hapd.request("WPS_CANCEL") hapd.request("WPS_CANCEL")
ret = hapd.request("WPS_PBC") ret = hapd.request("WPS_PBC")
if "FAIL" not in ret: if "FAIL" not in ret:
raise Exception("PBC mode allowed to be started while PBC overlap still active") raise Exception("PBC mode allowed to be started while PBC overlap still active")
hapd.request("DISABLE")
dev[0].flush_scan_cache()
dev[1].flush_scan_cache()
def test_ap_wps_cancel(dev, apdev): def test_ap_wps_cancel(dev, apdev):
"""WPS AP cancelling enabled config method""" """WPS AP cancelling enabled config method"""