]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix wpas_ap_async_fail false negative by using common finalizer
authorMasashi Honma <masashi.honma@gmail.com>
Thu, 30 May 2019 08:05:55 +0000 (17:05 +0900)
committerJouni Malinen <j@w1.fi>
Sun, 2 Jun 2019 14:05:49 +0000 (17:05 +0300)
wpas_ap_async_fail fails with this message.

---------------
wlan0: Country code not reset back to 00: is FI
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
tests/hwsim/test_wpas_ap.py
tests/hwsim/utils.py

index 102edbc0d142672f3b840ba43b8044bc1a3fdf4e..85074974aa8fe60efe1153622c57f1a16b932c0b 100644 (file)
@@ -10,7 +10,7 @@ import logging
 logger = logging.getLogger()
 
 import hwsim_utils
-from utils import HwsimSkip, alloc_fail
+from utils import HwsimSkip, alloc_fail, clear_regdom_dev
 from wpasupplicant import WpaSupplicant
 from test_p2p_channel import set_country
 
@@ -761,5 +761,4 @@ def test_wpas_ap_async_fail(dev):
             dev[0].select_network(id)
             dev[0].wait_disconnected()
     finally:
-        set_country("00")
-        dev[0].set("country", "00")
+        clear_regdom_dev(dev)
index 1044e9180f57790992788df5e5f4984da7942b72..868537527904ab148ee918394d11582b18b55409 100644 (file)
@@ -151,6 +151,9 @@ def clear_regdom(hapd, dev, count=1):
     if hapd:
         hapd.request("DISABLE")
         time.sleep(0.1)
+    clear_regdom_dev(dev, count)
+
+def clear_regdom_dev(dev, count=1):
     for i in range(count):
         dev[i].request("DISCONNECT")
     for i in range(count):