From: Jouni Malinen Date: Sat, 1 Apr 2017 11:10:32 +0000 (+0300) Subject: tests: Fix regdom clearing in wnm_bss_tm_scan_needed_e4 X-Git-Tag: hostap_2_7~1407 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e947f32b4140a81d878ac09afb096e624f867a4;p=thirdparty%2Fhostap.git tests: Fix regdom clearing in wnm_bss_tm_scan_needed_e4 It was possible for the cfg80211 regulatory code to get confused if the disconnection and user hint to set country code to 00 happened immediately after the BTM-initiated roam. The country IE update seemed to be performed just before the 00 user hint and that resulted in cfg80211 intersecting the regulatory domains instead of clearing to 00. This resulted in the following test cases being unable to set the country code. This happened with the following test case sequence: wnm_bss_tm_scan_needed_e4 wnm_bss_tm_scan_not_needed Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_wnm.py b/tests/hwsim/test_wnm.py index 033f1519c..f08a0e2ad 100644 --- a/tests/hwsim/test_wnm.py +++ b/tests/hwsim/test_wnm.py @@ -926,6 +926,14 @@ def test_wnm_bss_tm_scan_needed_e4(dev, apdev): if "status_code=0" not in ev: raise Exception("BSS transition request was not accepted: " + ev) dev[0].wait_connected(timeout=15, error="No reassociation seen") + # Wait for regdom change due to country IE to avoid issues with that + # processing happening only after the disconnection and cfg80211 ending + # up intersecting regdoms when we try to clear state back to world (00) + # regdom below. + while True: + ev = dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5) + if not ev or "COUNTRY_IE" in ev: + break dev[0].dump_monitor() finally: dev[0].request("REMOVE_NETWORK all")