]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Move ERP/FILS capability checks to utils.py
authorJouni Malinen <j@w1.fi>
Sun, 28 Feb 2021 21:15:57 +0000 (23:15 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 28 Feb 2021 21:50:50 +0000 (23:50 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_eap_proto.py
tests/hwsim/test_erp.py
tests/hwsim/test_fils.py
tests/hwsim/test_pasn.py
tests/hwsim/utils.py

index 3401749ded741a0893d92264ff9aaa9c5df71660..dab218dc1c5735caba9d50941efc8f4baeefe83b 100644 (file)
@@ -16,9 +16,8 @@ import threading
 import time
 
 import hostapd
-from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger
+from utils import *
 from test_ap_eap import check_eap_capa, check_hlr_auc_gw_support, int_eap_server_params
-from test_erp import check_erp_capa
 
 try:
     import OpenSSL
index 40fbf2b67b7c9460d17ffbf5d80fd27a55ce8e1e..6ca1259ab1a1eb02f04c13b0347dce06b2436c36 100644 (file)
@@ -11,15 +11,10 @@ import os
 import time
 
 import hostapd
-from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger
+from utils import *
 from test_ap_eap import int_eap_server_params
 from test_ap_psk import find_wpas_process, read_process_memory, verify_not_present, get_key_locations
 
-def check_erp_capa(dev):
-    capab = dev.get_capability("erp")
-    if not capab or 'ERP' not in capab:
-        raise HwsimSkip("ERP not supported in the build")
-
 def test_erp_initiate_reauth_start(dev, apdev):
     """Authenticator sending EAP-Initiate/Re-auth-Start, but ERP disabled on peer"""
     params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
index d867e8fd4137407c7408cfa07eb04012a778faa2..39b48e9808ce55e5e18b35b6b913ecf6616aa9b9 100644 (file)
@@ -18,19 +18,9 @@ from tshark import run_tshark
 from wpasupplicant import WpaSupplicant
 import hwsim_utils
 from utils import *
-from test_erp import check_erp_capa, start_erp_as
+from test_erp import start_erp_as
 from test_ap_hs20 import ip_checksum
 
-def check_fils_capa(dev):
-    capa = dev.get_capability("fils")
-    if capa is None or "FILS" not in capa:
-        raise HwsimSkip("FILS not supported")
-
-def check_fils_sk_pfs_capa(dev):
-    capa = dev.get_capability("fils")
-    if capa is None or "FILS-SK-PFS" not in capa:
-        raise HwsimSkip("FILS-SK-PFS not supported")
-
 def test_fils_sk_full_auth(dev, apdev, params):
     """FILS SK full authentication"""
     check_fils_capa(dev[0])
index 3ee8cf52a639fc9136386579083ffc5a3e64c613..55aee9ef6f9be426944f620c6471e41abd586477 100644 (file)
@@ -19,8 +19,7 @@ import hostapd
 from wpasupplicant import WpaSupplicant
 from utils import *
 from hwsim import HWSimRadio
-from test_erp import check_erp_capa, start_erp_as
-from test_fils import check_fils_capa
+from test_erp import start_erp_as
 from test_ap_ft import run_roams, ft_params1, ft_params2
 
 def check_pasn_capab(dev):
index 3aa7c44973b642db14d34e3c8661114bbbd23155..f35831aa8c0aaba02d0a7c9d71cc00b944f34acf 100644 (file)
@@ -117,6 +117,21 @@ def check_sae_pk_capab(dev):
     if "PK" not in dev.get_capability("sae"):
         raise HwsimSkip("SAE-PK not supported")
 
+def check_erp_capa(dev):
+    capab = dev.get_capability("erp")
+    if not capab or 'ERP' not in capab:
+        raise HwsimSkip("ERP not supported in the build")
+
+def check_fils_capa(dev):
+    capa = dev.get_capability("fils")
+    if capa is None or "FILS" not in capa:
+        raise HwsimSkip("FILS not supported")
+
+def check_fils_sk_pfs_capa(dev):
+    capa = dev.get_capability("fils")
+    if capa is None or "FILS-SK-PFS" not in capa:
+        raise HwsimSkip("FILS-SK-PFS not supported")
+
 def check_tls_tod(dev):
     tls = dev.request("GET tls_library")
     if not tls.startswith("OpenSSL") and not tls.startswith("internal"):