From 0dee3a0a5d379d461dec009aa29f9b2d98f46b25 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 26 Apr 2014 16:01:52 +0300 Subject: [PATCH] tests: Make INTERWORKING_SELECT tests more robust It is possible for a scan to fail to see Probe Response or Beacon frame under heavy load (e.g., during a parallel-vm.sh test run) since the dwell time on a chanenl is quite short. Make the test cases using INTERWORKING_SELECT more robust by trying again if the first attempt does not find a matching BSS. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_hs20.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index e542bb67a..a0a5c1125 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -67,7 +67,15 @@ def interworking_select(dev, bssid, type=None, no_match=False, freq=None): raise Exception("Unexpected network match") return if "INTERWORKING-NO-MATCH" in ev: - raise Exception("Matching network not found") + logger.info("Matching network not found - try again") + dev.dump_monitor() + dev.request("INTERWORKING_SELECT" + freq_extra) + ev = dev.wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH"], + timeout=15) + if ev is None: + raise Exception("Network selection timed out"); + if "INTERWORKING-NO-MATCH" in ev: + raise Exception("Matching network not found") if bssid and bssid not in ev: raise Exception("Unexpected BSSID in match") if type and "type=" + type not in ev: