]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Wait for regdom events in wpas_config_file
authorJouni Malinen <j@w1.fi>
Sat, 9 Dec 2023 15:20:02 +0000 (17:20 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 9 Dec 2023 17:02:38 +0000 (19:02 +0200)
Make sure the pending regdom changes are processed before returning to
avoid some potential race conditions.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wpas_config.py

index 9bae4deb8d8b815702006a49fc164070d98cc236..631669617c197d2e02ad5f61d1589de7bb272a9d 100644 (file)
@@ -297,6 +297,16 @@ def test_wpas_config_file(dev, apdev, params):
         wpas.request("SET country 00")
         wpas.wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=1)
 
+    country = False
+    for i in range(5):
+        ev = dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=1)
+        if ev is None:
+            break
+        if "alpha2=FI" in ev:
+            country = True
+        if country and "type=WORLD":
+            break
+
 def test_wpas_config_file_wps(dev, apdev):
     """wpa_supplicant config file parsing/writing with WPS"""
     config = "/tmp/test_wpas_config_file.conf"