]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix nfc_wps_handover_5ghz false negative by using common finalizer
authorMasashi Honma <masashi.honma@gmail.com>
Thu, 30 May 2019 08:05:54 +0000 (17:05 +0900)
committerJouni Malinen <j@w1.fi>
Sun, 2 Jun 2019 14:05:49 +0000 (17:05 +0300)
nfc_wps_handover_5ghz 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_nfc_wps.py

index bf17a858438a36faf3412796fe007b98b1c94f15..74476852bf552aa49df67a63cfa2fd5576ffc307 100644 (file)
@@ -13,7 +13,7 @@ logger = logging.getLogger()
 
 import hwsim_utils
 import hostapd
-from utils import alloc_fail, fail_test
+from utils import alloc_fail, fail_test, clear_regdom
 
 def check_wpa2_connection(sta, ap, hapd, ssid, mixed=False):
     status = sta.get_status()
@@ -306,11 +306,7 @@ def test_nfc_wps_handover_5ghz(dev, apdev):
         dev[0].wait_connected(timeout=30)
         check_wpa2_connection(dev[0], apdev[0], hapd, ssid)
     finally:
-        dev[0].request("DISCONNECT")
-        if hapd:
-            hapd.request("DISABLE")
-        subprocess.call(['iw', 'reg', 'set', '00'])
-        dev[0].flush_scan_cache()
+        clear_regdom(hapd, dev)
 
 def test_nfc_wps_handover_chan14(dev, apdev):
     """Connect to WPS AP with NFC connection handover on channel 14"""