params = {}
params['logdir'] = args.logdir
params['long'] = args.long
- res = t(dev, apdev, params)
+ t(dev, apdev, params)
elif t.func_code.co_argcount > 1:
- res = t(dev, apdev)
+ t(dev, apdev)
else:
- res = t(dev)
- if res == "skip":
- result = "SKIP"
- else:
- result = "PASS"
+ t(dev)
+ result = "PASS"
except HwsimSkip, e:
logger.info("Skip test case: %s" % e)
result = "SKIP"
import hwsim_utils
import hostapd
+from utils import HwsimSkip
def check_cipher(dev, ap, cipher):
if cipher not in dev.get_capability("pairwise"):
- return "skip"
+ raise HwsimSkip("Cipher %s not supported" % cipher)
params = { "ssid": "test-wpa2-psk",
"wpa_passphrase": "12345678",
"wpa": "2",
def test_ap_cipher_tkip(dev, apdev):
"""WPA2-PSK/TKIP connection"""
- return check_cipher(dev[0], apdev[0], "TKIP")
+ check_cipher(dev[0], apdev[0], "TKIP")
def test_ap_cipher_tkip_countermeasures_ap(dev, apdev):
"""WPA-PSK/TKIP countermeasures (detected by AP)"""
testfile = "/sys/kernel/debug/ieee80211/%s/netdev:%s/tkip_mic_test" % (dev[0].get_driver_status_field("phyname"), dev[0].ifname)
if not os.path.exists(testfile):
- return "skip"
+ raise HwsimSkip("tkip_mic_test not supported in mac80211")
params = { "ssid": "tkip-countermeasures",
"wpa_passphrase": "12345678",
testfile = "/sys/kernel/debug/ieee80211/%s/netdev:%s/tkip_mic_test" % (hapd.get_driver_status_field("phyname"), apdev[0]['ifname'])
if not os.path.exists(testfile):
- return "skip"
+ raise HwsimSkip("tkip_mic_test not supported in mac80211")
dev[0].connect("tkip-countermeasures", psk="12345678",
pairwise="TKIP", group="TKIP", scan_freq="2412")
def test_ap_cipher_ccmp(dev, apdev):
"""WPA2-PSK/CCMP connection"""
- return check_cipher(dev[0], apdev[0], "CCMP")
+ check_cipher(dev[0], apdev[0], "CCMP")
def test_ap_cipher_gcmp(dev, apdev):
"""WPA2-PSK/GCMP connection"""
- return check_cipher(dev[0], apdev[0], "GCMP")
+ check_cipher(dev[0], apdev[0], "GCMP")
def test_ap_cipher_ccmp_256(dev, apdev):
"""WPA2-PSK/CCMP-256 connection"""
- return check_cipher(dev[0], apdev[0], "CCMP-256")
+ check_cipher(dev[0], apdev[0], "CCMP-256")
def test_ap_cipher_gcmp_256(dev, apdev):
"""WPA2-PSK/GCMP-256 connection"""
- return check_cipher(dev[0], apdev[0], "GCMP-256")
+ check_cipher(dev[0], apdev[0], "GCMP-256")
def test_ap_cipher_mixed_wpa_wpa2(dev, apdev):
"""WPA2-PSK/CCMP/ and WPA-PSK/TKIP mixed configuration"""
import hwsim_utils
import hostapd
+from utils import HwsimSkip
def connect(dev, apdev):
params = { "ssid": "ap-csa",
# WpaSupplicant or Hostapd supports CSA.
def csa_supported(dev):
res = dev.get_driver_status()
- return (int(res['capa.flags'], 0) & 0x80000000) != 0
+ if (int(res['capa.flags'], 0) & 0x80000000) == 0:
+ raise HwsimSkip("CSA not supported")
def test_ap_csa_1_switch(dev, apdev):
"""AP Channel Switch, one switch"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
ap = connect(dev[0], apdev)
hwsim_utils.test_connectivity(dev[0], ap)
def test_ap_csa_2_switches(dev, apdev):
"""AP Channel Switch, two switches"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
ap = connect(dev[0], apdev)
hwsim_utils.test_connectivity(dev[0], ap)
def test_ap_csa_1_switch_count_0(dev, apdev):
"""AP Channel Switch, one switch with count 0"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
ap = connect(dev[0], apdev)
hwsim_utils.test_connectivity(dev[0], ap)
def test_ap_csa_2_switches_count_0(dev, apdev):
"""AP Channel Switch, two switches with count 0"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
ap = connect(dev[0], apdev)
hwsim_utils.test_connectivity(dev[0], ap)
def test_ap_csa_1_switch_count_1(dev, apdev):
"""AP Channel Switch, one switch with count 1"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
ap = connect(dev[0], apdev)
hwsim_utils.test_connectivity(dev[0], ap)
def test_ap_csa_2_switches_count_1(dev, apdev):
"""AP Channel Switch, two switches with count 1"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
ap = connect(dev[0], apdev)
hwsim_utils.test_connectivity(dev[0], ap)
def test_ap_csa_1_switch_count_2(dev, apdev):
"""AP Channel Switch, one switch with count 2"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
ap = connect(dev[0], apdev)
hwsim_utils.test_connectivity(dev[0], ap)
import hwsim_utils
import hostapd
+from utils import HwsimSkip
from test_ap_psk import check_mib, find_wpas_process, read_process_memory, verify_not_present, get_key_locations
+def check_hlr_auc_gw_support():
+ if not os.path.exists("/tmp/hlr_auc_gw.sock"):
+ raise HwsimSkip("No hlr_auc_gw available")
+
def read_pem(fname):
with open(fname, "r") as f:
lines = f.readlines()
def test_ap_wpa2_eap_sim(dev, apdev):
"""WPA2-Enterprise connection using EAP-SIM"""
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
eap_connect(dev[0], apdev[0], "SIM", "1232010000000000",
def test_ap_wpa2_eap_sim_sql(dev, apdev, params):
"""WPA2-Enterprise connection using EAP-SIM (SQL)"""
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
try:
import sqlite3
except ImportError:
- return "skip"
+ raise HwsimSkip("No sqlite3 module available")
con = sqlite3.connect(os.path.join(params['logdir'], "hostapd.db"))
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
params['auth_server_port'] = "1814"
def test_ap_wpa2_eap_sim_ext(dev, apdev):
"""WPA2-Enterprise connection using EAP-SIM and external GSM auth"""
try:
- return _test_ap_wpa2_eap_sim_ext(dev, apdev)
+ _test_ap_wpa2_eap_sim_ext(dev, apdev)
finally:
dev[0].request("SET external_sim 0")
def _test_ap_wpa2_eap_sim_ext(dev, apdev):
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hostapd.add_ap(apdev[0]['ifname'], params)
dev[0].request("SET external_sim 1")
def test_ap_wpa2_eap_aka(dev, apdev):
"""WPA2-Enterprise connection using EAP-AKA"""
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
eap_connect(dev[0], apdev[0], "AKA", "0232010000000000",
def test_ap_wpa2_eap_aka_sql(dev, apdev, params):
"""WPA2-Enterprise connection using EAP-AKA (SQL)"""
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
try:
import sqlite3
except ImportError:
- return "skip"
+ raise HwsimSkip("No sqlite3 module available")
con = sqlite3.connect(os.path.join(params['logdir'], "hostapd.db"))
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
params['auth_server_port'] = "1814"
def test_ap_wpa2_eap_aka_ext(dev, apdev):
"""WPA2-Enterprise connection using EAP-AKA and external UMTS auth"""
try:
- return _test_ap_wpa2_eap_aka_ext(dev, apdev)
+ _test_ap_wpa2_eap_aka_ext(dev, apdev)
finally:
dev[0].request("SET external_sim 0")
def _test_ap_wpa2_eap_aka_ext(dev, apdev):
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hostapd.add_ap(apdev[0]['ifname'], params)
dev[0].request("SET external_sim 1")
def test_ap_wpa2_eap_aka_prime(dev, apdev):
"""WPA2-Enterprise connection using EAP-AKA'"""
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
eap_connect(dev[0], apdev[0], "AKA'", "6555444333222111",
def test_ap_wpa2_eap_aka_prime_sql(dev, apdev, params):
"""WPA2-Enterprise connection using EAP-AKA' (SQL)"""
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
try:
import sqlite3
except ImportError:
- return "skip"
+ raise HwsimSkip("No sqlite3 module available")
con = sqlite3.connect(os.path.join(params['logdir'], "hostapd.db"))
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
params['auth_server_port'] = "1814"
def test_ap_wpa2_eap_sim_aka_result_ind(dev, apdev):
"""WPA2-Enterprise using EAP-SIM/AKA and protected result indication"""
- if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return "skip"
+ check_hlr_auc_gw_support()
params = int_eap_server_params()
params['eap_sim_db'] = "unix:/tmp/hlr_auc_gw.sock"
params['eap_sim_aka_result_ind'] = "1"
try:
import sqlite3
except ImportError:
- return "skip"
+ raise HwsimSkip("No sqlite3 module available")
dbfile = os.path.join(params['logdir'], "eap-user.db")
try:
os.remove(dbfile)
get_key_locations(buf, msk, "MSK")
get_key_locations(buf, emsk, "EMSK")
if password not in buf:
- print("Password not found while associated")
- return "skip"
+ raise HwsimSkip("Password not found while associated")
if pmk not in buf:
- print("PMK not found while associated")
- return "skip"
+ raise HwsimSkip("PMK not found while associated")
if kck not in buf:
raise Exception("KCK not found while associated")
if kek not in buf:
import hwsim_utils
import hostapd
+from utils import HwsimSkip
from wlantest import Wlantest
from test_ap_psk import check_mib, find_wpas_process, read_process_memory, verify_not_present, get_key_locations
get_key_locations(buf, pmkr0, "PMK-R0")
get_key_locations(buf, pmkr1, "PMK-R1")
if pmk not in buf:
- print("PMK not found while associated")
- return "skip"
+ raise HwsimSkip("PMK not found while associated")
if pmkr0 not in buf:
- print("PMK-R0 not found while associated")
- return "skip"
+ raise HwsimSkip("PMK-R0 not found while associated")
if pmkr1 not in buf:
- print("PMK-R1 not found while associated")
- return "skip"
+ raise HwsimSkip("PMK-R1 not found while associated")
if kck not in buf:
raise Exception("KCK not found while associated")
if kek not in buf:
import subprocess
import hostapd
+from utils import HwsimSkip
import hwsim_utils
from wlantest import Wlantest
from wpasupplicant import WpaSupplicant
def hlr_auc_gw_available():
if not os.path.exists("/tmp/hlr_auc_gw.sock"):
- logger.info("No hlr_auc_gw available");
- return False
+ raise HwsimSkip("No hlr_auc_gw socket available")
if not os.path.exists("../../hostapd/hlr_auc_gw"):
- logger.info("No hlr_auc_gw available");
- return False
- return True
+ raise HwsimSkip("No hlr_auc_gw available")
def interworking_ext_sim_connect(dev, bssid, method):
dev.request("INTERWORKING_CONNECT " + bssid)
def test_ap_interworking_scan_filtering(dev, apdev):
"""Interworking scan filtering with HESSID and access network type"""
try:
- return _test_ap_interworking_scan_filtering(dev, apdev)
+ _test_ap_interworking_scan_filtering(dev, apdev)
finally:
dev[0].request("SET hessid 00:00:00:00:00:00")
dev[0].request("SET access_network_type 15")
def test_ap_hs20_sim(dev, apdev):
"""Hotspot 2.0 with simulated SIM and EAP-SIM"""
- if not hlr_auc_gw_available():
- return "skip"
+ hlr_auc_gw_available()
hs20_simulated_sim(dev[0], apdev[0], "SIM")
dev[0].request("INTERWORKING_SELECT auto freq=2412")
ev = dev[0].wait_event(["INTERWORKING-ALREADY-CONNECTED"], timeout=15)
def test_ap_hs20_aka(dev, apdev):
"""Hotspot 2.0 with simulated USIM and EAP-AKA"""
- if not hlr_auc_gw_available():
- return "skip"
+ hlr_auc_gw_available()
hs20_simulated_sim(dev[0], apdev[0], "AKA")
def test_ap_hs20_aka_prime(dev, apdev):
"""Hotspot 2.0 with simulated USIM and EAP-AKA'"""
- if not hlr_auc_gw_available():
- return "skip"
+ hlr_auc_gw_available()
hs20_simulated_sim(dev[0], apdev[0], "AKA'")
def test_ap_hs20_ext_sim(dev, apdev):
"""Hotspot 2.0 with external SIM processing"""
- if not hlr_auc_gw_available():
- return "skip"
+ hlr_auc_gw_available()
bssid = apdev[0]['bssid']
params = hs20_ap_params()
params['hessid'] = bssid
def test_ap_hs20_ext_sim_roaming(dev, apdev):
"""Hotspot 2.0 with external SIM processing in roaming network"""
- if not hlr_auc_gw_available():
- return "skip"
+ hlr_auc_gw_available()
bssid = apdev[0]['bssid']
params = hs20_ap_params()
params['hessid'] = bssid
def test_ap_hs20_multi_cred_sp_prio(dev, apdev):
"""Hotspot 2.0 multi-cred sp_priority"""
try:
- return _test_ap_hs20_multi_cred_sp_prio(dev, apdev)
+ _test_ap_hs20_multi_cred_sp_prio(dev, apdev)
finally:
dev[0].request("SET external_sim 0")
def _test_ap_hs20_multi_cred_sp_prio(dev, apdev):
- if not hlr_auc_gw_available():
- return "skip"
+ hlr_auc_gw_available()
bssid = apdev[0]['bssid']
params = hs20_ap_params()
params['hessid'] = bssid
def test_ap_hs20_multi_cred_sp_prio2(dev, apdev):
"""Hotspot 2.0 multi-cred sp_priority with two BSSes"""
try:
- return _test_ap_hs20_multi_cred_sp_prio2(dev, apdev)
+ _test_ap_hs20_multi_cred_sp_prio2(dev, apdev)
finally:
dev[0].request("SET external_sim 0")
def _test_ap_hs20_multi_cred_sp_prio2(dev, apdev):
- if not hlr_auc_gw_available():
- return "skip"
+ hlr_auc_gw_available()
bssid = apdev[0]['bssid']
params = hs20_ap_params()
params['hessid'] = bssid
try:
import sqlite3
except ImportError:
- return "skip"
+ raise HwsimSkip("No sqlite3 module available")
dbfile = os.path.join(params['logdir'], "eap-user.db")
try:
os.remove(dbfile)
hapd.enable()
except:
# For now, do not report failures due to missing kernel support
- logger.info("Could not start hostapd - assume proxyarp not supported in kernel version")
- return "skip"
+ raise HwsimSkip("Could not start hostapd - assume proxyarp not supported in kernel version")
ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=10)
if ev is None:
raise Exception("AP startup timed out")
def test_ap_hs20_proxyarp(dev, apdev):
"""Hotspot 2.0 and ProxyARP"""
- res = None
try:
- res = _test_ap_hs20_proxyarp(dev, apdev)
+ _test_ap_hs20_proxyarp(dev, apdev)
finally:
subprocess.call(['ip', 'link', 'set', 'dev', 'ap-br0', 'down'],
stderr=open('/dev/null', 'w'))
subprocess.call(['brctl', 'delbr', 'ap-br0'],
stderr=open('/dev/null', 'w'))
- return res
-
def _test_ap_hs20_proxyarp_dgaf(dev, apdev, disabled):
bssid = apdev[0]['bssid']
params = hs20_ap_params()
hapd.enable()
except:
# For now, do not report failures due to missing kernel support
- logger.info("Could not start hostapd - assume proxyarp not supported in kernel version")
- return "skip"
+ raise HwsimSkip("Could not start hostapd - assume proxyarp not supported in kernel version")
ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
if ev is None:
raise Exception("AP startup timed out")
def test_ap_hs20_proxyarp_disable_dgaf(dev, apdev):
"""Hotspot 2.0 and ProxyARP with DGAF disabled"""
- res = None
try:
- res = _test_ap_hs20_proxyarp_dgaf(dev, apdev, True)
+ _test_ap_hs20_proxyarp_dgaf(dev, apdev, True)
finally:
subprocess.call(['ip', 'link', 'set', 'dev', 'ap-br0', 'down'],
stderr=open('/dev/null', 'w'))
subprocess.call(['brctl', 'delbr', 'ap-br0'],
stderr=open('/dev/null', 'w'))
- return res
-
def test_ap_hs20_proxyarp_enable_dgaf(dev, apdev):
"""Hotspot 2.0 and ProxyARP with DGAF enabled"""
- res = None
try:
- res = _test_ap_hs20_proxyarp_dgaf(dev, apdev, False)
+ _test_ap_hs20_proxyarp_dgaf(dev, apdev, False)
finally:
subprocess.call(['ip', 'link', 'set', 'dev', 'ap-br0', 'down'],
stderr=open('/dev/null', 'w'))
subprocess.call(['brctl', 'delbr', 'ap-br0'],
stderr=open('/dev/null', 'w'))
- return res
-
def ip_checksum(buf):
sum = 0
if len(buf) & 0x01:
hapd.enable()
except:
# For now, do not report failures due to missing kernel support
- logger.info("Could not start hostapd - assume proxyarp not supported in kernel version")
- return "skip"
+ raise HwsimSkip("Could not start hostapd - assume proxyarp not supported in kernel version")
ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=10)
if ev is None:
raise Exception("AP startup timed out")
def test_proxyarp_open(dev, apdev, params):
"""ProxyARP with open network"""
- res = None
try:
- res = _test_proxyarp_open(dev, apdev, params)
+ _test_proxyarp_open(dev, apdev, params)
finally:
try:
subprocess.call(['ebtables', '-F', 'FORWARD'])
stderr=open('/dev/null', 'w'))
subprocess.call(['brctl', 'delbr', 'ap-br0'],
stderr=open('/dev/null', 'w'))
-
- return res
import subprocess
import hostapd
+from utils import HwsimSkip
import hwsim_utils
from test_ap_csa import csa_supported
def test_ap_ht40_csa(dev, apdev):
"""HT with 40 MHz channel width and CSA"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
try:
hapd = None
params = { "ssid": "ht",
def test_ap_ht40_csa2(dev, apdev):
"""HT with 40 MHz channel width and CSA"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
try:
hapd = None
params = { "ssid": "ht",
def test_ap_ht40_csa3(dev, apdev):
"""HT with 40 MHz channel width and CSA"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
try:
hapd = None
params = { "ssid": "ht",
try:
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
except:
- logger.info("Assume mac80211_hwsim was not recent enough to support SMPS")
- return "skip"
+ raise HwsimSkip("Assume mac80211_hwsim was not recent enough to support SMPS")
params = { "ssid": "ht2", "ht_capab": "[SMPS-DYNAMIC]" }
hapd2 = hostapd.add_ap(apdev[1]['ifname'], params)
import time
import hostapd
+from utils import HwsimSkip
import hwsim_utils
def check_mib(dev, vals):
logger.info("Checking keys in memory while associated")
get_key_locations(buf, pmk, "PMK")
if pmk not in buf:
- print("PMK not found while associated")
- return "skip"
+ raise HwsimSkip("PMK not found while associated")
if kck not in buf:
raise Exception("KCK not found while associated")
if kek not in buf:
import hwsim_utils
import hostapd
+from utils import HwsimSkip
from wlantest import Wlantest
def check_qos_map(ap, hapd, dev, sta, dscp, tid, ap_tid=None):
"""QoS mapping"""
drv_flags = dev[0].get_driver_status_field("capa.flags")
if int(drv_flags, 0) & 0x40000000 == 0:
- return "skip"
+ raise HwsimSkip("Driver does not support QoS Map")
ssid = "test-qosmap"
params = { "ssid": ssid }
params['qos_map_set'] = '53,2,22,6,8,15,0,7,255,255,16,31,32,39,255,255,40,47,48,55'
from hostapd import HostapdGlobal
from hostapd import Hostapd
import hostapd
+from utils import HwsimSkip
from wlantest import Wlantest
def start_ap_wpa2_psk(ifname):
"""Open AP and two stations using TDLS"""
flags = int(dev[0].get_driver_status_field('capa.flags'), 16)
if flags & 0x800000000 == 0:
- logger.info("Driver does not support TDLS channel switching")
- return "skip"
+ raise HwsimSkip("Driver does not support TDLS channel switching")
hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-open" })
connect_2sta_open(dev, hapd)
import hwsim_utils
import hostapd
+from utils import HwsimSkip
from test_dfs import wait_dfs_event
from test_ap_csa import csa_supported
except Exception, e:
if isinstance(e, Exception) and str(e) == "AP startup failed":
if not vht_supported():
- logger.info("80 MHz channel not supported in regulatory information")
- return "skip"
+ raise HwsimSkip("80 MHz channel not supported in regulatory information")
raise
finally:
dev[0].request("DISCONNECT")
except Exception, e:
if isinstance(e, Exception) and str(e) == "AP startup failed":
if not vht_supported():
- logger.info("80 MHz channel not supported in regulatory information")
- return "skip"
+ raise HwsimSwkip("80 MHz channel not supported in regulatory information")
raise
finally:
dev[0].request("DISCONNECT")
# Not all systems have recent enough CRDA version and
# wireless-regdb changes to support 160 MHz and DFS. For now,
# do not report failures for this test case.
- return "skip"
+ raise HwsimSkip("CRDA or wireless-regdb did not support 160 MHz")
raise Exception("Unexpected interface state: " + state)
params = { "ssid": "vht2",
except Exception, e:
if isinstance(e, Exception) and str(e) == "AP startup failed":
if not vht_supported():
- logger.info("80/160 MHz channel not supported in regulatory information")
- return "skip"
+ raise HwsimSkip("80/160 MHz channel not supported in regulatory information")
raise
finally:
dev[0].request("DISCONNECT")
except Exception, e:
if isinstance(e, Exception) and str(e) == "AP startup failed":
if not vht_supported():
- logger.info("80/160 MHz channel not supported in regulatory information")
- return "skip"
+ raise HwsimSkip("80/160 MHz channel not supported in regulatory information")
raise
finally:
dev[0].request("DISCONNECT")
def test_ap_vht80_csa(dev, apdev):
"""VHT with 80 MHz channel width and CSA"""
- if not csa_supported(dev[0]):
- return "skip"
+ csa_supported(dev[0])
try:
hapd = None
params = { "ssid": "vht",
except Exception, e:
if isinstance(e, Exception) and str(e) == "AP startup failed":
if not vht_supported():
- logger.info("80 MHz channel not supported in regulatory information")
- return "skip"
+ raise HwsimSkip("80 MHz channel not supported in regulatory information")
raise
finally:
dev[0].request("DISCONNECT")
import hwsim_utils
import hostapd
from wpasupplicant import WpaSupplicant
+from utils import HwsimSkip
def test_ap_wps_init(dev, apdev):
"""Initial AP configuration with first WPS Enrollee"""
def test_ap_wps_pbc_timeout(dev, apdev, params):
"""wpa_supplicant PBC walk time [long]"""
if not params['long']:
- logger.info("Skip test case with long duration due to --long not specified")
- return "skip"
+ raise HwsimSkip("Skip test case with long duration due to --long not specified")
ssid = "test-wps"
hostapd.add_ap(apdev[0]['ifname'],
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
def test_dbus_get_set_wps(dev, apdev):
"""D-Bus Get/Set for WPS properties"""
try:
- return _test_dbus_get_set_wps(dev, apdev)
+ _test_dbus_get_set_wps(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
dev[0].request("SET config_methods display keypad virtual_display nfc_interface")
def test_dbus_wps_pbc(dev, apdev):
"""D-Bus WPS/PBC operation and signals"""
try:
- return _test_dbus_wps_pbc(dev, apdev)
+ _test_dbus_wps_pbc(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
def test_dbus_wps_pin(dev, apdev):
"""D-Bus WPS/PIN operation and signals"""
try:
- return _test_dbus_wps_pin(dev, apdev)
+ _test_dbus_wps_pin(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
def test_dbus_wps_pin2(dev, apdev):
"""D-Bus WPS/PIN operation and signals (PIN from wpa_supplicant)"""
try:
- return _test_dbus_wps_pin2(dev, apdev)
+ _test_dbus_wps_pin2(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
def test_dbus_wps_pin_m2d(dev, apdev):
"""D-Bus WPS/PIN operation and signals with M2D"""
try:
- return _test_dbus_wps_pin_m2d(dev, apdev)
+ _test_dbus_wps_pin_m2d(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
def test_dbus_wps_reg(dev, apdev):
"""D-Bus WPS/Registrar operation and signals"""
try:
- return _test_dbus_wps_reg(dev, apdev)
+ _test_dbus_wps_reg(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
def test_dbus_apscan(dev, apdev):
"""D-Bus Get/Set ApScan"""
try:
- return _test_dbus_apscan(dev, apdev)
+ _test_dbus_apscan(dev, apdev)
finally:
dev[0].request("AP_SCAN 1")
def test_dbus_country(dev, apdev):
"""D-Bus Get/Set Country"""
try:
- return _test_dbus_country(dev, apdev)
+ _test_dbus_country(dev, apdev)
finally:
dev[0].request("SET country 00")
subprocess.call(['iw', 'reg', 'set', '00'])
def test_dbus_old_wps_pbc(dev, apdev):
"""The old D-Bus interface and WPS/PBC"""
try:
- return _test_dbus_old_wps_pbc(dev, apdev)
+ _test_dbus_old_wps_pbc(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
def test_dbus_old_wps_pin(dev, apdev):
"""The old D-Bus interface and WPS/PIN"""
try:
- return _test_dbus_old_wps_pin(dev, apdev)
+ _test_dbus_old_wps_pin(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
def test_dbus_old_wps_reg(dev, apdev):
"""The old D-Bus interface and WPS/Registar"""
try:
- return _test_dbus_old_wps_reg(dev, apdev)
+ _test_dbus_old_wps_reg(dev, apdev)
finally:
dev[0].request("SET wps_cred_processing 0")
import hwsim_utils
import hostapd
+from utils import HwsimSkip
def wait_dfs_event(hapd, event, timeout):
dfs_events = [ "DFS-RADAR-DETECTED", "DFS-NEW-CHANNEL",
if state != "DFS":
if allow_failure:
logger.info("Interface state not DFS: " + state)
- return None
+ if not os.path.exists("dfs"):
+ raise HwsimSkip("Assume DFS testing not supported")
+ raise Exception("Failed to start DFS AP")
raise Exception("Unexpected interface state: " + state)
return hapd
"""DFS CAC functionality on clear channel"""
try:
hapd = start_dfs_ap(apdev[0], allow_failure=True)
- if hapd is None:
- if not os.path.exists("dfs"):
- return "skip"
- raise Exception("Failed to start DFS AP")
ev = wait_dfs_event(hapd, "DFS-CAC-COMPLETED", 70)
if "success=1" not in ev:
try:
hapd2 = None
hapd = start_dfs_ap(apdev[0], allow_failure=True)
- if hapd is None:
- if not os.path.exists("dfs"):
- return "skip"
- raise Exception("Failed to start DFS AP")
time.sleep(1)
dfs_simulate_radar(hapd)
"""DFS chanlist when radar is detected"""
try:
hapd = start_dfs_ap(apdev[0], chanlist="40 44", allow_failure=True)
- if hapd is None:
- if not os.path.exists("dfs"):
- return "skip"
- raise Exception("Failed to start DFS AP")
time.sleep(1)
dfs_simulate_radar(hapd)
try:
hapd = start_dfs_ap(apdev[0], chanlist="36", ht40=True, vht80=True,
allow_failure=True)
- if hapd is None:
- if not os.path.exists("dfs"):
- return "skip"
- raise Exception("Failed to start DFS AP")
time.sleep(1)
dfs_simulate_radar(hapd)
try:
hapd = start_dfs_ap(apdev[0], chanlist="36", vht20=True,
allow_failure=True)
- if hapd is None:
- if not os.path.exists("dfs"):
- return "skip"
- raise Exception("Failed to start DFS AP")
time.sleep(1)
dfs_simulate_radar(hapd)
try:
hapd = start_dfs_ap(apdev[0], chanlist="36", ht=False,
allow_failure=True)
- if hapd is None:
- if not os.path.exists("dfs"):
- return "skip"
- raise Exception("Failed to start DFS AP")
time.sleep(1)
dfs_simulate_radar(hapd)
try:
hapd = start_dfs_ap(apdev[0], chanlist="36", ht40minus=True,
allow_failure=True)
- if hapd is None:
- if not os.path.exists("dfs"):
- return "skip"
- raise Exception("Failed to start DFS AP")
time.sleep(1)
dfs_simulate_radar(hapd)
import time
import hostapd
+from utils import HwsimSkip
EAP_CODE_REQUEST = 1
EAP_CODE_RESPONSE = 2
import pyrad.packet
import pyrad.dictionary
except ImportError:
- return None
+ raise HwsimSkip("No pyrad modules available")
class TestServer(pyrad.server.Server):
def _HandleAuthPacket(self, pkt):
return None
srv = start_radius_server(eap_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return sake_challenge(ctx)
srv = start_radius_server(sake_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(leap_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(md5_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(otp_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(gpsk_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(eke_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return struct.pack(">BBH", EAP_CODE_FAILURE, ctx['id'], 4)
srv = start_radius_server(pax_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(psk_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(aka_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(aka_prime_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(sim_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
return None
srv = start_radius_server(ikev2_handler)
- if srv is None:
- return "skip"
try:
hapd = start_ap(apdev[0]['ifname'])
import time
import hostapd
+from utils import HwsimSkip
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")
def test_erp(dev, apdev):
"""ERP enabled on server and peer"""
- capab = dev[0].get_capability("erp")
- if not capab or 'ERP' not in capab:
- return "skip"
+ check_erp_capa(dev[0])
params = int_eap_server_params()
params['erp_send_reauth_start'] = '1'
params['erp_domain'] = 'example.com'
def test_erp_server_no_match(dev, apdev):
"""ERP enabled on server and peer, but server has no key match"""
- capab = dev[0].get_capability("erp")
- if not capab or 'ERP' not in capab:
- return "skip"
+ check_erp_capa(dev[0])
params = int_eap_server_params()
params['erp_send_reauth_start'] = '1'
params['erp_domain'] = 'example.com'
def test_erp_radius(dev, apdev):
"""ERP enabled on RADIUS server and peer"""
- capab = dev[0].get_capability("erp")
- if not capab or 'ERP' not in capab:
- return "skip"
+ check_erp_capa(dev[0])
start_erp_as(apdev[1])
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
params['auth_server_port'] = "18128"
def test_erp_radius_eap_methods(dev, apdev):
"""ERP enabled on RADIUS server and peer"""
- capab = dev[0].get_capability("erp")
- if not capab or 'ERP' not in capab:
- return "skip"
+ check_erp_capa(dev[0])
start_erp_as(apdev[1])
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
params['auth_server_port'] = "18128"
def test_erp_key_lifetime_in_memory(dev, apdev, params):
"""ERP and key lifetime in memory"""
- capab = dev[0].get_capability("erp")
- if not capab or 'ERP' not in capab:
- return "skip"
+ check_erp_capa(dev[0])
p = int_eap_server_params()
p['erp_send_reauth_start'] = '1'
p['erp_domain'] = 'example.com'
get_key_locations(buf, rRK, "rRK")
get_key_locations(buf, rIK, "rIK")
if password not in buf:
- print("Password not found while associated")
- return "skip"
+ raise HwsimSkip("Password not found while associated")
if pmk not in buf:
- print("PMK not found while associated")
- return "skip"
+ raise HwsimSkip("PMK not found while associated")
if kck not in buf:
raise Exception("KCK not found while associated")
if kek not in buf:
import hwsim_utils
import utils
+from utils import HwsimSkip
from wlantest import Wlantest
from wpasupplicant import WpaSupplicant
if "FAIL" in res:
# for now, skip test since mac80211_hwsim support is not yet widely
# deployed
- return 'skip'
+ raise HwsimSkip("Assume mac80211_hwsim did not support channel switching")
ev = dev[0].wait_event(["AP-CSA-FINISHED"], timeout=10)
if ev is None:
raise Exception("CSA finished event timed out")
import hostapd
import hwsim_utils
import utils
+from utils import HwsimSkip
from wpasupplicant import WpaSupplicant
def check_grpform_results(i_res, r_res):
def test_grpform_cred_ready_timeout(dev, apdev, params):
"""P2P GO Negotiation wait for credentials to become ready [long]"""
if not params['long']:
- logger.info("Skip test case with long duration due to --long not specified")
- return "skip"
+ raise HwsimSkip("Skip test case with long duration due to --long not specified")
dev[1].p2p_listen()
addr1 = dev[1].p2p_dev_addr()
import time
import hostapd
+from utils import HwsimSkip
def connect(dev, ssid, wait_connect=True):
dev.connect(ssid, key_mgmt="WPA-EAP", scan_freq="2412",
import pyrad.dictionary
import radius_das
except ImportError:
- return "skip"
+ raise HwsimSkip("No pyrad modules available")
params = hostapd.wpa2_eap_params(ssid="radius-das")
params['radius_das_port'] = "3799"
import pyrad.dictionary
import radius_das
except ImportError:
- return "skip"
+ raise HwsimSkip("No pyrad modules available")
params = hostapd.wpa2_eap_params(ssid="radius-das")
params['radius_das_port'] = "3799"
import pyrad.packet
import pyrad.dictionary
except ImportError:
- return "skip"
+ raise HwsimSkip("No pyrad modules available")
class TestServer(pyrad.server.Server):
def _HandleAuthPacket(self, pkt):
import pyrad.packet
import pyrad.dictionary
except ImportError:
- return "skip"
+ raise HwsimSkip("No pyrad modules available")
class TestServer(pyrad.server.Server):
def _HandleAuthPacket(self, pkt):
import hwsim_utils
from wpasupplicant import WpaSupplicant
from rfkill import RFKill
+from utils import HwsimSkip
def get_rfkill(dev):
phy = dev.get_driver_status_field("phyname")
if r.name == phy:
return r
except Exception, e:
- logger.info("No rfkill available: " + str(e))
-
- return None
+ raise HwsimSkip("No rfkill available: " + str(e))
+ raise HwsimSkip("No rfkill match found for the interface")
def test_rfkill_open(dev, apdev):
"""rfkill block/unblock during open mode connection"""
rfk = get_rfkill(dev[0])
- if rfk is None:
- return "skip"
hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" })
dev[0].connect("open", key_mgmt="NONE", scan_freq="2412")
def test_rfkill_wpa2_psk(dev, apdev):
"""rfkill block/unblock during WPA2-PSK connection"""
rfk = get_rfkill(dev[0])
- if rfk is None:
- return "skip"
ssid = "test-wpa2-psk"
passphrase = 'qwertyuiop'
def test_rfkill_autogo(dev, apdev):
"""rfkill block/unblock for autonomous P2P GO"""
rfk0 = get_rfkill(dev[0])
- if rfk0 is None:
- return "skip"
rfk1 = get_rfkill(dev[1])
- if rfk1 is None:
- return "skip"
dev[0].p2p_start_go()
dev[1].request("SET p2p_no_group_iface 0")
hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" })
rfk = get_rfkill(hapd)
- if rfk is None:
- return "skip"
try:
rfk.block()
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add("wlan5")
rfk = get_rfkill(wpas)
- if rfk is None:
- return "skip"
wpas.interface_remove("wlan5")
try:
rfk.block()
import hwsim_utils
import hostapd
+from utils import HwsimSkip
from test_ap_psk import find_wpas_process, read_process_memory, verify_not_present, get_key_locations
def test_sae(dev, apdev):
get_key_locations(buf, password, "Password")
get_key_locations(buf, pmk, "PMK")
if password not in buf:
- print("Password not found while associated")
- return "skip"
+ raise HwsimSkip("Password not found while associated")
if pmk not in buf:
- print("PMK not found while associated")
- return "skip"
+ raise HwsimSkip("PMK not found while associated")
if kck not in buf:
raise Exception("KCK not found while associated")
if kek not in buf:
logger = logging.getLogger()
import hostapd
+from utils import HwsimSkip
def test_suite_b(dev, apdev):
"""WPA2-PSK/GCMP connection"""
if "GCMP" not in dev[0].get_capability("pairwise"):
- return "skip"
+ raise HwsimSkip("GCMP not supported")
params = hostapd.wpa2_eap_params(ssid="test-suite-b")
params["wpa_key_mgmt"] = "WPA-EAP-SUITE-B"
params['rsn_pairwise'] = "GCMP"
import os.path
import hostapd
+from utils import HwsimSkip
from test_ap_eap import int_eap_server_params
def test_tnc_peap_soh(dev, apdev):
hostapd.add_ap(apdev[0]['ifname'], params)
if not os.path.exists("tnc/libhostap_imc.so"):
- logger.info("No IMC installed - skip")
- return "skip"
+ raise HwsimSkip("No IMC installed")
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP",
eap="TTLS", identity="DOMAIN\mschapv2 user",
hostapd.add_ap(apdev[0]['ifname'], params)
if not os.path.exists("tnc/libhostap_imc.so"):
- logger.info("No IMC installed - skip")
- return "skip"
+ raise HwsimSkip("No IMC installed")
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP",
eap="FAST", identity="user",
# Deprecated WEXT driver interface in wpa_supplicant
-# Copyright (c) 2013-2014, Jouni Malinen <j@w1.fi>
+# Copyright (c) 2013-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import hostapd
import hwsim_utils
from wpasupplicant import WpaSupplicant
+from utils import HwsimSkip
from test_rfkill import get_rfkill
def get_wext_interface():
if not os.path.exists("/proc/net/wireless"):
- logger.info("WEXT support not included in the kernel")
- return
+ raise HwsimSkip("WEXT support not included in the kernel")
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
try:
wpas.interface_add("wlan5", driver="wext")
except Exception, e:
- logger.info("WEXT driver support not included in wpa_supplicant")
- return
+ raise HwsimSkip("WEXT driver support not included in wpa_supplicant")
return wpas
def test_wext_open(dev, apdev):
"""WEXT driver interface with open network"""
wpas = get_wext_interface()
- if not wpas:
- return "skip"
params = { "ssid": "wext-open" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
def test_wext_wpa2_psk(dev, apdev):
"""WEXT driver interface with WPA2-PSK"""
wpas = get_wext_interface()
- if not wpas:
- return "skip"
params = hostapd.wpa2_params(ssid="wext-wpa2-psk", passphrase="12345678")
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
def test_wext_wpa_psk(dev, apdev):
"""WEXT driver interface with WPA-PSK"""
wpas = get_wext_interface()
- if not wpas:
- return "skip"
params = hostapd.wpa_params(ssid="wext-wpa-psk", passphrase="12345678")
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
testfile = "/sys/kernel/debug/ieee80211/%s/netdev:%s/tkip_mic_test" % (hapd.get_driver_status_field("phyname"), apdev[0]['ifname'])
if not os.path.exists(testfile):
- return "skip"
+ raise HwsimSkip("tkip_mic_test not supported in mac80211")
wpas.connect("wext-wpa-psk", psk="12345678")
hwsim_utils.test_connectivity(wpas, hapd)
def test_wext_pmksa_cache(dev, apdev):
"""PMKSA caching with WEXT"""
wpas = get_wext_interface()
- if not wpas:
- return "skip"
params = hostapd.wpa2_eap_params(ssid="test-pmksa-cache")
hostapd.add_ap(apdev[0]['ifname'], params)
def test_wext_wep_open_auth(dev, apdev):
"""WEP Open System authentication"""
wpas = get_wext_interface()
- if not wpas:
- return "skip"
hapd = hostapd.add_ap(apdev[0]['ifname'],
{ "ssid": "wep-open",
def test_wext_wep_shared_key_auth(dev, apdev):
"""WEP Shared Key authentication"""
wpas = get_wext_interface()
- if not wpas:
- return "skip"
hapd = hostapd.add_ap(apdev[0]['ifname'],
{ "ssid": "wep-shared-key",
def test_wext_pmf(dev, apdev):
"""WEXT driver interface with WPA2-PSK and PMF"""
wpas = get_wext_interface()
- if not wpas:
- return "skip"
params = hostapd.wpa2_params(ssid="wext-wpa2-psk", passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
def test_wext_scan_hidden(dev, apdev):
"""WEXT with hidden SSID"""
wpas = get_wext_interface()
- if not wpas:
- return "skip"
hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan",
"ignore_broadcast_ssid": "1" })
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add("wlan5")
rfk = get_rfkill(wpas)
- if rfk is None:
- return "skip"
wpas.interface_remove("wlan5")
wpas = get_wext_interface()
- if not wpas:
- return "skip"
hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" })
wpas.connect("open", key_mgmt="NONE", scan_freq="2412")
import hwsim_utils
from wpasupplicant import WpaSupplicant
+from utils import HwsimSkip
-def mesh_supported(dev):
+def check_mesh_support(dev):
flags = int(dev.get_driver_status_field('capa.flags'), 16)
- if flags & 0x100000000:
- return True
- return False
+ if flags & 0x100000000 == 0:
+ raise HwsimSkip("Driver does not support mesh")
def check_mesh_scan(dev, params, other_started=False, beacon_int=0):
if not other_started:
def test_wpas_mesh_group_added(dev):
"""wpa_supplicant MESH group add"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
add_open_mesh_network(dev[0])
# Check for MESH-GROUP-STARTED event
def test_wpas_mesh_group_remove(dev):
"""wpa_supplicant MESH group remove"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
add_open_mesh_network(dev[0], ht_mode="NOHT")
# Check for MESH-GROUP-STARTED event
check_mesh_group_added(dev[0])
def test_wpas_mesh_peer_connected(dev):
"""wpa_supplicant MESH peer connected"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
add_open_mesh_network(dev[0], ht_mode="HT20", beacon_int=160)
add_open_mesh_network(dev[1], ht_mode="HT20", beacon_int=160)
def test_wpas_mesh_peer_disconnected(dev):
"""wpa_supplicant MESH peer disconnected"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
add_open_mesh_network(dev[0])
add_open_mesh_network(dev[1])
def test_wpas_mesh_mode_scan(dev):
"""wpa_supplicant MESH scan support"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
add_open_mesh_network(dev[0], ht_mode="HT40+")
add_open_mesh_network(dev[1], ht_mode="HT40+", beacon_int=175)
def test_wpas_mesh_open(dev, apdev):
"""wpa_supplicant open MESH network connectivity"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
add_open_mesh_network(dev[0], ht_mode="HT40-", freq="2462")
add_open_mesh_network(dev[1], ht_mode="HT40-", freq="2462")
def test_wpas_mesh_open_no_auto(dev, apdev):
"""wpa_supplicant open MESH network connectivity"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
id = add_open_mesh_network(dev[0], start=False)
dev[0].set_network(id, "dot11MeshMaxRetries", "16")
dev[0].set_network(id, "dot11MeshRetryTimeout", "255")
def test_wpas_mesh_secure(dev, apdev):
"""wpa_supplicant secure MESH network connectivity"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
dev[0].request("SET sae_groups ")
id = add_mesh_secure_net(dev[0])
dev[0].mesh_group_add(id)
def test_wpas_mesh_secure_sae_group_mismatch(dev, apdev):
"""wpa_supplicant secure MESH and SAE group mismatch"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
addr0 = dev[0].p2p_interface_addr()
addr1 = dev[1].p2p_interface_addr()
addr2 = dev[2].p2p_interface_addr()
def test_wpas_mesh_secure_sae_missing_password(dev, apdev):
"""wpa_supplicant secure MESH and missing SAE password"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
id = add_mesh_secure_net(dev[0], psk=False)
dev[0].set_network(id, "psk", "8f20b381f9b84371d61b5080ad85cac3c61ab3ca9525be5b2d0f4da3d979187a")
dev[0].mesh_group_add(id)
def test_wpas_mesh_secure_no_auto(dev, apdev):
"""wpa_supplicant secure MESH network connectivity"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
dev[0].request("SET sae_groups 19")
id = add_mesh_secure_net(dev[0])
dev[0].mesh_group_add(id)
def test_wpas_mesh_ctrl(dev):
"""wpa_supplicant ctrl_iface mesh command error cases"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
if "FAIL" not in dev[0].request("MESH_GROUP_ADD 123"):
raise Exception("Unexpected MESH_GROUP_ADD success")
id = dev[0].add_network()
def test_wpas_mesh_dynamic_interface(dev):
"""wpa_supplicant mesh with dynamic interface"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
mesh0 = None
mesh1 = None
try:
def test_wpas_mesh_max_peering(dev, apdev):
"""Mesh max peering limit"""
- if not mesh_supported(dev[0]):
- return "skip"
+ check_mesh_support(dev[0])
try:
dev[0].request("SET max_peer_links 1")