From: Jouni Malinen Date: Sun, 13 Apr 2014 21:53:27 +0000 (+0300) Subject: tests: Work around invalid ap_wps_ie_fragmentation failures X-Git-Tag: hostap_2_2~265 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf3f0ec81cb38234a086ea2ccd11c1975eac8505;p=thirdparty%2Fhostap.git tests: Work around invalid ap_wps_ie_fragmentation failures This can fail if Probe Response frame is missed and Beacon frame was used to fill in the BSS entry. This can happen, e.g., during heavy load every now and then and is not really an error, so try to workaround by runnign another scan. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index f8e6c63cc..3a1a4265c 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -1223,8 +1223,17 @@ def test_ap_wps_ie_fragmentation(dev, apdev): raise Exception("Association with the AP timed out") bss = dev[0].get_bss(apdev[0]['bssid']) if "wps_device_name" not in bss or bss['wps_device_name'] != "1234567890abcdef1234567890abcdef": + logger.info("Device Name not received correctly") logger.info(bss) - raise Exception("Device Name not received correctly") + # This can fail if Probe Response frame is missed and Beacon frame was + # used to fill in the BSS entry. This can happen, e.g., during heavy + # load every now and then and is not really an error, so try to + # workaround by runnign another scan. + dev[0].scan(freq="2412", only_new=True) + bss = dev[0].get_bss(apdev[0]['bssid']) + if "wps_device_name" not in bss or bss['wps_device_name'] != "1234567890abcdef1234567890abcdef": + logger.info(bss) + raise Exception("Device Name not received correctly") if len(re.findall("dd..0050f204", bss['ie'])) != 2: raise Exception("Unexpected number of WPS IEs")