]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Move csa_supported() into utils.py
authorJouni Malinen <j@w1.fi>
Sat, 18 Apr 2020 08:31:49 +0000 (11:31 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 18 Apr 2020 08:35:32 +0000 (11:35 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_csa.py
tests/hwsim/test_ap_ht.py
tests/hwsim/test_ap_vht.py
tests/hwsim/test_he.py
tests/hwsim/test_scan.py
tests/hwsim/utils.py

index 2bf9c9a8a7ccf451c5465e1ea8e3aae92b28819a..744d1e1f23ef55720e991ed472c8f7fe26fdf7d3 100644 (file)
@@ -11,7 +11,7 @@ logger = logging.getLogger()
 
 import hwsim_utils
 import hostapd
-from utils import HwsimSkip
+from utils import *
 
 def connect(dev, apdev, scan_freq="2412", **kwargs):
     params = {"ssid": "ap-csa",
@@ -55,13 +55,6 @@ def wait_channel_switch(dev, freq):
     if "freq=%d" % freq not in ev:
         raise Exception("Unexpected frequency: " + ev)
 
-# This function checks whether the provided dev, which may be either
-# WpaSupplicant or Hostapd supports CSA.
-def csa_supported(dev):
-    res = dev.get_driver_status()
-    if (int(res['capa.flags'], 0) & 0x80000000) == 0:
-        raise HwsimSkip("CSA not supported")
-
 @remote_compatible
 def test_ap_csa_1_switch(dev, apdev):
     """AP Channel Switch, one switch"""
index 51187177b4d7dde128aca127c7220aa54e6b6ad1..99adb12a36a407cdd826688e125f00f75dd645d4 100644 (file)
@@ -14,7 +14,6 @@ import hostapd
 from wpasupplicant import WpaSupplicant
 from utils import *
 import hwsim_utils
-from test_ap_csa import csa_supported
 
 def test_ap_ht40_scan(dev, apdev):
     """HT40 co-ex scan"""
index f0e2f3d618285b8ae516fb0aa8085100a744a963..dce0dfff9610c8d71e9eaaa35f233ea509c7da70 100644 (file)
@@ -15,7 +15,6 @@ import hostapd
 from wpasupplicant import WpaSupplicant
 from utils import *
 from test_dfs import wait_dfs_event
-from test_ap_csa import csa_supported
 
 def test_ap_vht80(dev, apdev):
     """VHT with 80 MHz channel width"""
index 22c9402f76a3098a61062b31ac5bc4513b6b8e30..ce31992905a0806d47f0487cdd07654a3140ff3e 100644 (file)
@@ -14,7 +14,6 @@ import hostapd
 from wpasupplicant import WpaSupplicant
 from utils import *
 from test_dfs import wait_dfs_event
-from test_ap_csa import csa_supported
 
 def test_he_open(dev, apdev):
     """HE AP with open mode configuration"""
index ef6ebbaf6056d6571f4aa8b727abc6460cd321a3..9bf7a0fd4ebd13edc59db395038916aa5b9ec2bd 100644 (file)
@@ -17,7 +17,7 @@ import hostapd
 from wpasupplicant import WpaSupplicant
 from utils import *
 from tshark import run_tshark
-from test_ap_csa import switch_channel, wait_channel_switch, csa_supported
+from test_ap_csa import switch_channel, wait_channel_switch
 
 def check_scan(dev, params, other_started=False, test_busy=False):
     if not other_started:
index 5afa76b246acdd39be030565d483e67fc7501fcf..c259a766c0f0b713b8167d5d32136b7f9fda0af4 100644 (file)
@@ -120,6 +120,13 @@ def vht_supported():
         return True
     return False
 
+# This function checks whether the provided dev, which may be either
+# WpaSupplicant or Hostapd supports CSA.
+def csa_supported(dev):
+    res = dev.get_driver_status()
+    if (int(res['capa.flags'], 0) & 0x80000000) == 0:
+        raise HwsimSkip("CSA not supported")
+
 def get_phy(ap, ifname=None):
     phy = "phy3"
     try: