]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix regdom clearing in wnm_bss_tm_scan_needed_e4
authorJouni Malinen <j@w1.fi>
Sat, 1 Apr 2017 11:10:32 +0000 (14:10 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 1 Apr 2017 11:10:32 +0000 (14:10 +0300)
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 <j@w1.fi>
tests/hwsim/test_wnm.py

index 033f1519c48dcc659226efac1d3e5eda6ff2618e..f08a0e2ad7572f6ae7e04dbe0bce9b161a46a904 100644 (file)
@@ -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")