tests: Mark 525 tests as remote compatible

After successfully passing the 525 tests on a remote setup mark the
tests as remote compatible.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
This commit is contained in:
Jonathan Afek 2016-06-23 20:16:36 +03:00 committed by Jouni Malinen
parent 5aa751eaf3
commit 9fd6804d61
52 changed files with 578 additions and 0 deletions

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -63,11 +64,13 @@ def check_group_mgmt_cipher(dev, ap, cipher):
if res != group_mgmt:
raise Exception("Unexpected group mgmt cipher: " + res)
@remote_compatible
def test_ap_cipher_tkip(dev, apdev):
"""WPA2-PSK/TKIP connection"""
skip_with_fips(dev[0])
check_cipher(dev[0], apdev[0], "TKIP")
@remote_compatible
def test_ap_cipher_tkip_countermeasures_ap(dev, apdev):
"""WPA-PSK/TKIP countermeasures (detected by AP)"""
skip_with_fips(dev[0])
@ -102,6 +105,7 @@ def test_ap_cipher_tkip_countermeasures_ap(dev, apdev):
if ev is not None:
raise Exception("Unexpected connection during TKIP countermeasures")
@remote_compatible
def test_ap_cipher_tkip_countermeasures_sta(dev, apdev):
"""WPA-PSK/TKIP countermeasures (detected by STA)"""
skip_with_fips(dev[0])
@ -136,6 +140,7 @@ def test_ap_cipher_tkip_countermeasures_sta(dev, apdev):
if ev is not None:
raise Exception("Unexpected connection during TKIP countermeasures")
@remote_compatible
def test_ap_cipher_ccmp(dev, apdev):
"""WPA2-PSK/CCMP connection"""
check_cipher(dev[0], apdev[0], "CCMP")
@ -152,6 +157,7 @@ def test_ap_cipher_gcmp_256(dev, apdev):
"""WPA2-PSK/GCMP-256 connection"""
check_cipher(dev[0], apdev[0], "GCMP-256")
@remote_compatible
def test_ap_cipher_mixed_wpa_wpa2(dev, apdev):
"""WPA2-PSK/CCMP/ and WPA-PSK/TKIP mixed configuration"""
skip_with_fips(dev[0])
@ -194,6 +200,7 @@ def test_ap_cipher_mixed_wpa_wpa2(dev, apdev):
hwsim_utils.test_connectivity(dev[1], hapd)
hwsim_utils.test_connectivity(dev[0], dev[1])
@remote_compatible
def test_ap_cipher_bip(dev, apdev):
"""WPA2-PSK with BIP"""
check_group_mgmt_cipher(dev[0], apdev[0], "AES-128-CMAC")

View file

@ -4,8 +4,10 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import hostapd
@remote_compatible
def test_ap_config_errors(dev, apdev):
"""Various hostapd configuration errors"""

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -42,6 +43,7 @@ def csa_supported(dev):
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"""
csa_supported(dev[0])
@ -52,6 +54,7 @@ def test_ap_csa_1_switch(dev, apdev):
wait_channel_switch(dev[0], 2462)
hwsim_utils.test_connectivity(dev[0], ap)
@remote_compatible
def test_ap_csa_2_switches(dev, apdev):
"""AP Channel Switch, two switches"""
csa_supported(dev[0])
@ -65,6 +68,7 @@ def test_ap_csa_2_switches(dev, apdev):
wait_channel_switch(dev[0], 2412)
hwsim_utils.test_connectivity(dev[0], ap)
@remote_compatible
def test_ap_csa_1_switch_count_0(dev, apdev):
"""AP Channel Switch, one switch with count 0"""
csa_supported(dev[0])
@ -75,6 +79,7 @@ def test_ap_csa_1_switch_count_0(dev, apdev):
# this does not result in CSA currently, so do not bother checking
# connectivity
@remote_compatible
def test_ap_csa_2_switches_count_0(dev, apdev):
"""AP Channel Switch, two switches with count 0"""
csa_supported(dev[0])
@ -88,6 +93,7 @@ def test_ap_csa_2_switches_count_0(dev, apdev):
# this does not result in CSA currently, so do not bother checking
# connectivity
@remote_compatible
def test_ap_csa_1_switch_count_1(dev, apdev):
"""AP Channel Switch, one switch with count 1"""
csa_supported(dev[0])
@ -98,6 +104,7 @@ def test_ap_csa_1_switch_count_1(dev, apdev):
# this does not result in CSA currently, so do not bother checking
# connectivity
@remote_compatible
def test_ap_csa_2_switches_count_1(dev, apdev):
"""AP Channel Switch, two switches with count 1"""
csa_supported(dev[0])
@ -111,6 +118,7 @@ def test_ap_csa_2_switches_count_1(dev, apdev):
# this does not result in CSA currently, so do not bother checking
# connectivity
@remote_compatible
def test_ap_csa_1_switch_count_2(dev, apdev):
"""AP Channel Switch, one switch with count 2"""
csa_supported(dev[0])
@ -121,6 +129,7 @@ def test_ap_csa_1_switch_count_2(dev, apdev):
wait_channel_switch(dev[0], 2462)
hwsim_utils.test_connectivity(dev[0], ap)
@remote_compatible
def test_ap_csa_ecsa_only(dev, apdev):
"""AP Channel Switch, one switch with only ECSA IE"""
csa_supported(dev[0])
@ -131,6 +140,7 @@ def test_ap_csa_ecsa_only(dev, apdev):
wait_channel_switch(dev[0], 2462)
hwsim_utils.test_connectivity(dev[0], ap)
@remote_compatible
def test_ap_csa_invalid(dev, apdev):
"""AP Channel Switch - invalid channel"""
csa_supported(dev[0])

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import subprocess
import logging
@ -15,6 +16,7 @@ import hostapd
from utils import alloc_fail
from test_ap_acs import force_prev_ap_on_24g
@remote_compatible
def test_ap_change_ssid(dev, apdev):
"""Dynamic SSID change with hostapd and WPA2-PSK"""
params = hostapd.wpa2_params(ssid="test-wpa2-psk-start",
@ -210,6 +212,7 @@ def invalid_ap(ap):
raise Exception("ENABLE command succeeded unexpectedly")
return hapd
@remote_compatible
def test_ap_invalid_config(dev, apdev):
"""Try to start AP with invalid configuration and fix configuration"""
hapd = invalid_ap(apdev[0])
@ -219,6 +222,7 @@ def test_ap_invalid_config(dev, apdev):
hapd.enable()
dev[0].connect("invalid-config", key_mgmt="NONE", scan_freq="2412")
@remote_compatible
def test_ap_invalid_config2(dev, apdev):
"""Try to start AP with invalid configuration and remove interface"""
hapd = invalid_ap(apdev[0])
@ -259,6 +263,7 @@ def test_ap_remove_during_acs3(dev, apdev):
hapd.enable()
hostapd.remove_bss(apdev[0], ifname2)
@remote_compatible
def test_ap_remove_during_ht_coex_scan(dev, apdev):
"""Remove interface during HT co-ex scan"""
params = hostapd.wpa2_params(ssid="test-ht-remove", passphrase="12345678")
@ -294,6 +299,7 @@ def test_ap_remove_during_ht_coex_scan3(dev, apdev):
hapd.enable()
hostapd.remove_bss(apdev[0], ifname2)
@remote_compatible
def test_ap_enable_disable_reenable(dev, apdev):
"""Enable, disable, re-enable AP"""
hapd = hostapd.add_ap(apdev[0], {}, no_enable=True)
@ -435,6 +441,7 @@ def test_ap_multi_bss(dev, apdev):
if 'rx_packets' not in sta1 or int(sta1['rx_packets']) < 1:
raise Exception("sta1 did not report receiving packets")
@remote_compatible
def test_ap_add_with_driver(dev, apdev):
"""Add hostapd interface with driver specified"""
ifname = apdev[0]['ifname']

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import os
import time
@ -230,6 +231,7 @@ def test_ap_ft_over_ds_many(dev, apdev):
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
roams=50)
@remote_compatible
def test_ap_ft_over_ds_unknown_target(dev, apdev):
"""WPA2-PSK-FT AP"""
ssid = "test-ft"
@ -242,6 +244,7 @@ def test_ap_ft_over_ds_unknown_target(dev, apdev):
scan_freq="2412")
dev[0].roam_over_ds("02:11:22:33:44:55", fail_test=True)
@remote_compatible
def test_ap_ft_over_ds_unexpected(dev, apdev):
"""WPA2-PSK-FT AP over DS and unexpected response"""
ssid = "test-ft"
@ -473,6 +476,7 @@ def test_ap_ft_eap_pull(dev, apdev):
run_roams(dev[0], apdev, hapd, hapd1, ssid, passphrase, eap=True)
@remote_compatible
def test_ap_ft_mismatching_rrb_key_push(dev, apdev):
"""WPA2-PSK-FT AP over DS with mismatching RRB key (push)"""
ssid = "test-ft"
@ -488,6 +492,7 @@ def test_ap_ft_mismatching_rrb_key_push(dev, apdev):
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
fail_test=True)
@remote_compatible
def test_ap_ft_mismatching_rrb_key_pull(dev, apdev):
"""WPA2-PSK-FT AP over DS with mismatching RRB key (pull)"""
ssid = "test-ft"
@ -503,6 +508,7 @@ def test_ap_ft_mismatching_rrb_key_pull(dev, apdev):
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
fail_test=True)
@remote_compatible
def test_ap_ft_mismatching_r0kh_id_pull(dev, apdev):
"""WPA2-PSK-FT AP over DS with mismatching R0KH-ID (pull)"""
ssid = "test-ft"
@ -522,6 +528,7 @@ def test_ap_ft_mismatching_r0kh_id_pull(dev, apdev):
dev[0].scan_for_bss(apdev[1]['bssid'], freq="2412")
dev[0].roam_over_ds(apdev[1]['bssid'], fail_test=True)
@remote_compatible
def test_ap_ft_mismatching_rrb_r0kh_push(dev, apdev):
"""WPA2-PSK-FT AP over DS with mismatching R0KH key (push)"""
ssid = "test-ft"
@ -537,6 +544,7 @@ def test_ap_ft_mismatching_rrb_r0kh_push(dev, apdev):
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
fail_test=True)
@remote_compatible
def test_ap_ft_mismatching_rrb_r0kh_pull(dev, apdev):
"""WPA2-PSK-FT AP over DS with mismatching R0KH key (pull)"""
ssid = "test-ft"
@ -693,6 +701,7 @@ def test_ft_psk_key_lifetime_in_memory(dev, apdev, params):
verify_not_present(buf, tk, fname, "TK")
verify_not_present(buf, gtk, fname, "GTK")
@remote_compatible
def test_ap_ft_invalid_resp(dev, apdev):
"""WPA2-PSK-FT AP and invalid response IEs"""
ssid = "test-ft"
@ -844,6 +853,7 @@ def test_ap_ft_over_ds_proto(dev, apdev):
msg['payload'] = binascii.unhexlify("0602020000000000" + "020000000400" + "0000" + "3603a1b201" + "3766000000000000000000000000000000000000c4e67ac1999bebd00ff4ae4d5dcaf87896bb060b469f7c78d49623fb395c3455ffffff6b693fe6f8d8c5dfac0a22344750775bd09437f98b238c9f87b97f790c0106000102030406030a6e6173312e77312e6669")
hapd0.mgmt_tx(msg)
@remote_compatible
def test_ap_ft_rrb(dev, apdev):
"""WPA2-PSK-FT RRB protocol testing"""
ssid = "test-ft"
@ -935,6 +945,7 @@ def test_ap_ft_rrb(dev, apdev):
if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)):
raise Exception("DATA_TEST_FRAME failed")
@remote_compatible
def test_rsn_ie_proto_ft_psk_sta(dev, apdev):
"""RSN element protocol testing for FT-PSK + PMF cases on STA side"""
bssid = apdev[0]['bssid']

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import base64
import binascii
import struct
@ -314,6 +315,7 @@ def test_ap_nai_home_realm_query(dev, apdev):
if "NAI Realm list" not in ev:
raise Exception("Missing NAI Realm list: " + ev)
@remote_compatible
def test_ap_interworking_scan_filtering(dev, apdev):
"""Interworking scan filtering with HESSID and access network type"""
try:
@ -594,6 +596,7 @@ def test_ap_hs20_auto_interworking(dev, apdev):
if status['hs20'] != "2":
raise Exception("Unexpected HS 2.0 support indication")
@remote_compatible
def test_ap_hs20_auto_interworking_no_match(dev, apdev):
"""Hotspot 2.0 connection with auto_interworking=1 and no matching network"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "mismatch" })
@ -633,6 +636,7 @@ def test_ap_hs20_auto_interworking_no_match(dev, apdev):
dev[0].dump_monitor()
dev[0].request("DISCONNECT")
@remote_compatible
def test_ap_hs20_auto_interworking_no_cred_match(dev, apdev):
"""Hotspot 2.0 connection with auto_interworking=1 but no cred match"""
bssid = apdev[0]['bssid']
@ -669,6 +673,7 @@ def eap_test(dev, ap, eap_params, method, user):
interworking_select(dev, bssid, freq="2412")
interworking_connect(dev, bssid, method)
@remote_compatible
def test_ap_hs20_eap_unknown(dev, apdev):
"""Hotspot 2.0 connection with unknown EAP method"""
bssid = apdev[0]['bssid']
@ -694,6 +699,7 @@ def test_ap_hs20_eap_peap_gtc(dev, apdev):
"""Hotspot 2.0 connection with PEAP/GTC"""
eap_test(dev[0], apdev[0], "25[3:6]", "PEAP", "user")
@remote_compatible
def test_ap_hs20_eap_peap_unknown(dev, apdev):
"""Hotspot 2.0 connection with PEAP/unknown"""
bssid = apdev[0]['bssid']
@ -720,6 +726,7 @@ def test_ap_hs20_eap_ttls_eap_mschapv2(dev, apdev):
check_eap_capa(dev[0], "MSCHAPV2")
eap_test(dev[0], apdev[0], "21[3:26][6:7][99:99]", "TTLS", "user")
@remote_compatible
def test_ap_hs20_eap_ttls_eap_unknown(dev, apdev):
"""Hotspot 2.0 connection with TTLS/EAP-unknown"""
bssid = apdev[0]['bssid']
@ -731,6 +738,7 @@ def test_ap_hs20_eap_ttls_eap_unknown(dev, apdev):
dev[0].add_cred_values(default_cred())
interworking_select(dev[0], None, no_match=True, freq="2412")
@remote_compatible
def test_ap_hs20_eap_ttls_eap_unsupported(dev, apdev):
"""Hotspot 2.0 connection with TTLS/EAP-OTP(unsupported)"""
bssid = apdev[0]['bssid']
@ -742,6 +750,7 @@ def test_ap_hs20_eap_ttls_eap_unsupported(dev, apdev):
dev[0].add_cred_values(default_cred())
interworking_select(dev[0], None, no_match=True, freq="2412")
@remote_compatible
def test_ap_hs20_eap_ttls_unknown(dev, apdev):
"""Hotspot 2.0 connection with TTLS/unknown"""
bssid = apdev[0]['bssid']
@ -779,6 +788,7 @@ def test_ap_hs20_eap_tls(dev, apdev):
interworking_select(dev[0], bssid, freq="2412")
interworking_connect(dev[0], bssid, "TLS")
@remote_compatible
def test_ap_hs20_eap_cert_unknown(dev, apdev):
"""Hotspot 2.0 connection with certificate, but unknown EAP method"""
bssid = apdev[0]['bssid']
@ -794,6 +804,7 @@ def test_ap_hs20_eap_cert_unknown(dev, apdev):
'private_key': "auth_serv/user.key"})
interworking_select(dev[0], None, no_match=True, freq="2412")
@remote_compatible
def test_ap_hs20_eap_cert_unsupported(dev, apdev):
"""Hotspot 2.0 connection with certificate, but unsupported TTLS"""
bssid = apdev[0]['bssid']
@ -809,6 +820,7 @@ def test_ap_hs20_eap_cert_unsupported(dev, apdev):
'private_key': "auth_serv/user.key"})
interworking_select(dev[0], None, no_match=True, freq="2412")
@remote_compatible
def test_ap_hs20_eap_invalid_cred(dev, apdev):
"""Hotspot 2.0 connection with invalid cred configuration"""
bssid = apdev[0]['bssid']

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -65,6 +66,7 @@ def test_ap_ht40_scan(dev, apdev):
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
@remote_compatible
def test_ap_ht40_scan_conflict(dev, apdev):
"""HT40 co-ex scan conflict"""
clear_scan_cache(apdev[0])
@ -105,6 +107,7 @@ def test_ap_ht40_scan_conflict(dev, apdev):
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
@remote_compatible
def test_ap_ht40_scan_conflict2(dev, apdev):
"""HT40 co-ex scan conflict (HT40-)"""
clear_scan_cache(apdev[0])
@ -192,6 +195,7 @@ def test_ap_ht40_scan_not_affected(dev, apdev):
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
@remote_compatible
def test_ap_ht40_scan_legacy_conflict(dev, apdev):
"""HT40 co-ex scan conflict with legacy 20 MHz AP"""
clear_scan_cache(apdev[0])
@ -231,6 +235,7 @@ def test_ap_ht40_scan_legacy_conflict(dev, apdev):
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
@remote_compatible
def test_ap_ht40_scan_ht20_conflict(dev, apdev):
"""HT40 co-ex scan conflict with HT 20 MHz AP"""
clear_scan_cache(apdev[0])
@ -787,6 +792,7 @@ def test_ap_require_ht(dev, apdev):
ampdu_density="1", disable_ht40="1", disable_sgi="1",
disable_ldpc="1")
@remote_compatible
def test_ap_require_ht_limited_rates(dev, apdev):
"""Require HT with limited supported rates"""
params = { "ssid": "require-ht",
@ -804,6 +810,7 @@ def test_ap_require_ht_limited_rates(dev, apdev):
if "status_code=27" not in ev:
raise Exception("Unexpected rejection status code")
@remote_compatible
def test_ap_ht_capab_not_supported(dev, apdev):
"""HT configuration with driver not supporting all ht_capab entries"""
params = { "ssid": "test-ht40",
@ -1028,6 +1035,7 @@ def test_ap_ht40_csa3(dev, apdev):
set_world_reg(apdev[0], None, dev[0])
dev[0].flush_scan_cache()
@remote_compatible
def test_ap_ht_smps(dev, apdev):
"""SMPS AP configuration options"""
params = { "ssid": "ht1", "ht_capab": "[SMPS-STATIC]" }
@ -1043,6 +1051,7 @@ def test_ap_ht_smps(dev, apdev):
hwsim_utils.test_connectivity(dev[0], hapd)
hwsim_utils.test_connectivity(dev[1], hapd2)
@remote_compatible
def test_prefer_ht20(dev, apdev):
"""Preference on HT20 over no-HT"""
params = { "ssid": "test",
@ -1098,6 +1107,7 @@ def test_prefer_ht40(dev, apdev):
if est != "135000":
raise Exception("Unexpected BSS1 est_throughput: " + est)
@remote_compatible
def test_prefer_ht20_during_roam(dev, apdev):
"""Preference on HT20 over no-HT in roaming consideration"""
params = { "ssid": "test",
@ -1121,6 +1131,7 @@ def test_prefer_ht20_during_roam(dev, apdev):
if dev[0].get_status_field('bssid') != bssid2:
raise Exception("Unexpected BSS selected")
@remote_compatible
def test_ap_ht40_5ghz_invalid_pair(dev, apdev):
"""HT40 on 5 GHz with invalid channel pair"""
clear_scan_cache(apdev[0])
@ -1141,6 +1152,7 @@ def test_ap_ht40_5ghz_invalid_pair(dev, apdev):
finally:
set_world_reg(apdev[0], None, None)
@remote_compatible
def test_ap_ht40_5ghz_disabled_sec(dev, apdev):
"""HT40 on 5 GHz with disabled secondary channel"""
clear_scan_cache(apdev[0])

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import struct
@ -17,6 +18,7 @@ from tshark import run_tshark
from utils import alloc_fail
from wpasupplicant import WpaSupplicant
@remote_compatible
def test_ap_open(dev, apdev):
"""AP with open mode (no security) configuration"""
_test_ap_open(dev, apdev)
@ -49,6 +51,7 @@ def test_ap_open_packet_loss(dev, apdev):
for i in range(0, 3):
dev[i].wait_connected(timeout=20)
@remote_compatible
def test_ap_open_unknown_action(dev, apdev):
"""AP with open mode configuration and unknown Action frame"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -75,6 +78,7 @@ def test_ap_open_invalid_wmm_action(dev, apdev):
if ev is None or "result=SUCCESS" not in ev:
raise Exception("AP did not ack Action frame")
@remote_compatible
def test_ap_open_reconnect_on_inactivity_disconnect(dev, apdev):
"""Reconnect to open mode AP after inactivity related disconnection"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -83,6 +87,7 @@ def test_ap_open_reconnect_on_inactivity_disconnect(dev, apdev):
dev[0].wait_disconnected(timeout=5)
dev[0].wait_connected(timeout=2, error="Timeout on reconnection")
@remote_compatible
def test_ap_open_assoc_timeout(dev, apdev):
"""AP timing out association"""
ssid = "test"
@ -123,6 +128,7 @@ def test_ap_open_assoc_timeout(dev, apdev):
hapd.set("ext_mgmt_frame_handling", "0")
dev[0].wait_connected(timeout=15)
@remote_compatible
def test_ap_open_id_str(dev, apdev):
"""AP with open mode and id_str"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -134,6 +140,7 @@ def test_ap_open_id_str(dev, apdev):
if dev[0].get_status_field("id_str") != "foo":
raise Exception("id_str mismatch")
@remote_compatible
def test_ap_open_select_any(dev, apdev):
"""AP with open mode and select any network"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -152,6 +159,7 @@ def test_ap_open_select_any(dev, apdev):
dev[0].select_network("any")
dev[0].wait_connected(timeout=10)
@remote_compatible
def test_ap_open_unexpected_assoc_event(dev, apdev):
"""AP with open mode and unexpected association event"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -173,6 +181,7 @@ def test_ap_open_unexpected_assoc_event(dev, apdev):
apdev[0]['bssid']])
dev[0].wait_disconnected(timeout=15)
@remote_compatible
def test_ap_bss_load(dev, apdev):
"""AP with open mode (no security) configuration"""
hapd = hostapd.add_ap(apdev[0],
@ -300,6 +309,7 @@ def _test_ap_open_wpas_in_bridge(dev, apdev):
wpas.connect("open", key_mgmt="NONE", scan_freq="2412")
@remote_compatible
def test_ap_open_start_disabled(dev, apdev):
"""AP with open mode and beaconing disabled"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open",
@ -315,6 +325,7 @@ def test_ap_open_start_disabled(dev, apdev):
dev[0].scan_for_bss(bssid, freq=2412)
dev[0].connect("open", key_mgmt="NONE", scan_freq="2412")
@remote_compatible
def test_ap_open_start_disabled2(dev, apdev):
"""AP with open mode and beaconing disabled (2)"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open",
@ -336,6 +347,7 @@ def test_ap_open_start_disabled2(dev, apdev):
dev[0].request("RECONNECT")
dev[0].wait_connected()
@remote_compatible
def test_ap_open_ifdown(dev, apdev):
"""AP with open mode and external ifconfig down"""
params = { "ssid": "open",
@ -409,6 +421,7 @@ def test_ap_open_disconnect_in_ps(dev, apdev, params):
if state != 2:
raise Exception("Didn't observe TIM bit getting set and unset (state=%d)" % state)
@remote_compatible
def test_ap_open_select_network(dev, apdev):
"""Open mode connection and SELECT_NETWORK to change network"""
hapd1 = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -435,6 +448,7 @@ def test_ap_open_select_network(dev, apdev):
if bssid1 in res or bssid2 in res:
raise Exception("Unexpected blacklist entry(2)")
@remote_compatible
def test_ap_open_disable_enable(dev, apdev):
"""AP with open mode getting disabled and re-enabled"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -486,6 +500,7 @@ def test_ap_open_sta_enable_disable(dev, apdev):
wpas.interface_add("wlan5", drv_params="force_connect_cmd=1")
sta_enable_disable(wpas, bssid)
@remote_compatible
def test_ap_open_select_twice(dev, apdev):
"""AP with open mode and select network twice"""
id = dev[0].connect("open", key_mgmt="NONE", scan_freq="2412",
@ -500,6 +515,7 @@ def test_ap_open_select_twice(dev, apdev):
dev[0].select_network(id)
dev[0].wait_connected(timeout=3)
@remote_compatible
def test_ap_open_reassoc_not_found(dev, apdev):
"""AP with open mode and REASSOCIATE not finding a match"""
id = dev[0].connect("open", key_mgmt="NONE", scan_freq="2412",
@ -519,6 +535,7 @@ def test_ap_open_reassoc_not_found(dev, apdev):
raise Exception("No result reported")
dev[0].request("DISCONNECT")
@remote_compatible
def test_ap_open_sta_statistics(dev, apdev):
"""AP with open mode and STA statistics"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -538,6 +555,7 @@ def test_ap_open_sta_statistics(dev, apdev):
# unrelated traffic, so for now, just print out the results in the log for
# manual checks.
@remote_compatible
def test_ap_open_poll_sta(dev, apdev):
"""AP with open mode and STA poll"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import os
@ -13,6 +14,7 @@ import hostapd
from tshark import run_tshark
from utils import alloc_fail
@remote_compatible
def test_ap_fragmentation_rts_set_high(dev, apdev):
"""WPA2-PSK AP with fragmentation and RTS thresholds larger than frame length"""
ssid = "test-wpa2-psk"
@ -24,6 +26,7 @@ def test_ap_fragmentation_rts_set_high(dev, apdev):
dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_fragmentation_open(dev, apdev):
"""Open AP with fragmentation threshold"""
ssid = "fragmentation"
@ -34,6 +37,7 @@ def test_ap_fragmentation_open(dev, apdev):
dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_fragmentation_wpa2(dev, apdev):
"""WPA2-PSK AP with fragmentation threshold"""
ssid = "test-wpa2-psk"
@ -80,6 +84,7 @@ def test_ap_element_parse(dev, apdev):
if "38050102030405" not in bss['ie']:
raise Exception("Timeout element not shown in scan results")
@remote_compatible
def test_ap_element_parse_oom(dev, apdev):
"""Information element parsing OOM"""
bssid = apdev[0]['bssid']
@ -150,6 +155,7 @@ def test_ap_acl_deny(dev, apdev):
if ev is not None:
raise Exception("Unexpected association")
@remote_compatible
def test_ap_wds_sta(dev, apdev):
"""WPA2-PSK AP with STA using 4addr mode"""
ssid = "test-wpa2-psk"
@ -172,6 +178,7 @@ def test_ap_wds_sta(dev, apdev):
dev[0].cmd_execute(['ip', 'link', 'set', 'dev', 'wds-br0', 'down'])
dev[0].cmd_execute(['brctl', 'delbr', 'wds-br0'])
@remote_compatible
def test_ap_inactivity_poll(dev, apdev):
"""AP using inactivity poll"""
ssid = "test-wpa2-psk"
@ -190,6 +197,7 @@ def test_ap_inactivity_poll(dev, apdev):
if ev is None:
raise Exception("STA disconnection on inactivity was not reported")
@remote_compatible
def test_ap_inactivity_disconnect(dev, apdev):
"""AP using inactivity disconnect"""
ssid = "test-wpa2-psk"
@ -209,6 +217,7 @@ def test_ap_inactivity_disconnect(dev, apdev):
if ev is None:
raise Exception("STA disconnection on inactivity was not reported")
@remote_compatible
def test_ap_basic_rates(dev, apdev):
"""Open AP with lots of basic rates"""
ssid = "basic rates"
@ -218,6 +227,7 @@ def test_ap_basic_rates(dev, apdev):
hostapd.add_ap(apdev[0], params)
dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
@remote_compatible
def test_ap_short_preamble(dev, apdev):
"""Open AP with short preamble"""
ssid = "short preamble"
@ -249,6 +259,7 @@ def test_ap_spectrum_management_required(dev, apdev):
hostapd.cmd_execute(apdev[0], ['iw', 'reg', 'set', '00'])
dev[0].flush_scan_cache()
@remote_compatible
def test_ap_max_listen_interval(dev, apdev):
"""Open AP with maximum listen interval limit"""
ssid = "listen"
@ -263,6 +274,7 @@ def test_ap_max_listen_interval(dev, apdev):
if "status_code=51" not in ev:
raise Exception("Unexpected ASSOC-REJECT reason")
@remote_compatible
def test_ap_max_num_sta(dev, apdev):
"""Open AP with maximum STA count"""
ssid = "max"
@ -305,6 +317,7 @@ def test_ap_max_num_sta_no_probe_resp(dev, apdev, params):
if seen:
raise Exception("AP found unexpectedly")
@remote_compatible
def test_ap_tx_queue_params(dev, apdev):
"""Open AP with TX queue params set"""
ssid = "tx"

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -13,6 +14,7 @@ import hostapd
from wlantest import Wlantest
from wpasupplicant import WpaSupplicant
@remote_compatible
def test_ap_pmf_required(dev, apdev):
"""WPA2-PSK AP with PMF required"""
ssid = "test-pmf-required"
@ -50,6 +52,7 @@ def test_ap_pmf_required(dev, apdev):
dev[1].p2p_interface_addr()) < 1:
raise Exception("STA did not reply to SA Query")
@remote_compatible
def test_ap_pmf_optional(dev, apdev):
"""WPA2-PSK AP with PMF optional"""
ssid = "test-pmf-optional"
@ -73,6 +76,7 @@ def test_ap_pmf_optional(dev, apdev):
wt.require_sta_pmf(apdev[0]['bssid'], dev[0].p2p_interface_addr())
wt.require_sta_pmf_mandatory(apdev[0]['bssid'], dev[1].p2p_interface_addr())
@remote_compatible
def test_ap_pmf_optional_2akm(dev, apdev):
"""WPA2-PSK AP with PMF optional (2 AKMs)"""
ssid = "test-pmf-optional-2akm"
@ -100,6 +104,7 @@ def test_ap_pmf_optional_2akm(dev, apdev):
wt.require_sta_key_mgmt(apdev[0]['bssid'], dev[1].p2p_interface_addr(),
"PSK-SHA256")
@remote_compatible
def test_ap_pmf_negative(dev, apdev):
"""WPA2-PSK AP without PMF (negative test)"""
ssid = "test-pmf-negative"
@ -123,6 +128,7 @@ def test_ap_pmf_negative(dev, apdev):
logger.debug("Ignore expected exception: " + str(e))
wt.require_ap_no_pmf(apdev[0]['bssid'])
@remote_compatible
def test_ap_pmf_assoc_comeback(dev, apdev):
"""WPA2-PSK AP with PMF association comeback"""
ssid = "assoc-comeback"
@ -147,6 +153,7 @@ def test_ap_pmf_assoc_comeback(dev, apdev):
dev[0].p2p_interface_addr()) < 1:
raise Exception("AP did not use association comeback request")
@remote_compatible
def test_ap_pmf_assoc_comeback2(dev, apdev):
"""WPA2-PSK AP with PMF association comeback (using DROP_SA)"""
ssid = "assoc-comeback"
@ -354,6 +361,7 @@ def test_ap_pmf_optional_eap(dev, apdev):
ca_cert="auth_serv/ca.pem", phase2="auth=PAP",
ieee80211w="2", scan_freq="2412")
@remote_compatible
def test_ap_pmf_required_sha1(dev, apdev):
"""WPA2-PSK AP with PMF required with SHA1 AKM"""
ssid = "test-pmf-required-sha1"
@ -374,6 +382,7 @@ def test_ap_pmf_required_sha1(dev, apdev):
raise Exception("Scan results missing RSN element info")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_pmf_toggle(dev, apdev):
"""WPA2-PSK AP with PMF optional and changing PMF on reassociation"""
try:
@ -429,6 +438,7 @@ def _test_ap_pmf_toggle(dev, apdev):
if "yes" not in [l for l in data.splitlines() if "MFP" in l][0]:
raise Exception("Kernel STA entry did not have MFP enabled")
@remote_compatible
def test_ap_pmf_required_sta_no_pmf(dev, apdev):
"""WPA2-PSK AP with PMF required and PMF disabled on STA"""
ssid = "test-pmf-required"

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
from Crypto.Cipher import AES
import hashlib
@ -27,6 +28,7 @@ def check_mib(dev, vals):
if mib[v[0]] != v[1]:
raise Exception("Unexpected {} = {} (expected {})".format(v[0], mib[v[0]], v[1]))
@remote_compatible
def test_ap_wpa2_psk(dev, apdev):
"""WPA2-PSK AP with PSK instead of passphrase"""
ssid = "test-wpa2-psk"
@ -68,6 +70,7 @@ def test_ap_wpa2_psk_file(dev, apdev):
raise Exception("Timed out while waiting for failure report")
dev[1].request("REMOVE_NETWORK all")
@remote_compatible
def test_ap_wpa2_psk_mem(dev, apdev):
"""WPA2-PSK AP with passphrase only in memory"""
try:
@ -102,6 +105,7 @@ def _test_ap_wpa2_psk_mem(dev, apdev):
dev[1].request("CTRL-RSP-PSK_PASSPHRASE-" + id + ':' + psk)
dev[1].wait_connected(timeout=10)
@remote_compatible
def test_ap_wpa2_ptk_rekey(dev, apdev):
"""WPA2-PSK AP and PTK rekey enforced by station"""
ssid = "test-wpa2-psk"
@ -114,6 +118,7 @@ def test_ap_wpa2_ptk_rekey(dev, apdev):
raise Exception("PTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa2_ptk_rekey_ap(dev, apdev):
"""WPA2-PSK AP and PTK rekey enforced by AP"""
ssid = "test-wpa2-psk"
@ -127,6 +132,7 @@ def test_ap_wpa2_ptk_rekey_ap(dev, apdev):
raise Exception("PTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa2_sha256_ptk_rekey(dev, apdev):
"""WPA2-PSK/SHA256 AKM AP and PTK rekey enforced by station"""
ssid = "test-wpa2-psk"
@ -143,6 +149,7 @@ def test_ap_wpa2_sha256_ptk_rekey(dev, apdev):
check_mib(dev[0], [ ("dot11RSNAAuthenticationSuiteRequested", "00-0f-ac-6"),
("dot11RSNAAuthenticationSuiteSelected", "00-0f-ac-6") ])
@remote_compatible
def test_ap_wpa2_sha256_ptk_rekey_ap(dev, apdev):
"""WPA2-PSK/SHA256 AKM AP and PTK rekey enforced by AP"""
ssid = "test-wpa2-psk"
@ -160,6 +167,7 @@ def test_ap_wpa2_sha256_ptk_rekey_ap(dev, apdev):
check_mib(dev[0], [ ("dot11RSNAAuthenticationSuiteRequested", "00-0f-ac-6"),
("dot11RSNAAuthenticationSuiteSelected", "00-0f-ac-6") ])
@remote_compatible
def test_ap_wpa_ptk_rekey(dev, apdev):
"""WPA-PSK/TKIP AP and PTK rekey enforced by station"""
skip_with_fips(dev[0])
@ -175,6 +183,7 @@ def test_ap_wpa_ptk_rekey(dev, apdev):
raise Exception("PTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa_ptk_rekey_ap(dev, apdev):
"""WPA-PSK/TKIP AP and PTK rekey enforced by AP"""
skip_with_fips(dev[0])
@ -189,6 +198,7 @@ def test_ap_wpa_ptk_rekey_ap(dev, apdev):
raise Exception("PTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa_ccmp(dev, apdev):
"""WPA-PSK/CCMP"""
ssid = "test-wpa-psk"
@ -270,6 +280,7 @@ def test_ap_wpa2_psk_file(dev, apdev):
except:
pass
@remote_compatible
def test_ap_wpa2_psk_wildcard_ssid(dev, apdev):
"""WPA2-PSK AP and wildcard SSID configuration"""
ssid = "test-wpa2-psk"
@ -281,6 +292,7 @@ def test_ap_wpa2_psk_wildcard_ssid(dev, apdev):
scan_freq="2412")
dev[1].connect("", bssid=apdev[0]['bssid'], raw_psk=psk, scan_freq="2412")
@remote_compatible
def test_ap_wpa2_gtk_rekey(dev, apdev):
"""WPA2-PSK AP and GTK rekey enforced by AP"""
ssid = "test-wpa2-psk"
@ -294,6 +306,7 @@ def test_ap_wpa2_gtk_rekey(dev, apdev):
raise Exception("GTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa_gtk_rekey(dev, apdev):
"""WPA-PSK/TKIP AP and GTK rekey enforced by AP"""
skip_with_fips(dev[0])
@ -308,6 +321,7 @@ def test_ap_wpa_gtk_rekey(dev, apdev):
raise Exception("GTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa2_gmk_rekey(dev, apdev):
"""WPA2-PSK AP and GMK and GTK rekey enforced by AP"""
ssid = "test-wpa2-psk"
@ -323,6 +337,7 @@ def test_ap_wpa2_gmk_rekey(dev, apdev):
raise Exception("GTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa2_strict_rekey(dev, apdev):
"""WPA2-PSK AP and strict GTK rekey enforced by AP"""
ssid = "test-wpa2-psk"
@ -338,6 +353,7 @@ def test_ap_wpa2_strict_rekey(dev, apdev):
raise Exception("GTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa2_bridge_fdb(dev, apdev):
"""Bridge FDB entry removal"""
hapd = None
@ -372,6 +388,7 @@ def test_ap_wpa2_bridge_fdb(dev, apdev):
'down'])
hostapd.cmd_execute(apdev[0], ['brctl', 'delbr', 'ap-br0'])
@remote_compatible
def test_ap_wpa2_already_in_bridge(dev, apdev):
"""hostapd behavior with interface already in bridge"""
ifname = apdev[0]['ifname']
@ -397,6 +414,7 @@ def test_ap_wpa2_already_in_bridge(dev, apdev):
hostapd.cmd_execute(apdev[0], ['iw', ifname, 'set', 'type', 'station'])
hostapd.cmd_execute(apdev[0], ['brctl', 'delbr', br_ifname])
@remote_compatible
def test_ap_wpa2_in_different_bridge(dev, apdev):
"""hostapd behavior with interface in different bridge"""
ifname = apdev[0]['ifname']
@ -435,6 +453,7 @@ def test_ap_wpa2_in_different_bridge(dev, apdev):
"2>", "/dev/null"], shell=True)
hostapd.cmd_execute(apdev[0], ['brctl', 'delbr', br_ifname])
@remote_compatible
def test_ap_wpa2_ext_add_to_bridge(dev, apdev):
"""hostapd behavior with interface added to bridge externally"""
ifname = apdev[0]['ifname']
@ -711,6 +730,7 @@ def eapol_test(apdev, dev, wpa2=True):
snonce = binascii.unhexlify('1111111111111111111111111111111111111111111111111111111111111111')
return (bssid,ssid,hapd,snonce,pmk,addr,rsne)
@remote_compatible
def test_ap_wpa2_psk_ext_eapol(dev, apdev):
"""WPA2-PSK AP using external EAPOL supplicant"""
(bssid,ssid,hapd,snonce,pmk,addr,rsne) = eapol_test(apdev[0], dev[0])
@ -738,6 +758,7 @@ def test_ap_wpa2_psk_ext_eapol(dev, apdev):
reply_eapol("4/4", hapd, addr, msg, 0x030a, None, None, kck)
hapd_connected(hapd)
@remote_compatible
def test_ap_wpa2_psk_ext_eapol_retry1(dev, apdev):
"""WPA2 4-way handshake with EAPOL-Key 1/4 retransmitted"""
(bssid,ssid,hapd,snonce,pmk,addr,rsne) = eapol_test(apdev[0], dev[0])
@ -764,6 +785,7 @@ def test_ap_wpa2_psk_ext_eapol_retry1(dev, apdev):
reply_eapol("4/4", hapd, addr, msg, 0x030a, None, None, kck)
hapd_connected(hapd)
@remote_compatible
def test_ap_wpa2_psk_ext_eapol_retry1b(dev, apdev):
"""WPA2 4-way handshake with EAPOL-Key 1/4 and 2/4 retransmitted"""
(bssid,ssid,hapd,snonce,pmk,addr,rsne) = eapol_test(apdev[0], dev[0])
@ -785,6 +807,7 @@ def test_ap_wpa2_psk_ext_eapol_retry1b(dev, apdev):
reply_eapol("4/4", hapd, addr, msg, 0x030a, None, None, kck)
hapd_connected(hapd)
@remote_compatible
def test_ap_wpa2_psk_ext_eapol_retry1c(dev, apdev):
"""WPA2 4-way handshake with EAPOL-Key 1/4 and 2/4 retransmitted and SNonce changing"""
(bssid,ssid,hapd,snonce,pmk,addr,rsne) = eapol_test(apdev[0], dev[0])
@ -808,6 +831,7 @@ def test_ap_wpa2_psk_ext_eapol_retry1c(dev, apdev):
reply_eapol("4/4", hapd, addr, msg, 0x030a, None, None, kck)
hapd_connected(hapd)
@remote_compatible
def test_ap_wpa2_psk_ext_eapol_retry1d(dev, apdev):
"""WPA2 4-way handshake with EAPOL-Key 1/4 and 2/4 retransmitted and SNonce changing and older used"""
(bssid,ssid,hapd,snonce,pmk,addr,rsne) = eapol_test(apdev[0], dev[0])
@ -831,6 +855,7 @@ def test_ap_wpa2_psk_ext_eapol_retry1d(dev, apdev):
reply_eapol("4/4", hapd, addr, msg, 0x030a, None, None, kck)
hapd_connected(hapd)
@remote_compatible
def test_ap_wpa2_psk_ext_eapol_type_diff(dev, apdev):
"""WPA2 4-way handshake using external EAPOL supplicant"""
(bssid,ssid,hapd,snonce,pmk,addr,rsne) = eapol_test(apdev[0], dev[0])
@ -861,6 +886,7 @@ def test_ap_wpa2_psk_ext_eapol_type_diff(dev, apdev):
reply_eapol("4/4", hapd, addr, msg, 0x030a, None, None, kck)
hapd_connected(hapd)
@remote_compatible
def test_ap_wpa_psk_ext_eapol(dev, apdev):
"""WPA2-PSK AP using external EAPOL supplicant"""
(bssid,ssid,hapd,snonce,pmk,addr,wpae) = eapol_test(apdev[0], dev[0],
@ -888,6 +914,7 @@ def test_ap_wpa_psk_ext_eapol(dev, apdev):
reply_eapol("4/4", hapd, addr, msg, 0x030a, None, None, kck)
hapd_connected(hapd)
@remote_compatible
def test_ap_wpa2_psk_ext_eapol_key_info(dev, apdev):
"""WPA2-PSK 4-way handshake with strange key info values"""
(bssid,ssid,hapd,snonce,pmk,addr,rsne) = eapol_test(apdev[0], dev[0])
@ -1364,6 +1391,7 @@ def test_ap_wpa2_psk_supp_proto_unexpected_group_msg(dev, apdev):
raise Exception("Unexpected group key message not reported")
dev[0].wait_disconnected(timeout=1)
@remote_compatible
def test_ap_wpa2_psk_supp_proto_msg_1_invalid_kde(dev, apdev):
"""WPA2-PSK supplicant protocol testing: invalid KDE in msg 1/4"""
(bssid,ssid,hapd,snonce,pmk,addr,rsne) = eapol_test(apdev[0], dev[0])
@ -1840,6 +1868,7 @@ def test_wpa2_psk_key_lifetime_in_memory(dev, apdev, params):
verify_not_present(buf, tk, fname, "TK")
verify_not_present(buf, gtk, fname, "GTK")
@remote_compatible
def test_ap_wpa2_psk_wep(dev, apdev):
"""WPA2-PSK AP and WEP enabled"""
ssid = "test-wpa2-psk"
@ -1884,6 +1913,7 @@ def _test_ap_wpa2_psk_wpas_in_bridge(dev, apdev):
wpas.connect(ssid, psk=passphrase, scan_freq="2412")
wpas.dump_monitor()
@remote_compatible
def test_ap_wpa2_psk_ifdown(dev, apdev):
"""AP with open mode and external ifconfig down"""
ssid = "test-wpa2-psk"
@ -1973,6 +2003,7 @@ def test_ap_wpa2_psk_drop_first_msg_4(dev, apdev):
# case, this exception can be uncommented here.
#raise Exception("Unexpected disconnection")
@remote_compatible
def test_ap_wpa2_psk_disable_enable(dev, apdev):
"""WPA2-PSK AP getting disabled and re-enabled"""
ssid = "test-wpa2-psk"
@ -1990,6 +2021,7 @@ def test_ap_wpa2_psk_disable_enable(dev, apdev):
dev[0].wait_connected()
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_wpa2_psk_incorrect_passphrase(dev, apdev):
"""WPA2-PSK AP and station using incorrect passphrase"""
ssid = "test-wpa2-psk"
@ -2009,6 +2041,7 @@ def test_ap_wpa2_psk_incorrect_passphrase(dev, apdev):
dev[0].wait_connected(timeout=20)
@remote_compatible
def test_ap_wpa_ie_parsing(dev, apdev):
"""WPA IE parsing"""
skip_with_fips(dev[0])
@ -2069,6 +2102,7 @@ def test_ap_wpa_ie_parsing(dev, apdev):
finally:
dev[0].request("VENDOR_ELEM_REMOVE 13 *")
@remote_compatible
def test_ap_wpa2_psk_no_random(dev, apdev):
"""WPA2-PSK AP and no random numbers available"""
ssid = "test-wpa2-psk"
@ -2087,6 +2121,7 @@ def test_ap_wpa2_psk_no_random(dev, apdev):
dev[0].select_network(id, freq=2412)
dev[0].wait_connected()
@remote_compatible
def test_rsn_ie_proto_psk_sta(dev, apdev):
"""RSN element protocol testing for PSK cases on STA side"""
bssid = apdev[0]['bssid']
@ -2126,6 +2161,7 @@ def test_rsn_ie_proto_psk_sta(dev, apdev):
dev[0].select_network(id, freq=2412)
dev[0].wait_connected()
@remote_compatible
def test_ap_cli_order(dev, apdev):
ssid = "test-rsn-setup"
passphrase = 'zzzzzzzz'
@ -2155,6 +2191,7 @@ def set_test_assoc_ie(dev, ie):
if "OK" not in dev.request("TEST_ASSOC_IE " + ie):
raise Exception("Could not set TEST_ASSOC_IE")
@remote_compatible
def test_ap_wpa2_psk_assoc_rsn(dev, apdev):
"""WPA2-PSK AP and association request RSN IE differences"""
ssid = "test-wpa2-psk"

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -33,6 +34,7 @@ def check_qos_map(ap, hapd, dev, sta, dscp, tid, ap_tid=None):
logger.info("Expected RX DSCP " + str(dscp) + " with TID " + str(ap_tid) + " but counters: " + str(rx))
raise Exception("No AP->STA data frame using the expected TID")
@remote_compatible
def test_ap_qosmap(dev, apdev):
"""QoS mapping"""
drv_flags = dev[0].get_driver_status_field("capa.flags")
@ -72,6 +74,7 @@ def test_ap_qosmap(dev, apdev):
dev[0].request("DATA_TEST_CONFIG 0")
hapd.request("DATA_TEST_CONFIG 0")
@remote_compatible
def test_ap_qosmap_default(dev, apdev):
"""QoS mapping with default values"""
ssid = "test-qosmap-default"
@ -86,6 +89,7 @@ def test_ap_qosmap_default(dev, apdev):
dev[0].request("DATA_TEST_CONFIG 0")
hapd.request("DATA_TEST_CONFIG 0")
@remote_compatible
def test_ap_qosmap_default_acm(dev, apdev):
"""QoS mapping with default values and ACM=1 for VO/VI"""
ssid = "test-qosmap-default"
@ -125,6 +129,7 @@ def test_ap_qosmap_default_acm(dev, apdev):
dev[0].request("DATA_TEST_CONFIG 0")
hapd.request("DATA_TEST_CONFIG 0")
@remote_compatible
def test_ap_qosmap_invalid(dev, apdev):
"""QoS mapping ctrl_iface error handling"""
ssid = "test-qosmap"

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -11,6 +12,7 @@ logger = logging.getLogger()
import hwsim_utils
import hostapd
@remote_compatible
def test_ap_roam_open(dev, apdev):
"""Roam between two open APs"""
hapd0 = hostapd.add_ap(apdev[0], { "ssid": "test-open" })
@ -23,6 +25,7 @@ def test_ap_roam_open(dev, apdev):
dev[0].roam(apdev[0]['bssid'])
hwsim_utils.test_connectivity(dev[0], hapd0)
@remote_compatible
def test_ap_roam_open_failed(dev, apdev):
"""Roam failure due to rejected authentication"""
hapd0 = hostapd.add_ap(apdev[0], { "ssid": "test-open" })
@ -44,6 +47,7 @@ def test_ap_roam_open_failed(dev, apdev):
dev[0].wait_connected(timeout=5)
hwsim_utils.test_connectivity(dev[0], hapd0)
@remote_compatible
def test_ap_roam_wpa2_psk(dev, apdev):
"""Roam between two WPA2-PSK APs"""
params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678")
@ -89,6 +93,7 @@ def test_ap_roam_wpa2_psk_failed(dev, apdev, params):
dev[0].wait_connected(timeout=5)
hwsim_utils.test_connectivity(dev[0], hapd0)
@remote_compatible
def test_ap_reassociation_to_same_bss(dev, apdev):
"""Reassociate to the same BSS"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "test-open" })
@ -108,6 +113,7 @@ def test_ap_reassociation_to_same_bss(dev, apdev):
dev[0].wait_connected(timeout=10, error="Reattach timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_ap_roam_set_bssid(dev, apdev):
"""Roam control"""
hostapd.add_ap(apdev[0], { "ssid": "test-open" })
@ -124,6 +130,7 @@ def test_ap_roam_set_bssid(dev, apdev):
dev[0].set_network(id, "bssid", apdev[0]['bssid'])
dev[0].set_network(id, "bssid", apdev[1]['bssid'])
@remote_compatible
def test_ap_roam_wpa2_psk_race(dev, apdev):
"""Roam between two WPA2-PSK APs and try to hit a disconnection race"""
params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678")

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -163,6 +164,7 @@ def check_tdls_link(sta0, sta1, connected=True):
if connected:
raise Exception("Expected TDLS link status to be connected")
@remote_compatible
def test_ap_tdls_discovery(dev, apdev):
"""WPA2-PSK AP and two stations using TDLS discovery"""
hapd = start_ap_wpa2_psk(apdev[0])

View file

@ -6,6 +6,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import subprocess
import logging
@ -531,6 +532,7 @@ def test_ap_vlan_without_station(dev, apdev, p):
stderr=open('/dev/null', 'w'))
subprocess.call(['brctl', 'delbr', 'brvlan1'])
@remote_compatible
def test_ap_open_per_sta_vif(dev, apdev):
"""AP VLAN with open network"""
params = { "ssid": "test-vlan-open",
@ -541,6 +543,7 @@ def test_ap_open_per_sta_vif(dev, apdev):
hwsim_utils.test_connectivity_iface(dev[0], hapd,
apdev[0]['ifname'] + ".4096")
@remote_compatible
def test_ap_vlan_open_per_sta_vif(dev, apdev):
"""AP VLAN (dynamic) with open network"""
params = { "ssid": "test-vlan-open",

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import base64
import binascii
from Crypto.Cipher import AES
@ -38,6 +39,7 @@ def wps_start_ap(apdev, ssid="test-wps-conf"):
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" }
return hostapd.add_ap(apdev, params)
@remote_compatible
def test_ap_wps_init(dev, apdev):
"""Initial AP configuration with first WPS Enrollee"""
ssid = "test-wps"
@ -159,6 +161,7 @@ def test_ap_wps_init_2ap_pin(dev, apdev):
if "[WPS-AUTH]" in bss['flags']:
raise Exception("WPS-AUTH flag not cleared from AP2")
@remote_compatible
def test_ap_wps_init_through_wps_config(dev, apdev):
"""Initial AP configuration using wps_config command"""
ssid = "test-wps-init-config"
@ -177,6 +180,7 @@ def test_ap_wps_init_through_wps_config(dev, apdev):
dev[0].connect(ssid, psk="12345678", scan_freq="2412", proto="WPA2",
pairwise="CCMP", group="CCMP")
@remote_compatible
def test_ap_wps_init_through_wps_config_2(dev, apdev):
"""AP configuration using wps_config and wps_cred_processing=2"""
ssid = "test-wps-init-config"
@ -191,6 +195,7 @@ def test_ap_wps_init_through_wps_config_2(dev, apdev):
if "100e" not in ev:
raise Exception("WPS-NEW-AP-SETTINGS did not include Credential")
@remote_compatible
def test_ap_wps_invalid_wps_config_passphrase(dev, apdev):
"""AP configuration using wps_config command with invalid passphrase"""
ssid = "test-wps-init-config"
@ -279,6 +284,7 @@ def test_ap_wps_conf_chan14(dev, apdev):
subprocess.call(['iw', 'reg', 'set', '00'])
dev[0].flush_scan_cache()
@remote_compatible
def test_ap_wps_twice(dev, apdev):
"""WPS provisioning with twice to change passphrase"""
ssid = "test-wps-twice"
@ -307,6 +313,7 @@ def test_ap_wps_twice(dev, apdev):
if len(networks) > 1:
raise Exception("Unexpected duplicated network block present")
@remote_compatible
def test_ap_wps_incorrect_pin(dev, apdev):
"""WPS PIN provisioning with incorrect PIN"""
ssid = "test-wps-incorrect-pin"
@ -349,6 +356,7 @@ def test_ap_wps_incorrect_pin(dev, apdev):
raise Exception("PIN error detected on incorrect message")
dev[0].wait_disconnected(timeout=10)
@remote_compatible
def test_ap_wps_conf_pin(dev, apdev):
"""WPS PIN provisioning with configured AP"""
ssid = "test-wps-conf-pin"
@ -444,6 +452,7 @@ def test_ap_wps_conf_pin_mixed_mode(dev, apdev):
dev[0].request("SET wps_force_auth_types ")
dev[0].request("SET wps_force_encr_types ")
@remote_compatible
def test_ap_wps_conf_pin_v1(dev, apdev):
"""WPS PIN provisioning with configured WPS v1.0 AP"""
ssid = "test-wps-conf-pin-v1"
@ -469,6 +478,7 @@ def test_ap_wps_conf_pin_v1(dev, apdev):
dev[0].wait_connected(timeout=30)
hapd.request("SET wps_version_number 0x20")
@remote_compatible
def test_ap_wps_conf_pin_2sta(dev, apdev):
"""Two stations trying to use WPS PIN at the same time"""
ssid = "test-wps-conf-pin2"
@ -490,6 +500,7 @@ def test_ap_wps_conf_pin_2sta(dev, apdev):
dev[0].wait_connected(timeout=30)
dev[1].wait_connected(timeout=30)
@remote_compatible
def test_ap_wps_conf_pin_timeout(dev, apdev):
"""WPS PIN provisioning with configured AP timing out PIN"""
ssid = "test-wps-conf-pin"
@ -900,6 +911,7 @@ def test_ap_wps_setup_locked_2(dev, apdev):
dev[0].request("WPS_CANCEL")
dev[0].wait_disconnected()
@remote_compatible
def test_ap_wps_pbc_overlap_2ap(dev, apdev):
"""WPS PBC session overlap with two active APs"""
params = { "ssid": "wps1", "eap_server": "1", "wps_state": "2",
@ -925,6 +937,7 @@ def test_ap_wps_pbc_overlap_2ap(dev, apdev):
hapd2.request("DISABLE")
dev[0].flush_scan_cache()
@remote_compatible
def test_ap_wps_pbc_overlap_2sta(dev, apdev):
"""WPS PBC session overlap with two active STAs"""
ssid = "test-wps-pbc-overlap"
@ -962,6 +975,7 @@ def test_ap_wps_pbc_overlap_2sta(dev, apdev):
dev[0].flush_scan_cache()
dev[1].flush_scan_cache()
@remote_compatible
def test_ap_wps_cancel(dev, apdev):
"""WPS AP cancelling enabled config method"""
ssid = "test-wps-ap-cancel"
@ -1486,6 +1500,7 @@ def _test_ap_wps_er_v10_add_enrollee_pin(dev, apdev):
if ev is None:
raise Exception("WPS ER did not report success")
@remote_compatible
def test_ap_wps_er_config_ap(dev, apdev):
"""WPS ER configuring AP over UPnP"""
try:
@ -1540,6 +1555,7 @@ def _test_ap_wps_er_config_ap(dev, apdev):
if "OK" not in dev[0].request("WPS_ER_STOP"):
raise Exception("WPS_ER_STOP failed")
@remote_compatible
def test_ap_wps_er_cache_ap_settings(dev, apdev):
"""WPS ER caching AP settings"""
try:
@ -1833,6 +1849,7 @@ def _test_ap_wps_er_set_sel_reg_oom(dev, apdev):
dev[0].request("WPS_ER_STOP")
@remote_compatible
def test_ap_wps_er_learn_oom(dev, apdev):
"""WPS ER learn OOM"""
try:
@ -1935,6 +1952,7 @@ def test_ap_wps_fragmentation(dev, apdev):
if status['key_mgmt'] != 'WPA2-PSK':
raise Exception("Unexpected key_mgmt")
@remote_compatible
def test_ap_wps_new_version_sta(dev, apdev):
"""WPS compatibility with new version number on the station"""
ssid = "test-wps-ver"
@ -1951,6 +1969,7 @@ def test_ap_wps_new_version_sta(dev, apdev):
dev[0].request("WPS_PBC " + apdev[0]['bssid'])
dev[0].wait_connected(timeout=30)
@remote_compatible
def test_ap_wps_new_version_ap(dev, apdev):
"""WPS compatibility with new version number on the AP"""
ssid = "test-wps-ver"
@ -1968,6 +1987,7 @@ def test_ap_wps_new_version_ap(dev, apdev):
dev[0].wait_connected(timeout=30)
hapd.request("SET wps_version_number 0x20")
@remote_compatible
def test_ap_wps_check_pin(dev, apdev):
"""Verify PIN checking through control interface"""
hapd = hostapd.add_ap(apdev[0],
@ -2037,6 +2057,7 @@ def test_ap_wps_wep_enroll(dev, apdev):
if "msg=12" not in ev or "reason=2 (WEP Prohibited)" not in ev:
raise Exception("Unexpected WPS-FAIL event: " + ev)
@remote_compatible
def test_ap_wps_ie_fragmentation(dev, apdev):
"""WPS AP using fragmented WPS IE"""
ssid = "test-wps-ie-fragmentation"
@ -3400,6 +3421,7 @@ def test_ap_wps_upnp_http_proto_chunked(dev, apdev):
pass
conn.close()
@remote_compatible
def test_ap_wps_disabled(dev, apdev):
"""WPS operations while WPS is disabled"""
ssid = "test-wps-disabled"
@ -3432,6 +3454,7 @@ def test_ap_wps_mixed_cred(dev, apdev):
if pairwise != "CCMP TKIP" and pairwise != "CCMP GCMP TKIP":
raise Exception("Unexpected merged pairwise field value: " + pairwise)
@remote_compatible
def test_ap_wps_while_connected(dev, apdev):
"""WPS PBC provisioning while connected to another AP"""
ssid = "test-wps-conf"
@ -3452,6 +3475,7 @@ def test_ap_wps_while_connected(dev, apdev):
if status['bssid'] != apdev[0]['bssid']:
raise Exception("Unexpected BSSID")
@remote_compatible
def test_ap_wps_while_connected_no_autoconnect(dev, apdev):
"""WPS PBC provisioning while connected to another AP and STA_AUTOCONNECT disabled"""
ssid = "test-wps-conf"
@ -3477,6 +3501,7 @@ def test_ap_wps_while_connected_no_autoconnect(dev, apdev):
finally:
dev[0].request("STA_AUTOCONNECT 1")
@remote_compatible
def test_ap_wps_from_event(dev, apdev):
"""WPS PBC event on AP to enable PBC"""
ssid = "test-wps-conf"
@ -3532,6 +3557,7 @@ def test_ap_wps_ap_scan_2(dev, apdev):
wpas.wait_connected(timeout=30)
wpas.dump_monitor()
@remote_compatible
def test_ap_wps_eapol_workaround(dev, apdev):
"""EAPOL workaround code path for 802.1X header length mismatch"""
ssid = "test-wps"
@ -3638,6 +3664,7 @@ def test_ap_wps_iteration_error(dev, apdev):
raise Exception("No WPS-CRED-RECEIVED for the second AP")
dev[0].wait_connected(timeout=15)
@remote_compatible
def test_ap_wps_priority(dev, apdev):
"""WPS PIN provisioning with configured AP and wps_priority"""
ssid = "test-wps-conf-pin"
@ -3661,6 +3688,7 @@ def test_ap_wps_priority(dev, apdev):
finally:
dev[0].request("SET wps_priority 0")
@remote_compatible
def test_ap_wps_and_non_wps(dev, apdev):
"""WPS and non-WPS AP in single hostapd process"""
params = { "ssid": "wps", "eap_server": "1", "wps_state": "1" }
@ -3696,6 +3724,7 @@ def test_ap_wps_init_oom(dev, apdev):
hapd.request("WPS_PIN any " + pin)
dev[0].wait_connected(timeout=30)
@remote_compatible
def test_ap_wps_er_oom(dev, apdev):
"""WPS ER OOM in XML processing"""
try:
@ -3744,6 +3773,7 @@ def _test_ap_wps_er_oom(dev, apdev):
if ev is None:
raise Exception("Enrollee discovery timed out")
@remote_compatible
def test_ap_wps_er_init_oom(dev, apdev):
"""WPS ER and OOM during init"""
try:
@ -3768,6 +3798,7 @@ def _test_ap_wps_er_init_oom(dev, apdev):
if "FAIL" not in dev[0].request("WPS_ER_START ifname=lo"):
raise Exception("WPS_ER_START succeeded during os_get_random failure")
@remote_compatible
def test_ap_wps_er_init_fail(dev, apdev):
"""WPS ER init failure"""
if "FAIL" not in dev[0].request("WPS_ER_START ifname=does-not-exist"):
@ -4866,6 +4897,7 @@ def test_ap_wps_init_oom(dev, apdev):
dev[0].flush_scan_cache()
@remote_compatible
def test_ap_wps_invalid_assoc_req_elem(dev, apdev):
"""WPS and invalid IE in Association Request frame"""
ssid = "test-wps"
@ -4905,6 +4937,7 @@ def test_ap_wps_pbc_pin_mismatch(dev, apdev):
hapd.request("WPS_CANCEL")
dev[0].flush_scan_cache()
@remote_compatible
def test_ap_wps_ie_invalid(dev, apdev):
"""WPS PIN attempt with AP that has invalid WSC IE"""
ssid = "test-wps"
@ -4921,6 +4954,7 @@ def test_ap_wps_ie_invalid(dev, apdev):
raise Exception("Scan did not complete")
dev[0].request("WPS_CANCEL")
@remote_compatible
def test_ap_wps_scan_prio_order(dev, apdev):
"""WPS scan priority ordering"""
ssid = "test-wps"
@ -4995,6 +5029,7 @@ def test_ap_wps_assoc_resp_ie_oom(dev, apdev):
raise Exception("Association not seen")
dev[0].request("WPS_CANCEL")
@remote_compatible
def test_ap_wps_bss_info_errors(dev, apdev):
"""WPS BSS info errors"""
params = { "ssid": "1",
@ -5043,17 +5078,20 @@ def wps_run_pbc_fail(apdev, dev):
hapd = wps_start_ap(apdev)
wps_run_pbc_fail_ap(apdev, dev, hapd)
@remote_compatible
def test_ap_wps_pk_oom(dev, apdev):
"""WPS and public key OOM"""
with alloc_fail(dev[0], 1, "wps_build_public_key"):
wps_run_pbc_fail(apdev[0], dev[0])
@remote_compatible
def test_ap_wps_pk_oom_ap(dev, apdev):
"""WPS and public key OOM on AP"""
hapd = wps_start_ap(apdev[0])
with alloc_fail(hapd, 1, "wps_build_public_key"):
wps_run_pbc_fail_ap(apdev[0], dev[0], hapd)
@remote_compatible
def test_ap_wps_encr_oom_ap(dev, apdev):
"""WPS and encrypted settings decryption OOM on AP"""
hapd = wps_start_ap(apdev[0])
@ -5068,32 +5106,38 @@ def test_ap_wps_encr_oom_ap(dev, apdev):
dev[0].request("WPS_CANCEL")
dev[0].wait_disconnected()
@remote_compatible
def test_ap_wps_encr_no_random_ap(dev, apdev):
"""WPS and no random data available for encryption on AP"""
hapd = wps_start_ap(apdev[0])
with fail_test(hapd, 1, "os_get_random;wps_build_encr_settings"):
wps_run_pbc_fail_ap(apdev[0], dev[0], hapd)
@remote_compatible
def test_ap_wps_e_hash_no_random_sta(dev, apdev):
"""WPS and no random data available for e-hash on STA"""
with fail_test(dev[0], 1, "os_get_random;wps_build_e_hash"):
wps_run_pbc_fail(apdev[0], dev[0])
@remote_compatible
def test_ap_wps_m1_no_random(dev, apdev):
"""WPS and no random for M1 on STA"""
with fail_test(dev[0], 1, "os_get_random;wps_build_m1"):
wps_run_pbc_fail(apdev[0], dev[0])
@remote_compatible
def test_ap_wps_m1_oom(dev, apdev):
"""WPS and OOM for M1 on STA"""
with alloc_fail(dev[0], 1, "wps_build_m1"):
wps_run_pbc_fail(apdev[0], dev[0])
@remote_compatible
def test_ap_wps_m3_oom(dev, apdev):
"""WPS and OOM for M3 on STA"""
with alloc_fail(dev[0], 1, "wps_build_m3"):
wps_run_pbc_fail(apdev[0], dev[0])
@remote_compatible
def test_ap_wps_m5_oom(dev, apdev):
"""WPS and OOM for M5 on STA"""
hapd = wps_start_ap(apdev[0])
@ -5109,12 +5153,14 @@ def test_ap_wps_m5_oom(dev, apdev):
dev[0].wait_disconnected()
dev[0].flush_scan_cache()
@remote_compatible
def test_ap_wps_m5_no_random(dev, apdev):
"""WPS and no random for M5 on STA"""
with fail_test(dev[0], 1,
"os_get_random;wps_build_encr_settings;wps_build_m5"):
wps_run_pbc_fail(apdev[0], dev[0])
@remote_compatible
def test_ap_wps_m7_oom(dev, apdev):
"""WPS and OOM for M7 on STA"""
hapd = wps_start_ap(apdev[0])
@ -5130,12 +5176,14 @@ def test_ap_wps_m7_oom(dev, apdev):
dev[0].wait_disconnected()
dev[0].flush_scan_cache()
@remote_compatible
def test_ap_wps_m7_no_random(dev, apdev):
"""WPS and no random for M7 on STA"""
with fail_test(dev[0], 1,
"os_get_random;wps_build_encr_settings;wps_build_m7"):
wps_run_pbc_fail(apdev[0], dev[0])
@remote_compatible
def test_ap_wps_wsc_done_oom(dev, apdev):
"""WPS and OOM for WSC_Done on STA"""
with alloc_fail(dev[0], 1, "wps_build_wsc_done"):
@ -5797,6 +5845,7 @@ def test_ap_wps_m4_msg_type_m2d(dev, apdev):
"""WPS and M4 but Message Type M2D"""
wps_m4_but_other(dev[0], apdev[0], "M4/M2D", "06")
@remote_compatible
def test_ap_wps_config_methods(dev, apdev):
"""WPS configuration method parsing"""
ssid = "test-wps-conf"
@ -7734,10 +7783,12 @@ def test_wps_ext_ap_settings_success(dev, apdev):
ap_settings += build_wsc_attr(ATTR_MAC_ADDR, binascii.unhexlify(apdev[0]['bssid'].replace(':', '')))
wps_run_ap_settings_proto(dev, apdev, ap_settings, True)
@remote_compatible
def test_wps_ext_ap_settings_missing(dev, apdev):
"""WPS and AP Settings: missing"""
wps_run_ap_settings_proto(dev, apdev, None, False)
@remote_compatible
def test_wps_ext_ap_settings_mac_addr_mismatch(dev, apdev):
"""WPS and AP Settings: MAC Address mismatch"""
ap_settings = build_wsc_attr(ATTR_NETWORK_INDEX, '\x01')
@ -7748,6 +7799,7 @@ def test_wps_ext_ap_settings_mac_addr_mismatch(dev, apdev):
ap_settings += build_wsc_attr(ATTR_MAC_ADDR, '\x00\x00\x00\x00\x00\x00')
wps_run_ap_settings_proto(dev, apdev, ap_settings, True)
@remote_compatible
def test_wps_ext_ap_settings_mac_addr_missing(dev, apdev):
"""WPS and AP Settings: missing MAC Address"""
ap_settings = build_wsc_attr(ATTR_NETWORK_INDEX, '\x01')
@ -7757,6 +7809,7 @@ def test_wps_ext_ap_settings_mac_addr_missing(dev, apdev):
ap_settings += build_wsc_attr(ATTR_NETWORK_KEY, '')
wps_run_ap_settings_proto(dev, apdev, ap_settings, False)
@remote_compatible
def test_wps_ext_ap_settings_reject_encr_type(dev, apdev):
"""WPS and AP Settings: reject Encr Type"""
ap_settings = build_wsc_attr(ATTR_NETWORK_INDEX, '\x01')
@ -7767,6 +7820,7 @@ def test_wps_ext_ap_settings_reject_encr_type(dev, apdev):
ap_settings += build_wsc_attr(ATTR_MAC_ADDR, binascii.unhexlify(apdev[0]['bssid'].replace(':', '')))
wps_run_ap_settings_proto(dev, apdev, ap_settings, False)
@remote_compatible
def test_wps_ext_ap_settings_m2d(dev, apdev):
"""WPS and AP Settings: M2D"""
addr,bssid,hapd = wps_start_ext_reg(apdev[0], dev[0])
@ -7804,6 +7858,7 @@ def wps_wait_ap_nack(hapd, dev, e_nonce, r_nonce):
send_wsc_msg(hapd, dev.own_addr(), nack)
dev.wait_disconnected()
@remote_compatible
def test_wps_ext_m3_missing_e_hash1(dev, apdev):
"""WPS proto: M3 missing E-Hash1"""
pin = "12345670"
@ -7848,6 +7903,7 @@ def test_wps_ext_m3_missing_e_hash1(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m3_missing_e_hash2(dev, apdev):
"""WPS proto: M3 missing E-Hash2"""
pin = "12345670"
@ -7892,6 +7948,7 @@ def test_wps_ext_m3_missing_e_hash2(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m5_missing_e_snonce1(dev, apdev):
"""WPS proto: M5 missing E-SNonce1"""
pin = "12345670"
@ -7951,6 +8008,7 @@ def test_wps_ext_m5_missing_e_snonce1(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m5_e_snonce1_mismatch(dev, apdev):
"""WPS proto: M5 E-SNonce1 mismatch"""
pin = "12345670"
@ -8082,6 +8140,7 @@ def test_wps_ext_m7_missing_e_snonce2(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m7_e_snonce2_mismatch(dev, apdev):
"""WPS proto: M7 E-SNonce2 mismatch"""
pin = "12345670"
@ -8154,6 +8213,7 @@ def test_wps_ext_m7_e_snonce2_mismatch(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m1_pubkey_oom(dev, apdev):
"""WPS proto: M1 PubKey OOM"""
pin = "12345670"
@ -8184,6 +8244,7 @@ def wps_wait_eap_failure(hapd, dev):
raise Exception("EAP-Failure not reported")
dev.wait_disconnected()
@remote_compatible
def test_wps_ext_m3_m1(dev, apdev):
"""WPS proto: M3 replaced with M1"""
pin = "12345670"
@ -8228,6 +8289,7 @@ def test_wps_ext_m3_m1(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m5_m3(dev, apdev):
"""WPS proto: M5 replaced with M3"""
pin = "12345670"
@ -8286,6 +8348,7 @@ def test_wps_ext_m5_m3(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m3_m2(dev, apdev):
"""WPS proto: M3 replaced with M2"""
pin = "12345670"
@ -8328,6 +8391,7 @@ def test_wps_ext_m3_m2(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m3_m5(dev, apdev):
"""WPS proto: M3 replaced with M5"""
pin = "12345670"
@ -8372,6 +8436,7 @@ def test_wps_ext_m3_m5(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m3_m7(dev, apdev):
"""WPS proto: M3 replaced with M7"""
pin = "12345670"
@ -8416,6 +8481,7 @@ def test_wps_ext_m3_m7(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m3_done(dev, apdev):
"""WPS proto: M3 replaced with WSC_Done"""
pin = "12345670"
@ -8457,6 +8523,7 @@ def test_wps_ext_m3_done(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_nack_invalid(dev, apdev):
"""WPS proto: M2 followed by invalid NACK"""
pin = "12345670"
@ -8495,6 +8562,7 @@ def test_wps_ext_m2_nack_invalid(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_nack_no_msg_type(dev, apdev):
"""WPS proto: M2 followed by NACK without Msg Type"""
pin = "12345670"
@ -8533,6 +8601,7 @@ def test_wps_ext_m2_nack_no_msg_type(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_nack_invalid_msg_type(dev, apdev):
"""WPS proto: M2 followed by NACK with invalid Msg Type"""
pin = "12345670"
@ -8571,6 +8640,7 @@ def test_wps_ext_m2_nack_invalid_msg_type(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_nack_e_nonce_mismatch(dev, apdev):
"""WPS proto: M2 followed by NACK with e-nonce mismatch"""
pin = "12345670"
@ -8609,6 +8679,7 @@ def test_wps_ext_m2_nack_e_nonce_mismatch(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_nack_no_config_error(dev, apdev):
"""WPS proto: M2 followed by NACK without Config Error"""
pin = "12345670"
@ -8647,6 +8718,7 @@ def test_wps_ext_m2_nack_no_config_error(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_ack_invalid(dev, apdev):
"""WPS proto: M2 followed by invalid ACK"""
pin = "12345670"
@ -8685,6 +8757,7 @@ def test_wps_ext_m2_ack_invalid(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_ack(dev, apdev):
"""WPS proto: M2 followed by ACK"""
pin = "12345670"
@ -8722,6 +8795,7 @@ def test_wps_ext_m2_ack(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_ack_no_msg_type(dev, apdev):
"""WPS proto: M2 followed by ACK missing Msg Type"""
pin = "12345670"
@ -8760,6 +8834,7 @@ def test_wps_ext_m2_ack_no_msg_type(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_ack_invalid_msg_type(dev, apdev):
"""WPS proto: M2 followed by ACK with invalid Msg Type"""
pin = "12345670"
@ -8798,6 +8873,7 @@ def test_wps_ext_m2_ack_invalid_msg_type(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m2_ack_e_nonce_mismatch(dev, apdev):
"""WPS proto: M2 followed by ACK with e-nonce mismatch"""
pin = "12345670"
@ -8836,6 +8912,7 @@ def test_wps_ext_m2_ack_e_nonce_mismatch(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m1_invalid(dev, apdev):
"""WPS proto: M1 failing parsing"""
pin = "12345670"
@ -8947,6 +9024,7 @@ def wps_ext_wsc_done(dev, apdev):
msg, m8_attrs, raw_m8_attrs = recv_wsc_msg(hapd, WSC_MSG, WPS_M8)
return hapd, msg, e_nonce, r_nonce
@remote_compatible
def test_wps_ext_wsc_done_invalid(dev, apdev):
"""WPS proto: invalid WSC_Done"""
hapd, msg, e_nonce, r_nonce = wps_ext_wsc_done(dev, apdev)
@ -8958,6 +9036,7 @@ def test_wps_ext_wsc_done_invalid(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_wsc_done_no_msg_type(dev, apdev):
"""WPS proto: invalid WSC_Done"""
hapd, msg, e_nonce, r_nonce = wps_ext_wsc_done(dev, apdev)
@ -8972,6 +9051,7 @@ def test_wps_ext_wsc_done_no_msg_type(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_wsc_done_wrong_msg_type(dev, apdev):
"""WPS proto: WSC_Done with wrong Msg Type"""
hapd, msg, e_nonce, r_nonce = wps_ext_wsc_done(dev, apdev)
@ -8986,6 +9066,7 @@ def test_wps_ext_wsc_done_wrong_msg_type(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_wsc_done_no_e_nonce(dev, apdev):
"""WPS proto: WSC_Done without e_nonce"""
hapd, msg, e_nonce, r_nonce = wps_ext_wsc_done(dev, apdev)
@ -9014,6 +9095,7 @@ def test_wps_ext_wsc_done_no_r_nonce(dev, apdev):
wps_wait_eap_failure(hapd, dev[0])
@remote_compatible
def test_wps_ext_m7_no_encr_settings(dev, apdev):
"""WPS proto: M7 without Encr Settings"""
pin = "12345670"
@ -9086,6 +9168,7 @@ def test_wps_ext_m7_no_encr_settings(dev, apdev):
wps_wait_ap_nack(hapd, dev[0], e_nonce, r_nonce)
@remote_compatible
def test_wps_ext_m1_workaround(dev, apdev):
"""WPS proto: M1 Manufacturer/Model workaround"""
pin = "12345670"
@ -9112,6 +9195,7 @@ def test_wps_ext_m1_workaround(dev, apdev):
logger.debug("Receive M2 from AP")
msg, m2_attrs, raw_m2_attrs = recv_wsc_msg(hapd, WSC_MSG, WPS_M2)
@remote_compatible
def test_ap_wps_disable_enable(dev, apdev):
"""WPS and DISABLE/ENABLE AP"""
hapd = wps_start_ap(apdev[0])
@ -9281,6 +9365,7 @@ def wait_scan_stopped(dev):
logger.debug("Waiting for scan to complete")
time.sleep(0.1)
@remote_compatible
def test_ap_wps_eap_wsc_errors(dev, apdev):
"""WPS and EAP-WSC error cases"""
ssid = "test-wps-conf-pin"

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -51,6 +52,7 @@ def test_autoscan_periodic(dev, apdev):
finally:
dev[0].request("AUTOSCAN ")
@remote_compatible
def test_autoscan_exponential(dev, apdev):
"""autoscan_exponential"""
hostapd.add_ap(apdev[0], { "ssid": "autoscan" })

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import binascii
@ -22,6 +23,7 @@ def nl80211_command(dev, cmd, attr):
raise Exception("nl80211 command failed")
return binascii.unhexlify(res)
@remote_compatible
def test_cfg80211_disassociate(dev, apdev):
"""cfg80211 disassociation command"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -93,6 +95,7 @@ def test_cfg80211_tx_frame(dev, apdev, params):
if freq[1] != "2412":
raise Exception("Second Action frame on unexpected channel: %s MHz" % freq[1])
@remote_compatible
def test_cfg80211_wep_key_idx_change(dev, apdev):
"""WEP Shared Key authentication and key index change without deauth"""
hapd = hostapd.add_ap(apdev[0],
@ -122,6 +125,7 @@ def test_cfg80211_wep_key_idx_change(dev, apdev):
dev[0].wait_connected(timeout=10, error="Reassociation timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_cfg80211_hostapd_ext_sta_remove(dev, apdev):
"""cfg80211 DEL_STATION issued externally to hostapd"""
hapd = hostapd.add_ap(apdev[0],

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import os
import subprocess
import time
@ -213,6 +214,7 @@ def test_dfs_radar(dev, apdev):
subprocess.call(['iw', 'reg', 'set', '00'])
dev[0].flush_scan_cache()
@remote_compatible
def test_dfs_radar_on_non_dfs_channel(dev, apdev):
"""DFS radar detection test code on non-DFS channel"""
params = { "ssid": "radar" }

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
@ -14,6 +15,7 @@ from test_ap_hs20 import hs20_ap_params
from test_ap_hs20 import interworking_select
from test_ap_hs20 import interworking_connect
@remote_compatible
def test_ext_password_psk(dev, apdev):
"""External password storage for PSK"""
params = hostapd.wpa2_params(ssid="ext-pw-psk", passphrase="12345678")

View file

@ -5,6 +5,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import binascii
import logging
@ -298,6 +299,7 @@ def test_gas_comeback_delay(dev, apdev):
if ev is None:
raise Exception("Operation timed out")
@remote_compatible
def test_gas_stop_fetch_anqp(dev, apdev):
"""Stop FETCH_ANQP operation"""
hapd = start_ap(apdev[0])
@ -930,6 +932,7 @@ def test_gas_query_deinit(dev, apdev):
# GAS query has not yet been started.
wpas.interface_remove("wlan5")
@remote_compatible
def test_gas_anqp_oom_wpas(dev, apdev):
"""GAS/ANQP query and OOM in wpa_supplicant"""
hapd = start_ap(apdev[0])

View file

@ -4,10 +4,12 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import hostapd
import hwsim_utils
from utils import skip_with_fips
@remote_compatible
def test_hapd_ctrl_status(dev, apdev):
"""hostapd ctrl_iface STATUS commands"""
ssid = "hapd-ctrl"
@ -31,6 +33,7 @@ def test_hapd_ctrl_status(dev, apdev):
if driver['addr'] != bssid:
raise Exception("Unexpected addr")
@remote_compatible
def test_hapd_ctrl_p2p_manager(dev, apdev):
"""hostapd as P2P Device manager"""
ssid = "hapd-p2p-mgr"
@ -51,6 +54,7 @@ def test_hapd_ctrl_p2p_manager(dev, apdev):
dev[0].wait_disconnected(timeout=5)
dev[0].wait_connected(timeout=10, error="Re-connection timed out")
@remote_compatible
def test_hapd_ctrl_sta(dev, apdev):
"""hostapd and STA ctrl_iface commands"""
ssid = "hapd-ctrl-sta"
@ -73,6 +77,7 @@ def test_hapd_ctrl_sta(dev, apdev):
if "FAIL" not in hapd.request("STA-NEXT 00:11:22:33:44"):
raise Exception("Unexpected STA-NEXT success")
@remote_compatible
def test_hapd_ctrl_disconnect(dev, apdev):
"""hostapd and disconnection ctrl_iface commands"""
ssid = "hapd-ctrl"
@ -98,6 +103,7 @@ def test_hapd_ctrl_disconnect(dev, apdev):
dev[0].wait_disconnected(timeout=5)
dev[0].wait_connected(timeout=10, error="Re-connection timed out")
@remote_compatible
def test_hapd_ctrl_chan_switch(dev, apdev):
"""hostapd and CHAN_SWITCH ctrl_iface command"""
ssid = "hapd-ctrl"
@ -112,6 +118,7 @@ def test_hapd_ctrl_chan_switch(dev, apdev):
if "FAIL" not in hapd.request("CHAN_SWITCH 0 2432 center_freq1=123 center_freq2=234 bandwidth=1000 sec_channel_offset=20 ht vht"):
raise Exception("Unexpected CHAN_SWITCH success")
@remote_compatible
def test_hapd_ctrl_level(dev, apdev):
"""hostapd and LEVEL ctrl_iface command"""
ssid = "hapd-ctrl"
@ -120,6 +127,7 @@ def test_hapd_ctrl_level(dev, apdev):
if "FAIL" not in hapd.request("LEVEL 0"):
raise Exception("Unexpected LEVEL success on non-monitor interface")
@remote_compatible
def test_hapd_ctrl_new_sta(dev, apdev):
"""hostapd and NEW_STA ctrl_iface command"""
ssid = "hapd-ctrl"
@ -132,6 +140,7 @@ def test_hapd_ctrl_new_sta(dev, apdev):
if "AUTHORIZED" not in hapd.request("STA 00:11:22:33:44:55"):
raise Exception("Unexpected NEW_STA STA status")
@remote_compatible
def test_hapd_ctrl_get(dev, apdev):
"""hostapd and GET ctrl_iface command"""
ssid = "hapd-ctrl"
@ -142,6 +151,7 @@ def test_hapd_ctrl_get(dev, apdev):
if "FAIL" in hapd.request("GET version"):
raise Exception("Unexpected GET version failure")
@remote_compatible
def test_hapd_ctrl_unknown(dev, apdev):
"""hostapd and unknown ctrl_iface command"""
ssid = "hapd-ctrl"
@ -150,6 +160,7 @@ def test_hapd_ctrl_unknown(dev, apdev):
if "UNKNOWN COMMAND" not in hapd.request("FOO"):
raise Exception("Unexpected response")
@remote_compatible
def test_hapd_ctrl_hs20_wnm_notif(dev, apdev):
"""hostapd and HS20_WNM_NOTIF ctrl_iface command"""
ssid = "hapd-ctrl"
@ -160,6 +171,7 @@ def test_hapd_ctrl_hs20_wnm_notif(dev, apdev):
if "FAIL" not in hapd.request("HS20_WNM_NOTIF 00:11:22:33:44:55http://example.com/"):
raise Exception("Unexpected HS20_WNM_NOTIF success")
@remote_compatible
def test_hapd_ctrl_hs20_deauth_req(dev, apdev):
"""hostapd and HS20_DEAUTH_REQ ctrl_iface command"""
ssid = "hapd-ctrl"
@ -172,6 +184,7 @@ def test_hapd_ctrl_hs20_deauth_req(dev, apdev):
if "FAIL" not in hapd.request("HS20_DEAUTH_REQ 00:11:22:33:44:55 1"):
raise Exception("Unexpected HS20_DEAUTH_REQ success")
@remote_compatible
def test_hapd_ctrl_disassoc_imminent(dev, apdev):
"""hostapd and DISASSOC_IMMINENT ctrl_iface command"""
ssid = "hapd-ctrl"
@ -191,6 +204,7 @@ def test_hapd_ctrl_disassoc_imminent(dev, apdev):
if ev is None:
raise Exception("Scan timed out")
@remote_compatible
def test_hapd_ctrl_ess_disassoc(dev, apdev):
"""hostapd and ESS_DISASSOC ctrl_iface command"""
ssid = "hapd-ctrl"
@ -243,6 +257,7 @@ def test_hapd_ctrl_set_accept_mac_file(dev, apdev):
if ev is not None:
raise Exception("Unexpected disconnection")
@remote_compatible
def test_hapd_ctrl_set_error_cases(dev, apdev):
"""hostapd and SET error cases"""
ssid = "hapd-ctrl"
@ -440,6 +455,7 @@ def test_hapd_ctrl_set_error_cases(dev, apdev):
if "OK" not in hapd.request("SET " + e):
raise Exception("Unexpected SET failure: '%s'" % e)
@remote_compatible
def test_hapd_ctrl_global(dev, apdev):
"""hostapd and GET ctrl_iface command"""
ssid = "hapd-ctrl"
@ -516,6 +532,7 @@ def test_hapd_dup_network_global_wpa(dev, apdev):
if "FAIL" in dst_hapd.request("STA " + addr):
raise Exception("Could not connect using duplicated wpa params")
@remote_compatible
def test_hapd_ctrl_log_level(dev, apdev):
"""hostapd ctrl_iface LOG_LEVEL"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -559,6 +576,7 @@ def test_hapd_ctrl_log_level(dev, apdev):
if "Timestamp: 1" not in level:
raise Exception("Unexpected timestamp(3): " + level)
@remote_compatible
def test_hapd_ctrl_disconnect_no_tx(dev, apdev):
"""hostapd disconnecting STA without transmitting Deauth/Disassoc"""
ssid = "hapd-test"

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import time
@ -37,6 +38,7 @@ def hostapd_oom_loop(apdev, params, start_func="main"):
except Exception, e:
logger.info("Iteration %d - %s" % (i, str(e)))
@remote_compatible
def test_hostapd_oom_open(dev, apdev):
"""hostapd failing to setup open mode due to OOM"""
params = { "ssid": "open" }
@ -48,6 +50,7 @@ def test_hostapd_oom_wpa2_psk(dev, apdev):
params['wpa_psk_file'] = 'hostapd.wpa_psk'
hostapd_oom_loop(apdev, params)
@remote_compatible
def test_hostapd_oom_wpa2_eap(dev, apdev):
"""hostapd failing to setup WPA2-EAP mode due to OOM"""
params = hostapd.wpa2_eap_params(ssid="test")
@ -56,6 +59,7 @@ def test_hostapd_oom_wpa2_eap(dev, apdev):
params['acct_server_shared_secret'] = "radius"
hostapd_oom_loop(apdev, params)
@remote_compatible
def test_hostapd_oom_wpa2_eap_radius(dev, apdev):
"""hostapd failing to setup WPA2-EAP mode due to OOM in RADIUS"""
params = hostapd.wpa2_eap_params(ssid="test")

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import time
@ -348,6 +349,7 @@ def test_ibss_wep(dev):
connect_ibss_cmd(dev[1], id)
bssid1 = wait_ibss_connection(dev[1])
@remote_compatible
def test_ibss_rsn_error_case(dev):
"""IBSS RSN regression test for IBSS_RSN prior IBSS setup"""
if "FAIL" not in dev[0].request("IBSS_RSN 02:03:04:05:06:07"):

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import hmac
import logging
@ -133,6 +134,7 @@ def test_ieee8021x_proto(dev, apdev):
if int(stop[val]) <= int(start[val]):
raise Exception(val + " did not increase")
@remote_compatible
def test_ieee8021x_eapol_start(dev, apdev):
"""IEEE 802.1X and EAPOL-Start retransmissions"""
params = hostapd.radius_params()

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
@ -59,6 +60,7 @@ def test_mbo_assoc_disallow(dev, apdev, params):
if "Destination address: " + hapd2.own_addr() in out:
raise Exception("Association request sent to disallowed AP 2")
@remote_compatible
def test_mbo_cell_capa_update(dev, apdev):
"""MBO cellular data capability update"""
ssid = "test-wnm-mbo"
@ -85,6 +87,7 @@ def test_mbo_cell_capa_update(dev, apdev):
if sta['mbo_cell_capa'] != '3':
raise Exception("mbo_cell_capa not updated properly")
@remote_compatible
def test_mbo_cell_capa_update_pmf(dev, apdev):
"""MBO cellular data capability update with PMF required"""
ssid = "test-wnm-mbo"
@ -116,6 +119,7 @@ def test_mbo_cell_capa_update_pmf(dev, apdev):
if sta['mbo_cell_capa'] != '3':
raise Exception("mbo_cell_capa not updated properly")
@remote_compatible
def test_mbo_non_pref_chan(dev, apdev):
"""MBO non-preferred channel list"""
ssid = "test-wnm-mbo"
@ -199,6 +203,7 @@ def test_mbo_non_pref_chan(dev, apdev):
if 'non_pref_chan[0]' in sta:
raise Exception("Unexpected non_pref_chan[0] value (update 4)")
@remote_compatible
def test_mbo_sta_supp_op_classes(dev, apdev):
"""MBO STA supported operating classes"""
ssid = "test-wnm-mbo"

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import time
@ -50,6 +51,7 @@ def test_monitor_iface_multi_bss(dev, apdev):
dev[0].connect("monitor-iface", key_mgmt="NONE", scan_freq="2412")
dev[1].connect("bss-2", key_mgmt="NONE", scan_freq="2412")
@remote_compatible
def test_monitor_iface_unknown_sta(dev, apdev):
"""AP mode monitor interface and Data frame from unknown STA"""
ssid = "monitor-iface-pmf"

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger(__name__)
@ -808,6 +809,7 @@ def _test_nfc_p2p_ip_addr_assignment2(dev):
if res['ip_addr'] == res0['ip_addr']:
raise Exception("Same IP address assigned to both clients")
@remote_compatible
def test_nfc_p2p_tag_enable_disable(dev):
"""NFC tag enable/disable for P2P"""
if "FAIL" in dev[0].request("WPS_NFC_TOKEN NDEF").rstrip():
@ -827,6 +829,7 @@ def test_nfc_p2p_tag_enable_disable(dev):
if "OK" not in dev[0].request("P2P_SET nfc_tag 0"):
raise Exception("Failed to disable NFC Tag for P2P static handover")
@remote_compatible
def test_nfc_p2p_static_handover_invalid(dev):
"""NFC static handover with invalid contents"""
logger.info("Unknown OOB GO Neg channel")

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import subprocess
import logging
@ -34,6 +35,7 @@ def ap_wps_params(ssid):
"wpa_passphrase": "12345678", "wpa": "2",
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"}
@remote_compatible
def test_nfc_wps_password_token_sta(dev, apdev):
"""NFC tag with password token on the station/Enrollee"""
ssid = "test-wps-nfc-pw-token-conf"
@ -93,6 +95,7 @@ def test_nfc_wps_config_token_init(dev, apdev):
dev[0].wait_connected(timeout=15)
check_wpa2_connection(dev[0], apdev[0], hapd, ssid, mixed=True)
@remote_compatible
def test_nfc_wps_password_token_sta_init(dev, apdev):
"""Initial AP configuration with first WPS NFC Enrollee"""
ssid = "test-wps-nfc-pw-token-init"
@ -112,6 +115,7 @@ def test_nfc_wps_password_token_sta_init(dev, apdev):
dev[0].wait_connected(timeout=30)
check_wpa2_connection(dev[0], apdev[0], hapd, ssid, mixed=True)
@remote_compatible
def test_nfc_wps_password_token_ap(dev, apdev):
"""WPS registrar configuring an AP using AP password token"""
ssid = "test-wps-nfc-pw-token-init"
@ -180,6 +184,7 @@ def _test_nfc_wps_handover_init(dev, apdev):
if "FAIL" not in hapd.request("NFC_GET_HANDOVER_SEL NDEF WPS-CR"):
raise Exception("Unexpected NFC_GET_HANDOVER_SEL success during OOM")
@remote_compatible
def test_nfc_wps_handover_errors(dev, apdev):
"""WPS AP NFC handover report error cases"""
ssid = "test-wps-nfc-handover"
@ -415,6 +420,7 @@ def start_ap_er(er, ap, ssid):
er.request("WPS_ER_SET_CONFIG " + ap_uuid + " 0")
return hapd
@remote_compatible
def test_nfc_wps_er_pw_token(dev, apdev):
"""WPS NFC password token from Enrollee to ER"""
try:
@ -444,6 +450,7 @@ def _test_nfc_wps_er_pw_token(dev, apdev):
dev[1].wait_connected(timeout=15)
check_wpa2_connection(dev[1], apdev[0], hapd, ssid)
@remote_compatible
def test_nfc_wps_er_config_token(dev, apdev):
"""WPS NFC configuration token from ER to Enrollee"""
try:
@ -564,6 +571,7 @@ def _test_nfc_wps_er_handover_pk_hash_mismatch_er(dev, apdev):
if "WPS-FAIL" not in ev:
raise Exception("Public key hash mismatch not detected")
@remote_compatible
def test_nfc_invalid_ndef_record(dev, apdev):
"""Invalid NFC NDEF record handling"""
tests = [ "11223344",

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import subprocess
import logging
@ -176,6 +177,7 @@ def test_autogo_m2d(dev):
if ev is None:
raise Exception("No M2D event on group interface (2)")
@remote_compatible
def test_autogo_fail(dev):
"""P2P autonomous GO and incorrect PIN"""
autogo(dev[0], freq=2412)
@ -339,6 +341,7 @@ def test_autogo_chan_switch(dev):
time.sleep(0.1)
hwsim_utils.test_connectivity_p2p(dev[0], dev[1])
@remote_compatible
def test_autogo_extra_cred(dev):
"""P2P autonomous GO sending two WPS credentials"""
if "FAIL" in dev[0].request("SET wps_testing_dummy_cred 1"):
@ -365,6 +368,7 @@ def test_autogo_ifdown(dev):
if res['ifname'] not in ev:
raise Exception("Unexpected group removal event: " + ev)
@remote_compatible
def test_autogo_start_during_scan(dev):
"""P2P autonomous GO started during ongoing manual scan"""
try:
@ -418,6 +422,7 @@ def test_autogo_passphrase_len(dev):
finally:
dev[0].request("SET p2p_passphrase_len 8")
@remote_compatible
def test_autogo_bridge(dev):
"""P2P autonomous GO in a bridge"""
try:
@ -451,6 +456,7 @@ def test_autogo_bridge(dev):
dev[0].cmd_execute(['brctl', 'delbr', 'p2p-br0', '2>', '/dev/null'],
shell=True)
@remote_compatible
def test_presence_req_on_group_interface(dev):
"""P2P_PRESENCE_REQ on group interface"""
dev[1].global_request("SET p2p_no_group_iface 0")
@ -528,6 +534,7 @@ def test_autogo_join_auto(dev):
dev[1].wait_go_ending_session()
dev[1].flush_scan_cache()
@remote_compatible
def test_autogo_join_auto_go_neg(dev):
"""P2P_CONNECT-auto fallback to GO Neg"""
dev[1].flush_scan_cache()
@ -564,6 +571,7 @@ def test_autogo_join_auto_go_neg(dev):
dev[1].wait_go_ending_session()
dev[1].flush_scan_cache()
@remote_compatible
def test_autogo_join_auto_go_neg_after_seeing_go(dev):
"""P2P_CONNECT-auto fallback to GO Neg after seeing GO"""
autogo(dev[0], freq=2412)
@ -709,6 +717,7 @@ def rx_pd_req(dev):
p2p['freq'] = msg['freq']
return p2p
@remote_compatible
def test_autogo_scan(dev):
"""P2P autonomous GO and no P2P IE in Probe Response scan results"""
addr0 = dev[0].p2p_dev_addr()
@ -784,6 +793,7 @@ def test_autogo_scan(dev):
dev[0].remove_group()
dev[1].wait_go_ending_session()
@remote_compatible
def test_autogo_join_before_found(dev):
"""P2P client joining a group before having found GO Device Address"""
dev[0].global_request("SET p2p_no_group_iface 0")

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import os
@ -189,6 +190,7 @@ def test_p2p_channel_avoid(dev):
dev[0].request("DRIVER_EVENT AVOID_FREQUENCIES")
dev[1].flush_scan_cache()
@remote_compatible
def test_autogo_following_bss(dev, apdev):
"""P2P autonomous GO operate on the same channel as station interface"""
if dev[0].get_mcc() > 1:
@ -208,6 +210,7 @@ def test_autogo_following_bss(dev, apdev):
hwsim_utils.test_connectivity(dev[0], hapd)
dev[0].remove_group(res_go['ifname'])
@remote_compatible
def test_go_neg_with_bss_connected(dev, apdev):
"""P2P channel selection: GO negotiation when station interface is connected"""
@ -404,6 +407,7 @@ def test_go_neg_forced_freq_diff_than_bss_freq(dev, apdev):
subprocess.call(['iw', 'reg', 'set', '00'])
wpas.flush_scan_cache()
@remote_compatible
def test_go_pref_chan_bss_on_diff_chan(dev, apdev):
"""P2P channel selection: Station on different channel than GO configured pref channel"""
@ -446,6 +450,7 @@ def test_go_pref_chan_bss_on_disallowed_chan(dev, apdev):
wpas.global_request("P2P_SET disallow_freq ")
wpas.global_request("SET p2p_pref_chan ")
@remote_compatible
def test_no_go_freq(dev, apdev):
"""P2P channel selection: no GO freq"""
try:
@ -476,6 +481,7 @@ def test_no_go_freq(dev, apdev):
finally:
dev[0].global_request("SET p2p_no_go_freq ")
@remote_compatible
def test_go_neg_peers_force_diff_freq(dev, apdev):
"""P2P channel selection when peers for different frequency"""
try:
@ -485,6 +491,7 @@ def test_go_neg_peers_force_diff_freq(dev, apdev):
return
raise Exception("Unexpected group formation success")
@remote_compatible
def test_autogo_random_channel(dev, apdev):
"""P2P channel selection: GO instantiated on random channel 1, 6, 11"""
freqs = []
@ -501,6 +508,7 @@ def test_autogo_random_channel(dev, apdev):
if i == 20:
raise Exception("GO created 20 times and not all social channels were selected. freqs not selected: " + str(list(set(go_freqs) - set(freqs))))
@remote_compatible
def test_p2p_autogo_pref_chan_disallowed(dev, apdev):
"""P2P channel selection: GO preferred channels are disallowed"""
try:

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import subprocess
@ -15,6 +16,7 @@ from p2p_utils import *
from test_ap_ht import clear_scan_cache
from utils import HwsimSkip
@remote_compatible
def test_concurrent_autogo(dev, apdev):
"""Concurrent P2P autonomous GO"""
logger.info("Connect to an infrastructure AP")
@ -130,6 +132,7 @@ def test_concurrent_autogo_crossconnect(dev, apdev):
raise Exception("Timeout on cross connection disabled event")
dev[0].global_request("P2P_SET cross_connect 0")
@remote_compatible
def test_concurrent_p2pcli(dev, apdev):
"""Concurrent P2P client join"""
logger.info("Connect to an infrastructure AP")
@ -151,6 +154,7 @@ def test_concurrent_p2pcli(dev, apdev):
logger.info("Confirm AP connection after P2P group removal")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_concurrent_grpform_go(dev, apdev):
"""Concurrent P2P group formation to become GO"""
logger.info("Connect to an infrastructure AP")
@ -169,6 +173,7 @@ def test_concurrent_grpform_go(dev, apdev):
logger.info("Confirm AP connection after P2P group removal")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_concurrent_grpform_cli(dev, apdev):
"""Concurrent P2P group formation to become P2P Client"""
logger.info("Connect to an infrastructure AP")
@ -187,6 +192,7 @@ def test_concurrent_grpform_cli(dev, apdev):
logger.info("Confirm AP connection after P2P group removal")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_concurrent_grpform_while_connecting(dev, apdev):
"""Concurrent P2P group formation while connecting to an AP"""
logger.info("Start connection to an infrastructure AP")
@ -204,6 +210,7 @@ def test_concurrent_grpform_while_connecting(dev, apdev):
logger.info("Confirm AP connection after P2P group removal")
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_concurrent_grpform_while_connecting2(dev, apdev):
"""Concurrent P2P group formation while connecting to an AP (2)"""
logger.info("Start connection to an infrastructure AP")
@ -223,6 +230,7 @@ def test_concurrent_grpform_while_connecting2(dev, apdev):
dev[0].wait_completed()
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_concurrent_grpform_while_connecting3(dev, apdev):
"""Concurrent P2P group formation while connecting to an AP (3)"""
logger.info("Start connection to an infrastructure AP")
@ -241,6 +249,7 @@ def test_concurrent_grpform_while_connecting3(dev, apdev):
dev[0].wait_completed()
hwsim_utils.test_connectivity(dev[0], hapd)
@remote_compatible
def test_concurrent_persistent_group(dev, apdev):
"""Concurrent P2P persistent group"""
logger.info("Connect to an infrastructure AP")

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import os
@ -15,6 +16,7 @@ from p2p_utils import *
from test_gas import start_ap
from test_cfg80211 import nl80211_remain_on_channel
@remote_compatible
def test_discovery(dev):
"""P2P device discovery and provision discovery"""
addr0 = dev[0].p2p_dev_addr()
@ -97,6 +99,7 @@ def test_discovery(dev):
if "FAIL" not in dev[0].global_request("P2P_PROV_DISC 00:11:22:33:44:55 foo"):
raise Exception("Invalid P2P_PROV_DISC accepted")
@remote_compatible
def test_discovery_pd_retries(dev):
"""P2P device discovery and provision discovery retries"""
addr0 = dev[0].p2p_dev_addr()
@ -211,6 +214,7 @@ def _test_discovery_ctrl_char_in_devname(dev):
if devname != "Device_B":
raise Exception("Unexpected device_name from peer: " + devname)
@remote_compatible
def test_discovery_dev_type(dev):
"""P2P device discovery with Device Type filter"""
dev[1].request("SET sec_device_type 1-0050F204-2")
@ -492,6 +496,7 @@ def test_p2p_listen_and_offchannel_tx(dev):
dev[2].p2p_stop_find()
dev[0].p2p_stop_find()
@remote_compatible
def test_p2p_listen_and_scan(dev):
"""P2P_LISTEN and scan"""
dev[0].p2p_listen()
@ -536,6 +541,7 @@ def test_p2p_config_methods(dev):
wpas.p2p_stop_find()
@remote_compatible
def test_discovery_after_gas(dev, apdev):
"""P2P device discovery after GAS/ANQP exchange"""
hapd = start_ap(apdev[0])
@ -561,6 +567,7 @@ def test_discovery_after_gas(dev, apdev):
if end - start > 1.3:
raise Exception("Device discovery took unexpectedly long time")
@remote_compatible
def test_discovery_listen_find(dev):
"""P2P_LISTEN immediately followed by P2P_FIND"""
# Request an external remain-on-channel operation to delay start of the ROC

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import os
@ -11,6 +12,7 @@ import os
from tshark import run_tshark
from p2p_utils import *
@remote_compatible
def test_p2p_ext_discovery(dev):
"""P2P device discovery with vendor specific extensions"""
addr0 = dev[0].p2p_dev_addr()
@ -71,6 +73,7 @@ def test_p2p_ext_discovery(dev):
finally:
dev[0].request("VENDOR_ELEM_REMOVE 1 *")
@remote_compatible
def test_p2p_ext_discovery_go(dev):
"""P2P device discovery with vendor specific extensions for GO"""
addr0 = dev[0].p2p_dev_addr()

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import logging
logger = logging.getLogger()
@ -19,6 +20,7 @@ from wpasupplicant import WpaSupplicant
from p2p_utils import *
from test_p2p_messages import parse_p2p_public_action, p2p_hdr, p2p_attr_capability, p2p_attr_go_intent, p2p_attr_config_timeout, p2p_attr_listen_channel, p2p_attr_intended_interface_addr, p2p_attr_channel_list, p2p_attr_device_info, p2p_attr_operating_channel, ie_p2p, ie_wsc, mgmt_tx, P2P_GO_NEG_REQ
@remote_compatible
def test_grpform(dev):
"""P2P group formation using PIN and authorized connection (init -> GO)"""
try:
@ -85,6 +87,7 @@ def test_grpform_c(dev):
if r_res['ifname'] in utils.get_ifnames():
raise Exception("Group interface netdev was not removed")
@remote_compatible
def test_grpform2(dev):
"""P2P group formation using PIN and authorized connection (resp -> GO)"""
go_neg_pin_authorized(i_dev=dev[0], i_intent=0, r_dev=dev[1], r_intent=15)
@ -101,6 +104,7 @@ def test_grpform2_c(dev):
if r_res['ifname'] in utils.get_ifnames():
raise Exception("Group interface netdev was not removed")
@remote_compatible
def test_grpform3(dev):
"""P2P group formation using PIN and re-init GO Negotiation"""
go_neg_pin(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0)
@ -117,6 +121,7 @@ def test_grpform3_c(dev):
if r_res['ifname'] in utils.get_ifnames():
raise Exception("Group interface netdev was not removed")
@remote_compatible
def test_grpform4(dev):
"""P2P group formation response during p2p_find"""
addr1 = dev[1].p2p_dev_addr()
@ -132,6 +137,7 @@ def test_grpform4(dev):
dev[1].p2p_stop_find()
dev[0].p2p_stop_find()
@remote_compatible
def test_grpform_pbc(dev):
"""P2P group formation using PBC and re-init GO Negotiation"""
[i_res, r_res] = go_neg_pbc(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0)
@ -140,6 +146,7 @@ def test_grpform_pbc(dev):
raise Exception("Unexpected device roles")
remove_group(dev[0], dev[1])
@remote_compatible
def test_grpform_pd(dev):
"""P2P group formation with PD-before-GO-Neg workaround"""
[i_res, r_res] = go_neg_pbc(i_dev=dev[0], provdisc=True, r_dev=dev[1], r_listen=True)
@ -236,18 +243,22 @@ def _test_grpform_ext_listen_oper(dev):
if not found:
raise Exception("Could not discover peer that was supposed to use extended listen")
@remote_compatible
def test_both_go_intent_15(dev):
"""P2P GO Negotiation with both devices using GO intent 15"""
go_neg_pin_authorized(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=15, expect_failure=True, i_go_neg_status=9)
@remote_compatible
def test_both_go_neg_display(dev):
"""P2P GO Negotiation with both devices trying to display PIN"""
go_neg_pin_authorized(i_dev=dev[0], r_dev=dev[1], expect_failure=True, i_go_neg_status=10, i_method='display', r_method='display')
@remote_compatible
def test_both_go_neg_enter(dev):
"""P2P GO Negotiation with both devices trying to enter PIN"""
go_neg_pin_authorized(i_dev=dev[0], r_dev=dev[1], expect_failure=True, i_go_neg_status=10, i_method='enter', r_method='enter')
@remote_compatible
def test_go_neg_pbc_vs_pin(dev):
"""P2P GO Negotiation with one device using PBC and the other PIN"""
addr0 = dev[0].p2p_dev_addr()
@ -268,6 +279,7 @@ def test_go_neg_pbc_vs_pin(dev):
if "status=10" not in ev:
raise Exception("Unexpected failure reason: " + ev)
@remote_compatible
def test_go_neg_pin_vs_pbc(dev):
"""P2P GO Negotiation with one device using PIN and the other PBC"""
addr0 = dev[0].p2p_dev_addr()
@ -324,6 +336,7 @@ def test_grpform_per_sta_psk_wps(dev):
dev[2].request("DISCONNECT")
dev[1].wait_go_ending_session()
@remote_compatible
def test_grpform_force_chan_go(dev):
"""P2P group formation forced channel selection by GO"""
[i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
@ -335,6 +348,7 @@ def test_grpform_force_chan_go(dev):
raise Exception("Unexpected channel - did not follow GO's forced channel")
remove_group(dev[0], dev[1])
@remote_compatible
def test_grpform_force_chan_cli(dev):
"""P2P group formation forced channel selection by client"""
[i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=0,
@ -346,12 +360,14 @@ def test_grpform_force_chan_cli(dev):
raise Exception("Unexpected channel - did not follow GO's forced channel")
remove_group(dev[0], dev[1])
@remote_compatible
def test_grpform_force_chan_conflict(dev):
"""P2P group formation fails due to forced channel mismatch"""
go_neg_pin_authorized(i_dev=dev[0], i_intent=0, i_freq=2422,
r_dev=dev[1], r_intent=15, r_freq=2427,
expect_failure=True, i_go_neg_status=7)
@remote_compatible
def test_grpform_pref_chan_go(dev):
"""P2P group formation preferred channel selection by GO"""
try:
@ -366,6 +382,7 @@ def test_grpform_pref_chan_go(dev):
finally:
dev[0].request("SET p2p_pref_chan ")
@remote_compatible
def test_grpform_pref_chan_go_overridden(dev):
"""P2P group formation preferred channel selection by GO overridden by client"""
try:
@ -381,6 +398,7 @@ def test_grpform_pref_chan_go_overridden(dev):
finally:
dev[1].request("SET p2p_pref_chan ")
@remote_compatible
def test_grpform_no_go_freq_forcing_chan(dev):
"""P2P group formation with no-GO freq forcing channel"""
try:
@ -395,6 +413,7 @@ def test_grpform_no_go_freq_forcing_chan(dev):
finally:
dev[1].request("SET p2p_no_go_freq ")
@remote_compatible
def test_grpform_no_go_freq_conflict(dev):
"""P2P group formation fails due to no-GO range forced by client"""
try:
@ -405,6 +424,7 @@ def test_grpform_no_go_freq_conflict(dev):
finally:
dev[1].request("SET p2p_no_go_freq ")
@remote_compatible
def test_grpform_no_5ghz_world_roaming(dev):
"""P2P group formation with world roaming regulatory"""
[i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=0,
@ -415,6 +435,7 @@ def test_grpform_no_5ghz_world_roaming(dev):
raise Exception("Unexpected channel - did not follow world roaming rules")
remove_group(dev[0], dev[1])
@remote_compatible
def test_grpform_no_5ghz_add_cli(dev):
"""P2P group formation with passive scan 5 GHz and p2p_add_cli_chan=1"""
try:
@ -431,6 +452,7 @@ def test_grpform_no_5ghz_add_cli(dev):
dev[0].request("SET p2p_add_cli_chan 0")
dev[1].request("SET p2p_add_cli_chan 0")
@remote_compatible
def test_grpform_no_5ghz_add_cli2(dev):
"""P2P group formation with passive scan 5 GHz and p2p_add_cli_chan=1 (reverse)"""
try:
@ -447,6 +469,7 @@ def test_grpform_no_5ghz_add_cli2(dev):
dev[0].request("SET p2p_add_cli_chan 0")
dev[1].request("SET p2p_add_cli_chan 0")
@remote_compatible
def test_grpform_no_5ghz_add_cli3(dev):
"""P2P group formation with passive scan 5 GHz and p2p_add_cli_chan=1 (intent 15)"""
try:
@ -463,6 +486,7 @@ def test_grpform_no_5ghz_add_cli3(dev):
dev[0].request("SET p2p_add_cli_chan 0")
dev[1].request("SET p2p_add_cli_chan 0")
@remote_compatible
def test_grpform_no_5ghz_add_cli4(dev):
"""P2P group formation with passive scan 5 GHz and p2p_add_cli_chan=1 (reverse; intent 15)"""
try:
@ -479,6 +503,7 @@ def test_grpform_no_5ghz_add_cli4(dev):
dev[0].request("SET p2p_add_cli_chan 0")
dev[1].request("SET p2p_add_cli_chan 0")
@remote_compatible
def test_grpform_incorrect_pin(dev):
"""P2P GO Negotiation with incorrect PIN"""
dev[1].p2p_listen()
@ -513,6 +538,7 @@ def test_grpform_incorrect_pin(dev):
if ev is None:
raise Exception("Group formation failure timed out")
@remote_compatible
def test_grpform_reject(dev):
"""User rejecting group formation attempt by a P2P peer"""
addr0 = dev[0].p2p_dev_addr()
@ -533,6 +559,7 @@ def test_grpform_reject(dev):
if "status=11" not in ev:
raise Exception("Unexpected status code in rejection")
@remote_compatible
def test_grpform_pd_no_probe_resp(dev):
"""GO Negotiation after PD, but no Probe Response"""
addr0 = dev[0].p2p_dev_addr()
@ -618,6 +645,7 @@ def clear_pbc_overlap(dev, ap):
dev[1].flush_scan_cache()
time.sleep(0.1)
@remote_compatible
def test_grpform_pbc_overlap(dev, apdev):
"""P2P group formation during PBC overlap"""
params = { "ssid": "wps", "eap_server": "1", "wps_state": "1" }
@ -655,6 +683,7 @@ def test_grpform_pbc_overlap(dev, apdev):
clear_pbc_overlap(dev, apdev[0])
@remote_compatible
def test_grpform_pbc_overlap_group_iface(dev, apdev):
"""P2P group formation during PBC overlap using group interfaces"""
# Note: Need to include P2P IE from the AP to get the P2P interface BSS
@ -693,6 +722,7 @@ def test_grpform_pbc_overlap_group_iface(dev, apdev):
clear_pbc_overlap(dev, apdev[0])
@remote_compatible
def test_grpform_goneg_fail_with_group_iface(dev):
"""P2P group formation fails while using group interface"""
dev[0].request("SET p2p_no_group_iface 0")
@ -818,6 +848,7 @@ def test_grpform_no_wsc_done(dev):
if mode != "P2P GO - group formation":
raise Exception("Unexpected mode on GO during group formation: " + mode)
@remote_compatible
def test_grpform_wait_peer(dev):
"""P2P group formation wait for peer to become ready"""
addr0 = dev[0].p2p_dev_addr()
@ -842,6 +873,7 @@ def test_grpform_wait_peer(dev):
raise Exception("Group formation timed out")
dev[0].remove_group()
@remote_compatible
def test_invalid_p2p_connect_command(dev):
"""P2P_CONNECT error cases"""
id = dev[0].add_network()
@ -864,6 +896,7 @@ def test_invalid_p2p_connect_command(dev):
if "FAIL-CHANNEL-UNSUPPORTED" not in dev[0].request("P2P_CONNECT 00:11:22:33:44:55 pin freq=3000"):
raise Exception("Unsupported channel not reported")
@remote_compatible
def test_p2p_unauthorize(dev):
"""P2P_UNAUTHORIZE to unauthorize a peer"""
if "FAIL" not in dev[0].request("P2P_UNAUTHORIZE foo"):
@ -884,6 +917,7 @@ def test_p2p_unauthorize(dev):
if ev is None:
raise Exception("No GO Negotiation Request RX reported")
@remote_compatible
def test_grpform_pbc_multiple(dev):
"""P2P group formation using PBC multiple times in a row"""
try:
@ -936,6 +970,7 @@ def test_grpform_not_ready2(dev):
for i in range(3):
dev[i].p2p_stop_find()
@remote_compatible
def test_grpform_and_scan(dev):
"""GO Negotiation and scan operations"""
addr0 = dev[0].p2p_dev_addr()
@ -1108,6 +1143,7 @@ def test_grpform_go_neg_dup_on_restart(dev):
lower.dump_monitor()
higher.dump_monitor()
@remote_compatible
def test_grpform_go_neg_stopped(dev):
"""GO Negotiation stopped after TX start"""
addr0 = dev[0].p2p_dev_addr()

View file

@ -4,11 +4,13 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import hwsim_utils
@remote_compatible
def test_p2p_go_invite(dev):
"""P2P GO inviting a client to join"""
addr0 = dev[0].p2p_dev_addr()
@ -53,6 +55,7 @@ def test_p2p_go_invite(dev):
dev[0].remove_group()
dev[1].wait_go_ending_session()
@remote_compatible
def test_p2p_go_invite_auth(dev):
"""P2P GO inviting a client to join (authorized invitation)"""
addr0 = dev[0].p2p_dev_addr()
@ -104,6 +107,7 @@ def test_p2p_go_invite_auth(dev):
dev[0].remove_group()
dev[1].wait_go_ending_session()
@remote_compatible
def test_p2p_go_invite_unknown(dev):
"""P2P GO inviting a client that has not discovered the GO"""
try:
@ -176,6 +180,7 @@ def test_p2p_cli_invite(dev):
dev[1].wait_go_ending_session()
dev[2].wait_go_ending_session()
@remote_compatible
def test_p2p_invite_invalid(dev):
"""Invalid parameters to P2P_INVITE"""
id = dev[0].add_network()

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import struct
import time
@ -219,12 +220,14 @@ def parse_p2p_public_action(payload):
return p2p
@remote_compatible
def test_p2p_msg_empty(dev, apdev):
"""P2P protocol test: empty P2P Public Action frame"""
dst, src, hapd, channel = start_p2p(dev, apdev)
msg = p2p_hdr(dst, src)
hapd.mgmt_tx(msg)
@remote_compatible
def test_p2p_msg_long_ssid(dev, apdev):
"""P2P protocol test: Too long SSID in P2P Public Action frame"""
dst, src, hapd, channel = start_p2p(dev, apdev)
@ -244,6 +247,7 @@ def test_p2p_msg_long_ssid(dev, apdev):
if ev is None:
raise Exception("Timeout on device found event")
@remote_compatible
def test_p2p_msg_long_dev_name(dev, apdev):
"""P2P protocol test: Too long Device Name in P2P Public Action frame"""
dst, src, hapd, channel = start_p2p(dev, apdev)
@ -835,6 +839,7 @@ def test_p2p_msg_invitation_req_to_go(dev, apdev):
if p2p['p2p_status'] != 7 and dev[1].get_mcc() <= 1:
raise Exception("Unexpected status %d" % p2p['p2p_status'])
@remote_compatible
def test_p2p_msg_invitation_req_unknown(dev, apdev):
"""P2P protocol tests for invitation request from unknown peer"""
dst, src, hapd, channel = start_p2p(dev, apdev)
@ -857,6 +862,7 @@ def test_p2p_msg_invitation_req_unknown(dev, apdev):
if hapd.mgmt_rx(timeout=1) is None:
raise Exception("No invitation response " + str(dialog_token))
@remote_compatible
def test_p2p_msg_invitation_no_common_channels(dev, apdev):
"""P2P protocol tests for invitation request without common channels"""
dst, src, hapd, channel = start_p2p(dev, apdev)
@ -1119,6 +1125,7 @@ def test_p2p_msg_invitation_resend_duplicate(dev, apdev):
dev[0].group_form_result(ev)
dev[0].remove_group()
@remote_compatible
def test_p2p_msg_pd_req(dev, apdev):
"""P2P protocol tests for provision discovery request processing"""
dst, src, hapd, channel = start_p2p(dev, apdev)
@ -1940,6 +1947,7 @@ def gas_hdr(dst, src, type, req=True, dialog_token=0):
dialog_token)
return msg
@remote_compatible
def test_p2p_msg_sd(dev, apdev):
"""P2P protocol tests for service discovery messages"""
dst, src, hapd, channel = start_p2p(dev, apdev)

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import re
@ -12,6 +13,7 @@ import time
import hwsim_utils
from p2p_utils import *
@remote_compatible
def test_persistent_group(dev):
"""P2P persistent group formation and re-invocation"""
form(dev[0], dev[1])
@ -56,12 +58,14 @@ def test_persistent_group(dev):
if dev[1].p2p_dev_addr() in clients:
raise Exception("Peer was still in client list")
@remote_compatible
def test_persistent_group2(dev):
"""P2P persistent group formation with reverse roles"""
form(dev[0], dev[1], reverse_init=True)
invite_from_cli(dev[0], dev[1])
invite_from_go(dev[0], dev[1])
@remote_compatible
def test_persistent_group3(dev):
"""P2P persistent group formation and re-invocation with empty BSS table"""
form(dev[0], dev[1])
@ -259,6 +263,7 @@ def test_persistent_group_invite_removed_client(dev):
terminate_group(dev[0], dev[1])
@remote_compatible
def test_persistent_group_channel(dev):
"""P2P persistent group re-invocation with channel selection"""
form(dev[0], dev[1], test_data=False)
@ -284,6 +289,7 @@ def test_persistent_group_channel(dev):
raise Exception("Persistent group client channel preference not followed")
terminate_group(dev[0], dev[1])
@remote_compatible
def test_persistent_group_and_role_change(dev):
"""P2P persistent group, auto GO in another role, and re-invocation"""
form(dev[0], dev[1])
@ -352,6 +358,7 @@ def test_persistent_go_client_list(dev):
if 'persistent' not in peer or peer['persistent'] != id:
raise Exception("Persistent group client not recognized(2)")
@remote_compatible
def test_persistent_group_in_grpform(dev):
"""P2P persistent group parameters re-used in group formation"""
addr0 = dev[0].p2p_dev_addr()
@ -373,6 +380,7 @@ def test_persistent_group_in_grpform(dev):
logger.debug("i_res: " + str(i_res))
logger.debug("r_res: " + str(r_res))
@remote_compatible
def test_persistent_group_without_persistent_reconnect(dev):
"""P2P persistent group re-invocation without persistent reconnect"""
form(dev[0], dev[1])
@ -447,6 +455,7 @@ def test_persistent_group_without_persistent_reconnect(dev):
[go_res, cli_res] = check_result(dev[0], dev[1])
terminate_group(dev[0], dev[1])
@remote_compatible
def test_persistent_group_already_running(dev):
"""P2P persistent group formation and invitation while GO already running"""
form(dev[0], dev[1])
@ -463,6 +472,7 @@ def test_persistent_group_already_running(dev):
raise Exception("Could not state GO")
invite_from_cli(dev[0], dev[1])
@remote_compatible
def test_persistent_group_add_cli_chan(dev):
"""P2P persistent group formation and re-invocation with p2p_add_cli_chan=1"""
try:
@ -480,6 +490,7 @@ def test_persistent_group_add_cli_chan(dev):
dev[0].request("SET p2p_add_cli_chan 0")
dev[1].request("SET p2p_add_cli_chan 0")
@remote_compatible
def test_persistent_invalid_group_add(dev):
"""Invalid P2P_GROUP_ADD command"""
id = dev[0].add_network()
@ -538,6 +549,7 @@ def test_persistent_group_missed_inv_resp(dev):
terminate_group(dev[0], dev[1])
@remote_compatible
def test_persistent_group_profile_add(dev):
"""Create a P2P persistent group with ADD_NETWORK"""
passphrase="passphrase here"
@ -558,6 +570,7 @@ def test_persistent_group_profile_add(dev):
dev[0].remove_group()
dev[1].wait_go_ending_session()
@remote_compatible
def test_persistent_group_cancel_on_cli(dev):
"""P2P persistent group formation, re-invocation, and cancel"""
dev[0].global_request("SET p2p_no_group_iface 0")
@ -578,6 +591,7 @@ def test_persistent_group_cancel_on_cli(dev):
raise Exception("P2P_CANCEL succeeded unexpectedly on GO")
terminate_group(dev[0], dev[1])
@remote_compatible
def test_persistent_group_cancel_on_cli2(dev):
"""P2P persistent group formation, re-invocation, and cancel (2)"""
form(dev[0], dev[1])
@ -595,6 +609,7 @@ def test_persistent_group_cancel_on_cli2(dev):
raise Exception("P2P_CANCEL succeeded unexpectedly on GO")
terminate_group(dev[0], dev[1])
@remote_compatible
def test_persistent_group_peer_dropped(dev):
"""P2P persistent group formation and re-invocation with peer having dropped group"""
form(dev[0], dev[1], reverse_init=True)
@ -615,6 +630,7 @@ def test_persistent_group_peer_dropped(dev):
logger.info("Verify that a new group can be formed")
form(dev[0], dev[1], reverse_init=True)
@remote_compatible
def test_persistent_group_peer_dropped2(dev):
"""P2P persistent group formation and re-invocation with peer having dropped group (2)"""
form(dev[0], dev[1])

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import time
@ -87,6 +88,7 @@ def run_sd(dev, dst, query, exp_query=None, fragment=False, query2=None):
return ev
@remote_compatible
def test_p2p_service_discovery(dev):
"""P2P service discovery"""
addr0 = dev[0].p2p_dev_addr()
@ -132,6 +134,7 @@ def test_p2p_service_discovery4(dev):
if "496e7465726e6574" not in ev:
raise Exception("Unexpected service discovery response contents (UPnP)")
@remote_compatible
def test_p2p_service_discovery_multiple_queries(dev):
"""P2P service discovery with multiple queries"""
for dst in [ "00:00:00:00:00:00", dev[0].p2p_dev_addr() ]:
@ -161,6 +164,7 @@ def test_p2p_service_discovery_fragmentation(dev):
if "496e7465726e6574" not in ev:
raise Exception("Unexpected service discovery response contents (UPnP)")
@remote_compatible
def test_p2p_service_discovery_bonjour(dev):
"""P2P service discovery (Bonjour)"""
ev = run_sd(dev, "00:00:00:00:00:00", "02000101")
@ -171,6 +175,7 @@ def test_p2p_service_discovery_bonjour(dev):
if "496e7465726e6574" in ev:
raise Exception("Unexpected service discovery response contents (UPnP not expected)")
@remote_compatible
def test_p2p_service_discovery_bonjour2(dev):
"""P2P service discovery (Bonjour AFS)"""
ev = run_sd(dev, "00:00:00:00:00:00", "130001010b5f6166706f766572746370c00c000c01")
@ -181,6 +186,7 @@ def test_p2p_service_discovery_bonjour2(dev):
if "496e7465726e6574" in ev:
raise Exception("Unexpected service discovery response contents (UPnP not expected)")
@remote_compatible
def test_p2p_service_discovery_bonjour3(dev):
"""P2P service discovery (Bonjour AFS - no match)"""
ev = run_sd(dev, "00:00:00:00:00:00", "130001010b5f6166706f766572746370c00c000c02")
@ -193,6 +199,7 @@ def test_p2p_service_discovery_bonjour3(dev):
if "496e7465726e6574" in ev:
raise Exception("Unexpected service discovery response contents (UPnP not expected)")
@remote_compatible
def test_p2p_service_discovery_upnp(dev):
"""P2P service discovery (UPnP)"""
ev = run_sd(dev, "00:00:00:00:00:00", "02000201")
@ -201,6 +208,7 @@ def test_p2p_service_discovery_upnp(dev):
if "496e7465726e6574" not in ev:
raise Exception("Unexpected service discovery response contents (UPnP)")
@remote_compatible
def test_p2p_service_discovery_upnp2(dev):
"""P2P service discovery (UPnP using request helper)"""
ev = run_sd(dev, "00:00:00:00:00:00", "upnp 10 ssdp:all", "0b00020110737364703a616c6c")
@ -209,6 +217,7 @@ def test_p2p_service_discovery_upnp2(dev):
if "496e7465726e6574" not in ev:
raise Exception("Unexpected service discovery response contents (UPnP)")
@remote_compatible
def test_p2p_service_discovery_upnp3(dev):
"""P2P service discovery (UPnP using request helper - no match)"""
ev = run_sd(dev, "00:00:00:00:00:00", "upnp 10 ssdp:foo", "0b00020110737364703a666f6f")
@ -219,6 +228,7 @@ def test_p2p_service_discovery_upnp3(dev):
if "496e7465726e6574" in ev:
raise Exception("Unexpected service discovery response contents (UPnP)")
@remote_compatible
def test_p2p_service_discovery_ws(dev):
"""P2P service discovery (WS-Discovery)"""
ev = run_sd(dev, "00:00:00:00:00:00", "02000301")
@ -229,6 +239,7 @@ def test_p2p_service_discovery_ws(dev):
if "0300030101" not in ev:
raise Exception("Unexpected service discovery response contents (WS)")
@remote_compatible
def test_p2p_service_discovery_wfd(dev):
"""P2P service discovery (Wi-Fi Display)"""
dev[0].global_request("SET wifi_display 1")
@ -240,6 +251,7 @@ def test_p2p_service_discovery_wfd(dev):
if "0300040101" not in ev:
raise Exception("Unexpected response to WFD SD query (protocol was disabled)")
@remote_compatible
def test_p2p_service_discovery_req_cancel(dev):
"""Cancel a P2P service discovery request"""
if "FAIL" not in dev[0].global_request("P2P_SERV_DISC_CANCEL_REQ ab"):
@ -263,6 +275,7 @@ def test_p2p_service_discovery_req_cancel(dev):
if "OK" not in dev[0].global_request("P2P_SERV_DISC_CANCEL_REQ " + query):
raise Exception("Unexpected SD(broadcast) cancel failure")
@remote_compatible
def test_p2p_service_discovery_go(dev):
"""P2P service discovery from GO"""
addr0 = dev[0].p2p_dev_addr()
@ -387,6 +400,7 @@ def _test_p2p_service_discovery_external(dev):
if "FAIL" not in dev[0].global_request("P2P_SERV_DISC_RESP " + cmd):
raise Exception("Invalid P2P_SERV_DISC_RESP accepted: " + cmd)
@remote_compatible
def test_p2p_service_discovery_external(dev):
"""P2P service discovery using external response"""
try:
@ -394,6 +408,7 @@ def test_p2p_service_discovery_external(dev):
finally:
dev[0].global_request("P2P_SERV_DISC_EXTERNAL 0")
@remote_compatible
def test_p2p_service_discovery_invalid_commands(dev):
"""P2P service discovery invalid commands"""
for cmd in [ "bonjour",
@ -454,6 +469,7 @@ def get_p2p_state(dev):
raise Exception("Could not get p2p_state")
return p2p_state
@remote_compatible
def test_p2p_service_discovery_peer_not_listening(dev):
"""P2P service discovery and peer not listening"""
addr0 = dev[0].p2p_dev_addr()
@ -483,6 +499,7 @@ def test_p2p_service_discovery_peer_not_listening(dev):
if p2p_state != "IDLE":
raise Exception("Unexpected p2p_state after P2P_FIND timeout: " + p2p_state)
@remote_compatible
def test_p2p_service_discovery_peer_not_listening2(dev):
"""P2P service discovery and peer not listening"""
addr0 = dev[0].p2p_dev_addr()

View file

@ -4,6 +4,8 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
def test_p2p_set(dev):
"""P2P_SET commands"""
for cmd in [ "",
@ -102,6 +104,7 @@ def test_p2p_set_managed(dev):
dev[2].p2p_stop_find()
dev[0].p2p_stop_find()
@remote_compatible
def test_p2p_set_ssid_postfix(dev):
"""P2P_SET ssid_postfix"""
addr0 = dev[0].p2p_dev_addr()

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import time
@ -298,6 +299,7 @@ def test_wifi_display_persistent_group(dev):
dev[1].request("SET wifi_display 0")
dev[2].request("SET wifi_display 0")
@remote_compatible
def test_wifi_display_invalid_subelem(dev):
"""Wi-Fi Display and invalid subelement parsing"""
addr1 = dev[1].p2p_dev_addr()

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import time
@ -399,6 +400,7 @@ def set_no_group_iface(dev, enable):
else:
dev.global_request("SET p2p_no_group_iface 0")
@remote_compatible
def test_p2ps_exact_search(dev):
"""P2PS exact service request"""
p2ps_advertise(r_dev=dev[0], r_role='1', svc_name='org.wi-fi.wfds.send.rx',
@ -410,6 +412,7 @@ def test_p2ps_exact_search(dev):
if ev0 is None:
raise Exception("Unable to remove the advertisement instance")
@remote_compatible
def test_p2ps_exact_search_srvinfo(dev):
"""P2PS exact service request with service info"""
p2ps_advertise(r_dev=dev[0], r_role='0', svc_name='org.wi-fi.wfds.send.rx',
@ -422,6 +425,7 @@ def test_p2ps_exact_search_srvinfo(dev):
if ev0 is None:
raise Exception("Unable to remove the advertisement instance")
@remote_compatible
def test_p2ps_nonexact_search(dev):
"""P2PS nonexact seek request"""
p2ps_advertise(r_dev=dev[0], r_role='0', svc_name='org.wi-fi.wfds.play.rx',
@ -434,6 +438,7 @@ def test_p2ps_nonexact_search(dev):
if ev0 is None:
raise Exception("Unable to remove the advertisement instance")
@remote_compatible
def test_p2ps_nonexact_search_srvinfo(dev):
"""P2PS nonexact seek request with service info"""
p2ps_advertise(r_dev=dev[0], r_role='0', svc_name='org.wi-fi.wfds.send.rx',
@ -446,6 +451,7 @@ def test_p2ps_nonexact_search_srvinfo(dev):
if ev0 is None:
raise Exception("Unable to remove the advertisement instance")
@remote_compatible
def test_p2ps_connect_p2ps_method_nonautoaccept(dev):
"""P2PS connect for non-auto-accept and P2PS config method"""
p2ps_advertise(r_dev=dev[0], r_role='0', svc_name='org.wi-fi.wfds.send.rx',
@ -462,6 +468,7 @@ def test_p2ps_connect_p2ps_method_nonautoaccept(dev):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_p2ps_method_autoaccept(dev):
"""P2PS connection with P2PS default config method and auto-accept"""
p2ps_advertise(r_dev=dev[0], r_role='1', svc_name='org.wi-fi.wfds.send.rx',
@ -478,6 +485,7 @@ def test_p2ps_connect_p2ps_method_autoaccept(dev):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_keypad_method_nonautoaccept(dev):
"""P2PS Connection with non-auto-accept and seeker having keypad method"""
p2ps_advertise(r_dev=dev[0], r_role='0', svc_name='org.wi-fi.wfds.send.rx',
@ -495,6 +503,7 @@ def test_p2ps_connect_keypad_method_nonautoaccept(dev):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_display_method_nonautoaccept(dev):
"""P2PS connection with non-auto-accept and seeker having display method"""
p2ps_advertise(r_dev=dev[0], r_role='0', svc_name='org.wi-fi.wfds.send.rx',
@ -511,6 +520,7 @@ def test_p2ps_connect_display_method_nonautoaccept(dev):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_keypad_method_autoaccept(dev):
"""P2PS connection with auto-accept and keypad method on seeker side"""
p2ps_advertise(r_dev=dev[0], r_role='1', svc_name='org.wi-fi.wfds.send.rx',
@ -527,6 +537,7 @@ def test_p2ps_connect_keypad_method_autoaccept(dev):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_display_method_autoaccept(dev):
"""P2PS connection with auto-accept and display method on seeker side"""
p2ps_advertise(r_dev=dev[0], r_role='1', svc_name='org.wi-fi.wfds.send.rx',
@ -543,6 +554,7 @@ def test_p2ps_connect_display_method_autoaccept(dev):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_adv_go_p2ps_method(dev):
"""P2PS auto-accept connection with advertisement as GO and P2PS method"""
p2ps_advertise(r_dev=dev[0], r_role='4', svc_name='org.wi-fi.wfds.send.rx',
@ -559,6 +571,7 @@ def test_p2ps_connect_adv_go_p2ps_method(dev):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_adv_go_p2ps_method_group_iface(dev):
"""P2PS auto-accept connection with advertisement as GO and P2PS method using separate group interface"""
set_no_group_iface(dev[0], 0)
@ -577,6 +590,7 @@ def test_p2ps_connect_adv_go_p2ps_method_group_iface(dev):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_adv_client_p2ps_method(dev):
"""P2PS auto-accept connection with advertisement as Client and P2PS method"""
p2ps_advertise(r_dev=dev[0], r_role='2', svc_name='org.wi-fi.wfds.send.rx',
@ -608,10 +622,12 @@ def p2ps_connect_adv_go_pin_method(dev, keep_group=False):
raise Exception("Unable to remove the advertisement instance")
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_connect_adv_go_pin_method(dev):
"""P2PS advertiser as GO with keypad config method on seeker side and auto-accept"""
p2ps_connect_adv_go_pin_method(dev)
@remote_compatible
def test_p2ps_connect_adv_client_pin_method(dev):
"""P2PS advertiser as client with keypad config method on seeker side and auto-accept"""
dev[0].flush_scan_cache()
@ -845,6 +861,7 @@ def test_p2ps_connect_adv_go_persistent(dev):
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_adv_go_persistent_no_peer_entry(dev):
"""P2PS advertisement as GO having persistent group (no peer entry)"""
go_neg_pin_authorized_persistent(i_dev=dev[0], i_intent=15,
@ -863,6 +880,7 @@ def test_p2ps_adv_go_persistent_no_peer_entry(dev):
if "persist=" not in ev0 or "persist=" not in ev1:
raise Exception("Persistent group isn't used by peers")
@remote_compatible
def test_p2ps_pd_follow_on_status_failure(dev):
"""P2PS PD follow on request with status 11"""
addr0 = dev[0].p2p_dev_addr()
@ -921,6 +939,7 @@ def test_p2ps_go_probe(dev):
dev[0].global_request("P2P_SERVICE_DEL asp " + str(adv_id))
remove_group(dev[0], dev[1])
@remote_compatible
def test_p2ps_wildcard_p2ps(dev):
"""P2PS wildcard SD Probe Request/Response"""
p2ps_wildcard = "org.wi-fi.wfds"
@ -1049,34 +1068,40 @@ def p2ps_test_feature_capability_cpt(dev, adv_cpt, seeker_cpt, adv_role,
if ev is None:
raise Exception("Unable to remove the advertisement instance")
@remote_compatible
def test_p2ps_feature_capability_mac_autoaccept(dev):
"""P2PS PD Feature Capability CPT: advertiser MAC, seeker UDP:MAC, autoaccept"""
p2ps_test_feature_capability_cpt(dev, adv_cpt="MAC", seeker_cpt="UDP:MAC",
adv_role="4", result="MAC")
@remote_compatible
def test_p2ps_feature_capability_mac_nonautoaccept(dev):
"""P2PS PD Feature Capability CPT: advertiser:MAC, seeker UDP:MAC, nonautoaccept"""
p2ps_test_feature_capability_cpt(dev, adv_cpt="MAC", seeker_cpt="UDP:MAC",
adv_role="0", result="MAC")
@remote_compatible
def test_p2ps_feature_capability_mac_udp_autoaccept(dev):
"""P2PS PD Feature Capability CPT: advertiser MAC:UDP, seeker UDP:MAC, autoaccept"""
p2ps_test_feature_capability_cpt(dev, adv_cpt="MAC:UDP",
seeker_cpt="UDP:MAC", adv_role="2",
result="MAC")
@remote_compatible
def test_p2ps_feature_capability_mac_udp_nonautoaccept(dev):
"""P2PS PD Feature Capability CPT: advertiser MAC:UDP, seeker UDP:MAC, nonautoaccept"""
p2ps_test_feature_capability_cpt(dev, adv_cpt="MAC:UDP",
seeker_cpt="UDP:MAC", adv_role="0",
result="UDP")
@remote_compatible
def test_p2ps_feature_capability_udp_mac_autoaccept(dev):
"""P2PS PD Feature Capability CPT: advertiser UDP:MAC, seeker MAC:UDP, autoaccept"""
p2ps_test_feature_capability_cpt(dev, adv_cpt="UDP:MAC",
seeker_cpt="MAC:UDP", adv_role="2",
result="UDP")
@remote_compatible
def test_p2ps_feature_capability_udp_mac_nonautoaccept(dev):
"""P2PS PD Feature Capability CPT: advertiser UDP:MAC, seeker MAC:UDP, nonautoaccept"""
p2ps_test_feature_capability_cpt(dev, adv_cpt="UDP:MAC",
@ -1205,6 +1230,7 @@ def test_p2ps_channel_both_connected_different_mcc(dev, apdev):
def clear_disallow_handler(seeker, advertiser):
advertiser.global_request("P2P_SET disallow_freq ")
@remote_compatible
def test_p2ps_channel_disallow_freq(dev, apdev):
"""P2PS connection with P2PS method - disallow freqs"""
set_no_group_iface(dev[0], 0)
@ -1299,6 +1325,7 @@ def test_p2ps_channel_sta_connected_disallow_freq_mcc(dev, apdev):
dev[0].global_request("P2P_SET disallow_freq ")
dev[0].global_request("P2P_SERVICE_DEL asp all")
@remote_compatible
def test_p2ps_active_go_adv(dev, apdev):
"""P2PS connection with P2PS method - active GO on advertiser"""
set_no_group_iface(dev[0], 0)
@ -1330,6 +1357,7 @@ def test_p2ps_active_go_adv(dev, apdev):
remove_group(dev[0], dev[1])
dev[0].global_request("P2P_SERVICE_DEL asp all")
@remote_compatible
def test_p2ps_active_go_seeker(dev, apdev):
"""P2PS connection with P2PS method - active GO on seeker"""
set_no_group_iface(dev[0], 0)
@ -1437,6 +1465,7 @@ def test_p2ps_channel_active_go_and_station_different(dev, apdev):
dev[0].global_request("P2P_SERVICE_DEL asp all")
set_random_listen_chan(dev[1])
@remote_compatible
def test_p2ps_channel_active_go_and_station_different_mcc(dev, apdev):
"""P2PS connection, active P2P GO and station on channel"""
if dev[0].get_mcc() == 1:
@ -1532,6 +1561,7 @@ def run_p2ps_connect_p2p_device2(dev, no_group_iface):
raise Exception("Unable to remove the advertisement instance")
remove_group(wpas, dev[0])
@remote_compatible
def test_p2ps_connect_p2ps_method_no_pin(dev):
"""P2P group formation using P2PS method without specifying PIN"""
dev[0].p2p_listen()

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import time
@ -13,6 +14,7 @@ import hostapd
from utils import skip_with_fips
from wlantest import Wlantest
@remote_compatible
def test_peerkey(dev, apdev):
"""RSN AP and PeerKey between two STAs"""
ssid = "test-peerkey"
@ -47,6 +49,7 @@ def test_peerkey_unknown_peer(dev, apdev):
dev[0].request("STKSTART " + dev[2].p2p_interface_addr())
time.sleep(0.5)
@remote_compatible
def test_peerkey_pairwise_mismatch(dev, apdev):
"""RSN TKIP+CCMP AP and PeerKey between two STAs using different ciphers"""
skip_with_fips(dev[0])

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import hashlib
import hmac
@ -27,6 +28,7 @@ def connect(dev, ssid, wait_connect=True):
password_hex="0123456789abcdef0123456789abcdef",
wait_connect=wait_connect)
@remote_compatible
def test_radius_auth_unreachable(dev, apdev):
"""RADIUS Authentication server unreachable"""
params = hostapd.wpa2_eap_params(ssid="radius-auth")
@ -1138,6 +1140,7 @@ def test_radius_auth_force_client_addr(dev, apdev):
hapd = hostapd.add_ap(apdev[0], params)
connect(dev[0], "radius-auth")
@remote_compatible
def test_radius_auth_force_invalid_client_addr(dev, apdev):
"""RADIUS client address specified and invalid address"""
params = hostapd.wpa2_eap_params(ssid="radius-auth")

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import os
import time
@ -15,6 +16,7 @@ import hostapd
from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger
from test_ap_psk import find_wpas_process, read_process_memory, verify_not_present, get_key_locations
@remote_compatible
def test_sae(dev, apdev):
"""SAE with default group"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -38,6 +40,7 @@ def test_sae(dev, apdev):
if "[WPA2-SAE-CCMP]" not in bss['flags']:
raise Exception("Unexpected BSS flags: " + bss['flags'])
@remote_compatible
def test_sae_password_ecc(dev, apdev):
"""SAE with number of different passwords (ECC)"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -57,6 +60,7 @@ def test_sae_password_ecc(dev, apdev):
dev[0].request("REMOVE_NETWORK all")
dev[0].wait_disconnected()
@remote_compatible
def test_sae_password_ffc(dev, apdev):
"""SAE with number of different passwords (FFC)"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -77,6 +81,7 @@ def test_sae_password_ffc(dev, apdev):
dev[0].request("REMOVE_NETWORK all")
dev[0].wait_disconnected()
@remote_compatible
def test_sae_pmksa_caching(dev, apdev):
"""SAE and PMKSA caching"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -99,6 +104,7 @@ def test_sae_pmksa_caching(dev, apdev):
if dev[0].get_status_field('sae_group') is not None:
raise Exception("SAE group claimed to have been used")
@remote_compatible
def test_sae_pmksa_caching_disabled(dev, apdev):
"""SAE and PMKSA caching disabled"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -172,6 +178,7 @@ def test_sae_groups(dev, apdev):
dev[0].wait_disconnected()
dev[0].dump_monitor()
@remote_compatible
def test_sae_group_nego(dev, apdev):
"""SAE group negotiation"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -188,6 +195,7 @@ def test_sae_group_nego(dev, apdev):
if dev[0].get_status_field('sae_group') != '19':
raise Exception("Expected SAE group not used")
@remote_compatible
def test_sae_anti_clogging(dev, apdev):
"""SAE anti clogging"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -238,6 +246,7 @@ def test_sae_mixed(dev, apdev):
dev[i].connect("test-sae", psk="12345678", key_mgmt="SAE",
scan_freq="2412")
@remote_compatible
def test_sae_missing_password(dev, apdev):
"""SAE and missing password"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -380,6 +389,7 @@ def test_sae_key_lifetime_in_memory(dev, apdev, params):
verify_not_present(buf, sae_keyseed, fname, "SAE(keyseed)")
verify_not_present(buf, sae_kck, fname, "SAE(KCK)")
@remote_compatible
def test_sae_oom_wpas(dev, apdev):
"""SAE and OOM in wpa_supplicant"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -404,6 +414,7 @@ def test_sae_oom_wpas(dev, apdev):
scan_freq="2412")
dev[0].request("REMOVE_NETWORK all")
@remote_compatible
def test_sae_proto_ecc(dev, apdev):
"""SAE protocol testing (ECC)"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -502,6 +513,7 @@ def test_sae_proto_ecc(dev, apdev):
hapd.set("ext_mgmt_frame_handling", "0")
hapd.dump_monitor()
@remote_compatible
def test_sae_proto_ffc(dev, apdev):
"""SAE protocol testing (FFC)"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -582,6 +594,7 @@ def test_sae_proto_ffc(dev, apdev):
hapd.set("ext_mgmt_frame_handling", "0")
hapd.dump_monitor()
@remote_compatible
def test_sae_no_ffc_by_default(dev, apdev):
"""SAE and default groups rejecting FFC"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -642,14 +655,17 @@ def sae_reflection_attack(apdev, dev, group):
if req['subtype'] == 11:
raise Exception("Unexpected Authentication frame seen")
@remote_compatible
def test_sae_reflection_attack_ecc(dev, apdev):
"""SAE reflection attack (ECC)"""
sae_reflection_attack(apdev[0], dev[0], 19)
@remote_compatible
def test_sae_reflection_attack_ffc(dev, apdev):
"""SAE reflection attack (FFC)"""
sae_reflection_attack(apdev[0], dev[0], 5)
@remote_compatible
def test_sae_anti_clogging_proto(dev, apdev):
"""SAE anti clogging protocol testing"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -692,6 +708,7 @@ def test_sae_anti_clogging_proto(dev, apdev):
if req['subtype'] == 11:
raise Exception("Unexpected Authentication frame seen")
@remote_compatible
def test_sae_no_random(dev, apdev):
"""SAE and no random numbers available"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -712,6 +729,7 @@ def test_sae_no_random(dev, apdev):
dev[0].request("REMOVE_NETWORK all")
dev[0].wait_disconnected()
@remote_compatible
def test_sae_pwe_failure(dev, apdev):
"""SAE and pwe failure"""
if "SAE" not in dev[0].get_capability("auth_alg"):
@ -752,6 +770,7 @@ def test_sae_pwe_failure(dev, apdev):
dev[0].request("REMOVE_NETWORK all")
dev[0].wait_disconnected()
@remote_compatible
def test_sae_bignum_failure(dev, apdev):
"""SAE and bignum failure"""
if "SAE" not in dev[0].get_capability("auth_alg"):

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -62,6 +63,7 @@ def check_scan_retry(dev, params, bssid):
return
raise Exception("Unexpectedly old BSS entry")
@remote_compatible
def test_scan(dev, apdev):
"""Control interface behavior on scan parameters"""
hostapd.add_ap(apdev[0], { "ssid": "test-scan" })
@ -86,6 +88,7 @@ def test_scan(dev, apdev):
logger.info("Active single-channel scan on AP's operating channel")
check_scan_retry(dev[0], "freq=2412 passive=0 use_id=1", bssid)
@remote_compatible
def test_scan_tsf(dev, apdev):
"""Scan and TSF updates from Beacon/Probe Response frames"""
hostapd.add_ap(apdev[0], { "ssid": "test-scan",
@ -110,6 +113,7 @@ def test_scan_tsf(dev, apdev):
if 0 in tsf:
raise Exception("0 TSF reported")
@remote_compatible
def test_scan_only(dev, apdev):
"""Control interface behavior on scan parameters with type=only"""
hostapd.add_ap(apdev[0], { "ssid": "test-scan" })
@ -134,6 +138,7 @@ def test_scan_only(dev, apdev):
logger.info("Active single-channel scan on AP's operating channel")
check_scan_retry(dev[0], "type=only freq=2412 passive=0 use_id=1", bssid)
@remote_compatible
def test_scan_external_trigger(dev, apdev):
"""Avoid operations during externally triggered scan"""
hostapd.add_ap(apdev[0], { "ssid": "test-scan" })
@ -160,6 +165,7 @@ def test_scan_bss_expiration_count(dev, apdev):
if bssid in dev[0].request("SCAN_RESULTS"):
raise Exception("BSS found after two scans without match")
@remote_compatible
def test_scan_bss_expiration_age(dev, apdev):
"""BSS entry expiration based on age"""
try:
@ -189,6 +195,7 @@ def test_scan_bss_expiration_age(dev, apdev):
finally:
dev[0].request("BSS_EXPIRE_AGE 180")
@remote_compatible
def test_scan_filter(dev, apdev):
"""Filter scan results based on SSID"""
try:
@ -211,6 +218,7 @@ def test_scan_filter(dev, apdev):
finally:
dev[0].request("SET filter_ssids 0")
@remote_compatible
def test_scan_int(dev, apdev):
"""scan interval configuration"""
try:
@ -325,6 +333,7 @@ def test_scan_bss_operations(dev, apdev):
if len(res) != 0:
raise Exception("Unexpected result after BSS_FLUSH 0")
@remote_compatible
def test_scan_and_interface_disabled(dev, apdev):
"""Scan operation when interface gets disabled"""
try:
@ -346,6 +355,7 @@ def test_scan_and_interface_disabled(dev, apdev):
finally:
dev[0].request("DRIVER_EVENT INTERFACE_ENABLED")
@remote_compatible
def test_scan_for_auth(dev, apdev):
"""cfg80211 workaround with scan-for-auth"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -375,6 +385,7 @@ def test_scan_for_auth(dev, apdev):
dev[0].wait_connected(timeout=15)
@remote_compatible
def test_scan_for_auth_fail(dev, apdev):
"""cfg80211 workaround with scan-for-auth failing"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
@ -411,6 +422,7 @@ def test_scan_for_auth_fail(dev, apdev):
raise Exception("Unexpected connection")
dev[0].request("DISCONNECT")
@remote_compatible
def test_scan_for_auth_wep(dev, apdev):
"""cfg80211 scan-for-auth workaround with WEP keys"""
dev[0].flush_scan_cache()
@ -443,6 +455,7 @@ def test_scan_for_auth_wep(dev, apdev):
dev[0].wait_connected(timeout=15)
@remote_compatible
def test_scan_hidden(dev, apdev):
"""Control interface behavior on scan parameters"""
hapd = hostapd.add_ap(apdev[0], { "ssid": "test-scan",
@ -572,6 +585,7 @@ def test_scan_and_bss_entry_removed(dev, apdev):
dev[0].flush_scan_cache()
wpas.flush_scan_cache()
@remote_compatible
def test_scan_reqs_with_non_scan_radio_work(dev, apdev):
"""SCAN commands while non-scan radio_work is in progress"""
id = dev[0].request("RADIO_WORK add test-work-a")
@ -678,6 +692,7 @@ def test_scan_setband(dev, apdev):
dev[i].request("SET setband AUTO")
dev[i].flush_scan_cache()
@remote_compatible
def test_scan_hidden_many(dev, apdev):
"""scan_ssid=1 with large number of profile with hidden SSID"""
try:
@ -775,6 +790,7 @@ def _test_scan_random_mac(dev, apdev, params):
if not found:
raise Exception("Fixed OUI random address not seen")
@remote_compatible
def test_scan_trigger_failure(dev, apdev):
"""Scan trigger to the driver failing"""
hostapd.add_ap(apdev[0], { "ssid": "test-scan" })
@ -818,6 +834,7 @@ def test_scan_trigger_failure(dev, apdev):
raise Exception("wpa_state COMPLETED not restored")
dev[0].request("SET test_failure 0")
@remote_compatible
def test_scan_specify_ssid(dev, apdev):
"""Control interface behavior on scan SSID parameter"""
dev[0].flush_scan_cache()
@ -846,6 +863,7 @@ def test_scan_specify_ssid(dev, apdev):
if "FAIL" not in dev[0].request("SCAN ssid foo"):
raise Exception("Invalid SCAN command accepted")
@remote_compatible
def test_scan_ap_scan_2_ap_mode(dev, apdev):
"""AP_SCAN 2 AP mode and scan()"""
try:
@ -966,6 +984,7 @@ def _test_scan_dfs(dev, apdev, params):
if f in [ 2467, 2472 ]:
raise Exception("Active scan on US-disallowed channel: %d" % f)
@remote_compatible
def test_scan_abort(dev, apdev):
"""Aborting a full scan"""
dev[0].request("SCAN")
@ -978,6 +997,7 @@ def test_scan_abort(dev, apdev):
if ev is None:
raise Exception("Scan did not terminate")
@remote_compatible
def test_scan_abort_on_connect(dev, apdev):
"""Aborting a full scan on connection request"""
hostapd.add_ap(apdev[0], { "ssid": "test-scan" })
@ -991,6 +1011,7 @@ def test_scan_abort_on_connect(dev, apdev):
raise Exception("Scan did not start")
dev[0].connect("test-scan", key_mgmt="NONE")
@remote_compatible
def test_scan_ext(dev, apdev):
"""Custom IE in Probe Request frame"""
hostapd.add_ap(apdev[0], { "ssid": "test-scan" })
@ -1093,6 +1114,7 @@ def test_scan_fail(dev, apdev):
with alloc_fail(dev[0], 1, "wpa_bss_add"):
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
@remote_compatible
def test_scan_freq_list(dev, apdev):
"""Scan with SET freq_list and scan_cur_freq"""
try:

View file

@ -5,11 +5,13 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import hostapd
@remote_compatible
def test_ssid_hex_encoded(dev, apdev):
"""SSID configuration using hex encoded version"""
hostapd.add_ap(apdev[0], { "ssid2": '68656c6c6f' })
@ -29,11 +31,13 @@ def test_ssid_printf_encoded(dev, apdev):
raise Exception("Unexpected difference in SSID")
dev[2].connect(ssid2='P"' + ssid + '"', key_mgmt="NONE", scan_freq="2412")
@remote_compatible
def test_ssid_1_octet(dev, apdev):
"""SSID with one octet"""
hostapd.add_ap(apdev[0], { "ssid": '1' })
dev[0].connect("1", key_mgmt="NONE", scan_freq="2412")
@remote_compatible
def test_ssid_32_octets(dev, apdev):
"""SSID with 32 octets"""
hostapd.add_ap(apdev[0],
@ -41,6 +45,7 @@ def test_ssid_32_octets(dev, apdev):
dev[0].connect("1234567890abcdef1234567890ABCDEF", key_mgmt="NONE",
scan_freq="2412")
@remote_compatible
def test_ssid_utf8(dev, apdev):
"""SSID with UTF8 encoding"""
hapd = hostapd.add_ap(apdev[0], { "ssid": 'testi-åäöÅÄÖ-testi',
@ -69,6 +74,7 @@ def clear_scan_cache(hapd, dev):
dev[0].flush_scan_cache()
dev[1].flush_scan_cache()
@remote_compatible
def test_ssid_hidden(dev, apdev):
"""Hidden SSID"""
hapd = hostapd.add_ap(apdev[0], { "ssid": 'secret',
@ -81,6 +87,7 @@ def test_ssid_hidden(dev, apdev):
raise Exception("Unexpected connection")
clear_scan_cache(hapd, dev)
@remote_compatible
def test_ssid_hidden2(dev, apdev):
"""Hidden SSID using zero octets as payload"""
hapd = hostapd.add_ap(apdev[0], { "ssid": 'secret2',
@ -93,6 +100,7 @@ def test_ssid_hidden2(dev, apdev):
raise Exception("Unexpected connection")
clear_scan_cache(hapd, dev)
@remote_compatible
def test_ssid_hidden_wpa2(dev, apdev):
"""Hidden SSID with WPA2-PSK"""
params = hostapd.wpa2_params(ssid="secret", passphrase="12345678")

View file

@ -4,9 +4,11 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import hostapd
import hwsim_utils
@remote_compatible
def test_wep_open_auth(dev, apdev):
"""WEP Open System authentication"""
hapd = hostapd.add_ap(apdev[0],
@ -25,6 +27,7 @@ def test_wep_open_auth(dev, apdev):
if "[WEP]" not in bss['flags']:
raise Exception("Unexpected BSS flags: " + bss['flags'])
@remote_compatible
def test_wep_shared_key_auth(dev, apdev):
"""WEP Shared Key authentication"""
hapd = hostapd.add_ap(apdev[0],
@ -39,6 +42,7 @@ def test_wep_shared_key_auth(dev, apdev):
wep_key0='"hello12345678"',
scan_freq="2412")
@remote_compatible
def test_wep_shared_key_auth_not_allowed(dev, apdev):
"""WEP Shared Key authentication not allowed"""
hostapd.add_ap(apdev[0],

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import struct
import time
@ -16,6 +17,7 @@ from wpasupplicant import WpaSupplicant
from utils import alloc_fail, wait_fail_trigger
from wlantest import Wlantest
@remote_compatible
def test_wnm_bss_transition_mgmt(dev, apdev):
"""WNM BSS Transition Management"""
params = { "ssid": "test-wnm",
@ -28,6 +30,7 @@ def test_wnm_bss_transition_mgmt(dev, apdev):
dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412")
dev[0].request("WNM_BSS_QUERY 0")
@remote_compatible
def test_wnm_disassoc_imminent(dev, apdev):
"""WNM Disassociation Imminent"""
params = { "ssid": "test-wnm",
@ -49,6 +52,7 @@ def test_wnm_disassoc_imminent(dev, apdev):
if ev is None:
raise Exception("Timeout while waiting for re-connection scan")
@remote_compatible
def test_wnm_ess_disassoc_imminent(dev, apdev):
"""WNM ESS Disassociation Imminent"""
params = { "ssid": "test-wnm",
@ -70,6 +74,7 @@ def test_wnm_ess_disassoc_imminent(dev, apdev):
if ev is None:
raise Exception("Timeout while waiting for re-connection scan")
@remote_compatible
def test_wnm_ess_disassoc_imminent_pmf(dev, apdev):
"""WNM ESS Disassociation Imminent"""
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
@ -127,6 +132,7 @@ def check_wnm_sleep_mode_enter_exit(hapd, dev, interval=None, tfs_req=None):
if not ok:
raise Exception("Station failed to exit WNM-Sleep Mode")
@remote_compatible
def test_wnm_sleep_mode_open(dev, apdev):
"""WNM Sleep Mode - open"""
params = { "ssid": "test-wnm",
@ -151,6 +157,7 @@ def test_wnm_sleep_mode_open(dev, apdev):
if "FAIL" not in dev[0].request("WNM_SLEEP " + cmd):
raise Exception("Invalid WNM_SLEEP accepted")
@remote_compatible
def test_wnm_sleep_mode_rsn(dev, apdev):
"""WNM Sleep Mode - RSN"""
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
@ -166,6 +173,7 @@ def test_wnm_sleep_mode_rsn(dev, apdev):
raise Exception("No connection event received from hostapd")
check_wnm_sleep_mode_enter_exit(hapd, dev[0])
@remote_compatible
def test_wnm_sleep_mode_ap_oom(dev, apdev):
"""WNM Sleep Mode - AP side OOM"""
params = { "ssid": "test-wnm",
@ -183,6 +191,7 @@ def test_wnm_sleep_mode_ap_oom(dev, apdev):
dev[0].request("WNM_SLEEP exit")
wait_fail_trigger(hapd, "GET_ALLOC_FAIL")
@remote_compatible
def test_wnm_sleep_mode_rsn_pmf(dev, apdev):
"""WNM Sleep Mode - RSN with PMF"""
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
@ -280,6 +289,7 @@ def expect_ack(hapd):
if "ok=1" not in ev:
raise Exception("Action frame not acknowledged")
@remote_compatible
def test_wnm_bss_tm_req(dev, apdev):
"""BSS Transition Management Request"""
params = { "ssid": "test-wnm", "bss_transition": "1" }
@ -427,6 +437,7 @@ def test_wnm_bss_tm_req(dev, apdev):
hapd.mgmt_tx(req)
resp = rx_bss_tm_resp(hapd, expect_dialog=8, expect_status=7)
@remote_compatible
def test_wnm_bss_keep_alive(dev, apdev):
"""WNM keep-alive"""
params = { "ssid": "test-wnm",
@ -1054,6 +1065,7 @@ def test_wnm_action_proto(dev, apdev):
hapd.mgmt_tx(msg)
expect_ack(hapd)
@remote_compatible
def test_wnm_action_proto_pmf(dev, apdev):
"""WNM Action protocol testing (PMF enabled)"""
ssid = "test-wnm-pmf"
@ -1158,6 +1170,7 @@ def test_wnm_action_proto_pmf(dev, apdev):
hapd.mgmt_tx(msg)
expect_ack(hapd)
@remote_compatible
def test_wnm_action_proto_no_pmf(dev, apdev):
"""WNM Action protocol testing (PMF disabled)"""
ssid = "test-wnm-no-pmf"
@ -1258,6 +1271,7 @@ def test_wnm_bss_tm_req_with_mbo_ie(dev, apdev):
if "OK" not in dev[0].request("SET mbo_cell_capa 3"):
raise Exception("Failed to set STA as cellular data not-capable")
@remote_compatible
def test_wnm_bss_transition_mgmt_query(dev, apdev):
"""WNM BSS Transition Management query"""
params = { "ssid": "test-wnm",
@ -1281,6 +1295,7 @@ def test_wnm_bss_transition_mgmt_query(dev, apdev):
if ev is None:
raise Exception("No BSS Transition Management Response frame seen")
@remote_compatible
def test_wnm_bss_tm_security_mismatch(dev, apdev):
"""WNM BSS Transition Management and security mismatch"""
params = { "ssid": "test-wnm",

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import logging
logger = logging.getLogger()
@ -77,6 +78,7 @@ def test_wpas_ap_open(dev):
dev[1].request("DISCONNECT")
dev[2].request("DISCONNECT")
@remote_compatible
def test_wpas_ap_wep(dev):
"""wpa_supplicant AP mode - WEP"""
id = dev[0].add_network()
@ -94,6 +96,7 @@ def test_wpas_ap_wep(dev):
hwsim_utils.test_connectivity(dev[0], dev[1])
dev[1].request("DISCONNECT")
@remote_compatible
def test_wpas_ap_no_ssid(dev):
"""wpa_supplicant AP mode - invalid network configuration"""
id = dev[0].add_network()
@ -106,6 +109,7 @@ def test_wpas_ap_no_ssid(dev):
if ev is not None:
raise Exception("Unexpected AP start")
@remote_compatible
def test_wpas_ap_default_frequency(dev):
"""wpa_supplicant AP mode - default frequency"""
id = dev[0].add_network()
@ -118,6 +122,7 @@ def test_wpas_ap_default_frequency(dev):
dev[1].connect("wpas-ap-open", key_mgmt="NONE", scan_freq="2462")
dev[1].request("DISCONNECT")
@remote_compatible
def test_wpas_ap_invalid_frequency(dev):
"""wpa_supplicant AP mode - invalid frequency configuration"""
id = dev[0].add_network()
@ -297,6 +302,7 @@ def test_wpas_ap_wps_pbc_overlap(dev):
dev[1].request("WPS_CANCEL")
dev[2].request("WPS_CANCEL")
@remote_compatible
def test_wpas_ap_wps_disabled(dev):
"""wpa_supplicant AP mode - WPS disabled"""
id = dev[0].add_network()
@ -352,6 +358,7 @@ def _test_wpas_ap_dfs(dev):
dev[1].connect("wpas-ap-dfs", key_mgmt="NONE")
@remote_compatible
def test_wpas_ap_disable(dev):
"""wpa_supplicant AP mode - DISABLE_NETWORK"""
id = dev[0].add_network()
@ -394,6 +401,7 @@ def test_wpas_ap_acs(dev):
dev[1].connect("wpas-ap-open", key_mgmt="NONE", scan_freq=freq)
@remote_compatible
def test_wpas_ap_and_assoc_req_p2p_ie(dev):
"""wpa_supplicant AP mode - unexpected P2P IE in Association Request"""
try:
@ -421,6 +429,7 @@ def _test_wpas_ap_and_assoc_req_p2p_ie(dev):
dev[0].request("DISCONNECT")
dev[0].wait_disconnected()
@remote_compatible
def test_wpas_ap_open_ht_disabled(dev):
"""wpa_supplicant AP mode - open network and HT disabled"""
id = dev[0].add_network()

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import os
@ -18,6 +19,7 @@ from wpasupplicant import WpaSupplicant
from utils import alloc_fail, fail_test
from test_wpas_ap import wait_ap_ready
@remote_compatible
def test_wpas_ctrl_network(dev):
"""wpa_supplicant ctrl_iface network set/get"""
id = dev[0].add_network()
@ -278,6 +280,7 @@ def test_wpas_ctrl_network(dev):
if "FAIL" not in dev[0].request("SET_NETWORK %d bssid_blacklist %s" % (id, val)):
raise Exception("Invalid bssid_blacklist value accepted")
@remote_compatible
def test_wpas_ctrl_network_oom(dev):
"""wpa_supplicant ctrl_iface network OOM in string parsing"""
id = dev[0].add_network()
@ -291,6 +294,7 @@ def test_wpas_ctrl_network_oom(dev):
if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' ssid ' + val):
raise Exception("Unexpected success for SET_NETWORK during OOM")
@remote_compatible
def test_wpas_ctrl_many_networks(dev, apdev):
"""wpa_supplicant ctrl_iface LIST_NETWORKS with huge number of networks"""
for i in range(1000):
@ -306,6 +310,7 @@ def test_wpas_ctrl_many_networks(dev, apdev):
# with the test case failing and following reset operation timing out.
dev[0].request("REMOVE_NETWORK all", timeout=60)
@remote_compatible
def test_wpas_ctrl_dup_network(dev, apdev):
"""wpa_supplicant ctrl_iface DUP_NETWORK"""
ssid = "target"
@ -339,6 +344,7 @@ def test_wpas_ctrl_dup_network(dev, apdev):
if "OK" not in dev[0].request("DUP_NETWORK %d %d ssid" % (id, id)):
raise Exception("Unexpected DUP_NETWORK failure")
@remote_compatible
def test_wpas_ctrl_dup_network_global(dev, apdev):
"""wpa_supplicant ctrl_iface DUP_NETWORK (global)"""
ssid = "target"
@ -407,6 +413,7 @@ def remove_cred(dev, id):
if " " + str(id) not in ev:
raise Exception("CRED-REMOVED event without matching id")
@remote_compatible
def test_wpas_ctrl_cred(dev):
"""wpa_supplicant ctrl_iface cred set"""
id1 = add_cred(dev[0])
@ -602,6 +609,7 @@ def test_wpas_ctrl_pno(dev):
if "FAIL" in dev[0].request("SET pno 0"):
raise Exception("Unexpected failure in disabling PNO")
@remote_compatible
def test_wpas_ctrl_get(dev):
"""wpa_supplicant ctrl_iface get"""
if "FAIL" in dev[0].request("GET version"):
@ -611,6 +619,7 @@ def test_wpas_ctrl_get(dev):
if "FAIL" not in dev[0].request("GET foo"):
raise Exception("Unexpected success on get command")
@remote_compatible
def test_wpas_ctrl_preauth(dev):
"""wpa_supplicant ctrl_iface preauth"""
if "FAIL" not in dev[0].request("PREAUTH "):
@ -618,6 +627,7 @@ def test_wpas_ctrl_preauth(dev):
if "FAIL" in dev[0].request("PREAUTH 00:11:22:33:44:55"):
raise Exception("Unexpected failure on PREAUTH")
@remote_compatible
def test_wpas_ctrl_stkstart(dev):
"""wpa_supplicant ctrl_iface strkstart"""
if "FAIL" not in dev[0].request("STKSTART "):
@ -625,6 +635,7 @@ def test_wpas_ctrl_stkstart(dev):
if "FAIL" not in dev[0].request("STKSTART 00:11:22:33:44:55"):
raise Exception("Unexpected success on STKSTART")
@remote_compatible
def test_wpas_ctrl_tdls_discover(dev):
"""wpa_supplicant ctrl_iface tdls_discover"""
if "FAIL" not in dev[0].request("TDLS_DISCOVER "):
@ -632,6 +643,7 @@ def test_wpas_ctrl_tdls_discover(dev):
if "FAIL" not in dev[0].request("TDLS_DISCOVER 00:11:22:33:44:55"):
raise Exception("Unexpected success on TDLS_DISCOVER")
@remote_compatible
def test_wpas_ctrl_tdls_chan_switch(dev):
"""wpa_supplicant ctrl_iface tdls_chan_switch error cases"""
for args in [ '', '00:11:22:33:44:55' ]:
@ -644,6 +656,7 @@ def test_wpas_ctrl_tdls_chan_switch(dev):
if "FAIL" not in dev[0].request("TDLS_CHAN_SWITCH " + args):
raise Exception("Unexpected success on invalid TDLS_CHAN_SWITCH: " + args)
@remote_compatible
def test_wpas_ctrl_addr(dev):
"""wpa_supplicant ctrl_iface invalid address"""
if "FAIL" not in dev[0].request("TDLS_SETUP "):
@ -665,6 +678,7 @@ def test_wpas_ctrl_addr(dev):
if "FAIL" not in dev[0].request("BLACKLIST 00:11:22:33:44"):
raise Exception("Unexpected success on invalid BLACKLIST")
@remote_compatible
def test_wpas_ctrl_wps_errors(dev):
"""wpa_supplicant ctrl_iface WPS error cases"""
if "FAIL" not in dev[0].request("WPS_REG 00:11:22:33:44:55"):
@ -713,6 +727,7 @@ def test_wpas_ctrl_wps_errors(dev):
if "FAIL" not in dev[0].request("WPS_NFC_TOKEN FOO"):
raise Exception("Unexpected success on invalid WPS_NFC_TOKEN")
@remote_compatible
def test_wpas_ctrl_config_parser(dev):
"""wpa_supplicant ctrl_iface SET config parser"""
if "FAIL" not in dev[0].request("SET pbc_in_m1 qwerty"):
@ -725,6 +740,7 @@ def test_wpas_ctrl_config_parser(dev):
if "FAIL" not in dev[0].request("SET serial_number 0123456789abcdef0123456789abcdef0"):
raise Exception("Too long string accepted")
@remote_compatible
def test_wpas_ctrl_mib(dev):
"""wpa_supplicant ctrl_iface MIB"""
mib = dev[0].get_mib()
@ -814,6 +830,7 @@ def test_wpas_ctrl_bssid_filter(dev, apdev):
finally:
dev[2].request("SET bssid_filter ")
@remote_compatible
def test_wpas_ctrl_disallow_aps(dev, apdev):
"""wpa_supplicant ctrl_iface disallow_aps"""
params = { "ssid": "test" }
@ -859,6 +876,7 @@ def test_wpas_ctrl_disallow_aps(dev, apdev):
if "OK" not in dev[0].request("SET disallow_aps "):
raise Exception("Failed to set disallow_aps")
@remote_compatible
def test_wpas_ctrl_blob(dev):
"""wpa_supplicant ctrl_iface SET blob"""
if "FAIL" not in dev[0].request("SET blob foo"):
@ -872,6 +890,7 @@ def test_wpas_ctrl_blob(dev):
if "OK" not in dev[0].request("SET blob foo 0011"):
raise Exception("Unexpected SET failure")
@remote_compatible
def test_wpas_ctrl_set_uapsd(dev):
"""wpa_supplicant ctrl_iface SET uapsd"""
if "FAIL" not in dev[0].request("SET uapsd foo"):
@ -926,6 +945,7 @@ def test_wpas_ctrl_set(dev):
# methods is included, so don't check the return value for now.
dev[0].request("SET load_dynamic_eap /tmp/hwsim-eap-not-found.so")
@remote_compatible
def test_wpas_ctrl_get_capability(dev):
"""wpa_supplicant ctrl_iface GET_CAPABILITY"""
if "FAIL" not in dev[0].request("GET_CAPABILITY 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"):
@ -981,6 +1001,7 @@ def test_wpas_ctrl_get_capability(dev):
if dev[0].get_capability("foo") is not None:
raise Exception("Unexpected GET_CAPABILITY foo response: " + str(res))
@remote_compatible
def test_wpas_ctrl_nfc_report_handover(dev):
"""wpa_supplicant ctrl_iface NFC_REPORT_HANDOVER"""
vals = [ "FOO",
@ -996,6 +1017,7 @@ def test_wpas_ctrl_nfc_report_handover(dev):
if "FAIL" not in dev[0].request("NFC_REPORT_HANDOVER " + v):
raise Exception("Unexpected NFC_REPORT_HANDOVER success for " + v)
@remote_compatible
def test_wpas_ctrl_nfc_tag_read(dev):
"""wpa_supplicant ctrl_iface WPS_NFC_TAG_READ"""
vals = [ "FOO", "0Q", "00", "000000", "10000001", "10000000", "00000000",
@ -1004,6 +1026,7 @@ def test_wpas_ctrl_nfc_tag_read(dev):
if "FAIL" not in dev[0].request("WPS_NFC_TAG_READ " + v):
raise Exception("Unexpected WPS_NFC_TAG_READ success for " + v)
@remote_compatible
def test_wpas_ctrl_nfc_get_handover(dev):
"""wpa_supplicant ctrl_iface NFC_GET_HANDOVER"""
vals = [ "FOO", "FOO BAR", "WPS WPS", "WPS WPS-CR", "WPS FOO", "NDEF P2P" ]
@ -1031,6 +1054,7 @@ def test_wpas_ctrl_nfc_get_handover(dev):
def get_blacklist(dev):
return dev.request("BLACKLIST").splitlines()
@remote_compatible
def test_wpas_ctrl_blacklist(dev):
"""wpa_supplicant ctrl_iface BLACKLIST"""
if "OK" not in dev[0].request("BLACKLIST clear"):
@ -1059,6 +1083,7 @@ def test_wpas_ctrl_blacklist(dev):
if dev[0].request("BLACKLIST") != "":
raise Exception("Unexpected blacklist contents")
@remote_compatible
def test_wpas_ctrl_blacklist_oom(dev):
"""wpa_supplicant ctrl_iface BLACKLIST and out-of-memory"""
with alloc_fail(dev[0], 1, "wpa_blacklist_add"):
@ -1107,6 +1132,7 @@ def test_wpas_ctrl_log_level(dev):
if "Timestamp: 1" not in level:
raise Exception("Unexpected timestamp(3): " + level)
@remote_compatible
def test_wpas_ctrl_enable_disable_network(dev, apdev):
"""wpa_supplicant ctrl_iface ENABLE/DISABLE_NETWORK"""
params = { "ssid": "test" }
@ -1244,6 +1270,7 @@ def test_wpas_ctrl_global(dev):
if "FAIL" not in wpas.global_request("INTERFACE_ADD FOO conf driver ctrliface driverparam bridge create abcd"):
raise Exception("INTERFACE_ADD succeeded unexpectedly")
@remote_compatible
def test_wpas_ctrl_roam(dev, apdev):
"""wpa_supplicant ctrl_iface ROAM error cases"""
if "FAIL" not in dev[0].request("ROAM 00:11:22:33:44"):
@ -1256,6 +1283,7 @@ def test_wpas_ctrl_roam(dev, apdev):
if "FAIL" not in dev[0].request("ROAM 00:11:22:33:44:55"):
raise Exception("Unexpected success")
@remote_compatible
def test_wpas_ctrl_ipaddr(dev, apdev):
"""wpa_supplicant IP address in STATUS"""
try:
@ -1268,6 +1296,7 @@ def test_wpas_ctrl_ipaddr(dev, apdev):
dev[0].cmd_execute(['ip', 'addr', 'del', '10.174.65.207/32', 'dev',
dev[0].ifname])
@remote_compatible
def test_wpas_ctrl_rsp(dev, apdev):
"""wpa_supplicant ctrl_iface CTRL-RSP-"""
if "FAIL" not in dev[0].request("CTRL-RSP-"):
@ -1288,6 +1317,7 @@ def test_wpas_ctrl_rsp(dev, apdev):
if "OK" not in dev[0].request("CTRL-RSP-%s-%d:" % (req, id)):
raise Exception("Request failed unexpectedly")
@remote_compatible
def test_wpas_ctrl_vendor(dev, apdev):
"""wpa_supplicant ctrl_iface VENDOR"""
cmds = [ "foo",
@ -1299,6 +1329,7 @@ def test_wpas_ctrl_vendor(dev, apdev):
if "FAIL" not in dev[0].request("VENDOR " + cmd):
raise Exception("Invalid VENDOR command accepted: " + cmd)
@remote_compatible
def test_wpas_ctrl_mgmt_tx(dev, apdev):
"""wpa_supplicant ctrl_iface MGMT_TX"""
cmds = [ "foo",
@ -1313,11 +1344,13 @@ def test_wpas_ctrl_mgmt_tx(dev, apdev):
if "OK" not in dev[0].request("MGMT_TX_DONE"):
raise Exception("MGMT_TX_DONE failed")
@remote_compatible
def test_wpas_ctrl_driver_event(dev, apdev):
"""wpa_supplicant ctrl_iface DRIVER_EVENT"""
if "FAIL" not in dev[0].request("DRIVER_EVENT foo"):
raise Exception("Invalid DRIVER_EVENT accepted")
@remote_compatible
def test_wpas_ctrl_eapol_rx(dev, apdev):
"""wpa_supplicant ctrl_iface EAPOL_RX"""
cmds = [ "foo",
@ -1327,6 +1360,7 @@ def test_wpas_ctrl_eapol_rx(dev, apdev):
if "FAIL" not in dev[0].request("EAPOL_RX " + cmd):
raise Exception("Invalid EAPOL_RX command accepted: " + cmd)
@remote_compatible
def test_wpas_ctrl_data_test(dev, apdev):
"""wpa_supplicant ctrl_iface DATA_TEST"""
dev[0].request("DATA_TEST_CONFIG 0")
@ -1361,6 +1395,7 @@ def test_wpas_ctrl_data_test(dev, apdev):
if "OK" not in dev[0].request("DATA_TEST_FRAME 00112233445566778899aabbccddee"):
raise Exception("DATA_TEST_FRAME failed")
@remote_compatible
def test_wpas_ctrl_vendor_elem(dev, apdev):
"""wpa_supplicant ctrl_iface VENDOR_ELEM"""
if "OK" not in dev[0].request("VENDOR_ELEM_ADD 1 "):
@ -1429,6 +1464,7 @@ def test_wpas_ctrl_misc(dev, apdev):
if "FAIL" not in dev[0].global_request("SET foo"):
raise Exception("Invalid global SET accepted")
@remote_compatible
def test_wpas_ctrl_dump(dev, apdev):
"""wpa_supplicant ctrl_iface and DUMP/GET global parameters"""
vals = dev[0].get_config()
@ -1598,6 +1634,7 @@ def test_wpas_ctrl_wait(dev, apdev, test_params):
if os.path.exists(pidfile):
raise Exception("PID file not removed")
@remote_compatible
def test_wpas_ctrl_oom(dev):
"""Various wpa_supplicant ctrl_iface OOM cases"""
try:
@ -1745,6 +1782,7 @@ def _test_wpas_ctrl_oom(dev):
if exp and exp not in res:
raise Exception("Unexpected success for '%s' during OOM" % cmd)
@remote_compatible
def test_wpas_ctrl_error(dev):
"""Various wpa_supplicant ctrl_iface error cases"""
tests = [ ('WPS_NFC_TOKEN NDEF', 'FAIL',
@ -1870,6 +1908,7 @@ def test_wpas_ctrl_event_burst(dev, apdev):
if not dev[0].ping():
raise Exception("Could not ping wpa_supplicant at the end of the test")
@remote_compatible
def test_wpas_ctrl_sched_scan_plans(dev, apdev):
"""wpa_supplicant sched_scan_plans parsing"""
dev[0].request("SET sched_scan_plans foo")

View file

@ -4,6 +4,7 @@
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import logging
logger = logging.getLogger()
import struct
@ -209,6 +210,7 @@ def test_tspec_protocol(dev, apdev):
hapd.set("ext_mgmt_frame_handling", "0")
@remote_compatible
def test_tspec_not_enabled(dev, apdev):
"""addts failing if AP does not support WMM"""
params = { "ssid": "wmm_no_ac",
@ -246,6 +248,7 @@ def test_tspec_not_enabled(dev, apdev):
msg['payload'] = struct.pack('BBBB', 17, 2, 0, 0)
hapd.mgmt_tx(msg)
@remote_compatible
def test_tspec_ap_roam_open(dev, apdev):
"""Roam between two open APs while having tspecs"""
hapd0 = add_wmm_ap(apdev[0], ["VO", "VI"])
@ -264,6 +267,7 @@ def test_tspec_ap_roam_open(dev, apdev):
dev[0].roam(apdev[0]['bssid'])
hwsim_utils.test_connectivity(dev[0], hapd0)
@remote_compatible
def test_tspec_reassoc(dev, apdev):
"""Reassociation to same BSS while having tspecs"""
hapd0 = add_wmm_ap(apdev[0], ["VO", "VI"])