[PATCH 2/4] tests: Fix ap_vht80c/d false negative by using common finalizer

Masashi Honma masashi.honma at gmail.com
Wed Jun 5 22:27:38 PDT 2019


ap_vht80c/d 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 at gmail.com>
---
 tests/hwsim/test_ap_vht.py | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/tests/hwsim/test_ap_vht.py b/tests/hwsim/test_ap_vht.py
index 3fb7672..3baf55d 100644
--- a/tests/hwsim/test_ap_vht.py
+++ b/tests/hwsim/test_ap_vht.py
@@ -150,31 +150,27 @@ def vht80_test(apdev, dev, channel, ht_capab):
         hapd = hostapd.add_ap(apdev, params)
         bssid = apdev['bssid']
 
-        dev.connect("vht", key_mgmt="NONE", scan_freq=str(5000 + 5 * channel))
-        hwsim_utils.test_connectivity(dev, hapd)
+        dev[0].connect("vht", key_mgmt="NONE", scan_freq=str(5000 + 5 * channel))
+        hwsim_utils.test_connectivity(dev[0], hapd)
     except Exception as e:
         if isinstance(e, Exception) and str(e) == "AP startup failed":
             if not vht_supported():
                 raise HwsimSkip("80 MHz channel not supported in regulatory information")
         raise
     finally:
-        dev.request("DISCONNECT")
-        if hapd:
-            hapd.request("DISABLE")
-        subprocess.call(['iw', 'reg', 'set', '00'])
-        dev.flush_scan_cache()
+        clear_regdom(hapd, dev)
 
 def test_ap_vht80b(dev, apdev):
     """VHT with 80 MHz channel width (HT40- channel 40)"""
-    vht80_test(apdev[0], dev[0], 40, "[HT40-]")
+    vht80_test(apdev[0], dev, 40, "[HT40-]")
 
 def test_ap_vht80c(dev, apdev):
     """VHT with 80 MHz channel width (HT40+ channel 44)"""
-    vht80_test(apdev[0], dev[0], 44, "[HT40+]")
+    vht80_test(apdev[0], dev, 44, "[HT40+]")
 
 def test_ap_vht80d(dev, apdev):
     """VHT with 80 MHz channel width (HT40- channel 48)"""
-    vht80_test(apdev[0], dev[0], 48, "[HT40-]")
+    vht80_test(apdev[0], dev, 48, "[HT40-]")
 
 def test_ap_vht80_params(dev, apdev):
     """VHT with 80 MHz channel width and number of optional features enabled"""
-- 
2.7.4




More information about the Hostap mailing list