tests: Remove extra semicolons from python scripts
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
208ebb9d1a
commit
bc6e32880f
29 changed files with 124 additions and 124 deletions
|
@ -346,7 +346,7 @@ def parse_nl80211_attrs(msg):
|
||||||
alen,attr = struct.unpack("@HH", msg[0:4])
|
alen,attr = struct.unpack("@HH", msg[0:4])
|
||||||
if alen < 4:
|
if alen < 4:
|
||||||
raise Exception("Too short nl80211 attribute")
|
raise Exception("Too short nl80211 attribute")
|
||||||
alen -= 4;
|
alen -= 4
|
||||||
msg = msg[4:]
|
msg = msg[4:]
|
||||||
if alen > len(msg):
|
if alen > len(msg):
|
||||||
raise Exception("nl80211 attribute underflow")
|
raise Exception("nl80211 attribute underflow")
|
||||||
|
|
|
@ -121,7 +121,7 @@ def invite(inv, resp, extra=None, persistent_reconnect=True, use_listen=True):
|
||||||
peer = inv.get_peer(addr)
|
peer = inv.get_peer(addr)
|
||||||
cmd = "P2P_INVITE persistent=" + peer['persistent'] + " peer=" + addr
|
cmd = "P2P_INVITE persistent=" + peer['persistent'] + " peer=" + addr
|
||||||
if extra:
|
if extra:
|
||||||
cmd = cmd + " " + extra;
|
cmd = cmd + " " + extra
|
||||||
inv.global_request(cmd)
|
inv.global_request(cmd)
|
||||||
|
|
||||||
def check_result(go, cli):
|
def check_result(go, cli):
|
||||||
|
|
|
@ -18,7 +18,7 @@ def execute_thread(command, reply):
|
||||||
cmd = ' '.join(command)
|
cmd = ' '.join(command)
|
||||||
logger.debug("thread run: " + cmd)
|
logger.debug("thread run: " + cmd)
|
||||||
try:
|
try:
|
||||||
status = 0;
|
status = 0
|
||||||
buf = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
buf = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
status = e.returncode
|
status = e.returncode
|
||||||
|
@ -47,7 +47,7 @@ class Host():
|
||||||
def local_execute(self, command):
|
def local_execute(self, command):
|
||||||
logger.debug("execute: " + str(command))
|
logger.debug("execute: " + str(command))
|
||||||
try:
|
try:
|
||||||
status = 0;
|
status = 0
|
||||||
buf = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
buf = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
status = e.returncode
|
status = e.returncode
|
||||||
|
|
|
@ -196,10 +196,10 @@ def test_ap_ft_pmf(dev, apdev):
|
||||||
passphrase="12345678"
|
passphrase="12345678"
|
||||||
|
|
||||||
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd0 = hostapd.add_ap(apdev[0], params)
|
hapd0 = hostapd.add_ap(apdev[0], params)
|
||||||
params = ft_params2(ssid=ssid, passphrase=passphrase)
|
params = ft_params2(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd1 = hostapd.add_ap(apdev[1], params)
|
hapd1 = hostapd.add_ap(apdev[1], params)
|
||||||
|
|
||||||
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase)
|
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase)
|
||||||
|
@ -351,10 +351,10 @@ def test_ap_ft_pmf_over_ds(dev, apdev):
|
||||||
passphrase="12345678"
|
passphrase="12345678"
|
||||||
|
|
||||||
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd0 = hostapd.add_ap(apdev[0], params)
|
hapd0 = hostapd.add_ap(apdev[0], params)
|
||||||
params = ft_params2(ssid=ssid, passphrase=passphrase)
|
params = ft_params2(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd1 = hostapd.add_ap(apdev[1], params)
|
hapd1 = hostapd.add_ap(apdev[1], params)
|
||||||
|
|
||||||
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True)
|
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True)
|
||||||
|
@ -483,10 +483,10 @@ def test_ap_ft_mismatching_rrb_key_push(dev, apdev):
|
||||||
passphrase="12345678"
|
passphrase="12345678"
|
||||||
|
|
||||||
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd0 = hostapd.add_ap(apdev[0], params)
|
hapd0 = hostapd.add_ap(apdev[0], params)
|
||||||
params = ft_params2_incorrect_rrb_key(ssid=ssid, passphrase=passphrase)
|
params = ft_params2_incorrect_rrb_key(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd1 = hostapd.add_ap(apdev[1], params)
|
hapd1 = hostapd.add_ap(apdev[1], params)
|
||||||
|
|
||||||
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
|
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
|
||||||
|
@ -535,10 +535,10 @@ def test_ap_ft_mismatching_rrb_r0kh_push(dev, apdev):
|
||||||
passphrase="12345678"
|
passphrase="12345678"
|
||||||
|
|
||||||
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd0 = hostapd.add_ap(apdev[0], params)
|
hapd0 = hostapd.add_ap(apdev[0], params)
|
||||||
params = ft_params2_r0kh_mismatch(ssid=ssid, passphrase=passphrase)
|
params = ft_params2_r0kh_mismatch(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd1 = hostapd.add_ap(apdev[1], params)
|
hapd1 = hostapd.add_ap(apdev[1], params)
|
||||||
|
|
||||||
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
|
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
|
||||||
|
@ -953,7 +953,7 @@ def test_rsn_ie_proto_ft_psk_sta(dev, apdev):
|
||||||
passphrase="12345678"
|
passphrase="12345678"
|
||||||
|
|
||||||
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "1";
|
params["ieee80211w"] = "1"
|
||||||
# This is the RSN element used normally by hostapd
|
# This is the RSN element used normally by hostapd
|
||||||
params['own_ie_override'] = '30140100000fac040100000fac040100000fac048c00' + '3603a1b201'
|
params['own_ie_override'] = '30140100000fac040100000fac040100000fac048c00' + '3603a1b201'
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
|
@ -72,7 +72,7 @@ def interworking_select(dev, bssid, type=None, no_match=False, freq=None):
|
||||||
ev = dev.wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH"],
|
ev = dev.wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH"],
|
||||||
timeout=15)
|
timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Network selection timed out");
|
raise Exception("Network selection timed out")
|
||||||
if no_match:
|
if no_match:
|
||||||
if "INTERWORKING-NO-MATCH" not in ev:
|
if "INTERWORKING-NO-MATCH" not in ev:
|
||||||
raise Exception("Unexpected network match")
|
raise Exception("Unexpected network match")
|
||||||
|
@ -84,7 +84,7 @@ def interworking_select(dev, bssid, type=None, no_match=False, freq=None):
|
||||||
ev = dev.wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH"],
|
ev = dev.wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH"],
|
||||||
timeout=15)
|
timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Network selection timed out");
|
raise Exception("Network selection timed out")
|
||||||
if "INTERWORKING-NO-MATCH" in ev:
|
if "INTERWORKING-NO-MATCH" in ev:
|
||||||
raise Exception("Matching network not found")
|
raise Exception("Matching network not found")
|
||||||
if bssid and bssid not in ev:
|
if bssid and bssid not in ev:
|
||||||
|
@ -420,7 +420,7 @@ def test_ap_hs20_select(dev, apdev):
|
||||||
'domain': "no.match.example.com" })
|
'domain': "no.match.example.com" })
|
||||||
interworking_select(dev[0], bssid, "roaming", freq="2412")
|
interworking_select(dev[0], bssid, "roaming", freq="2412")
|
||||||
|
|
||||||
dev[0].set_cred_quoted(id, "realm", "no.match.example.com");
|
dev[0].set_cred_quoted(id, "realm", "no.match.example.com")
|
||||||
interworking_select(dev[0], bssid, no_match=True, freq="2412")
|
interworking_select(dev[0], bssid, no_match=True, freq="2412")
|
||||||
|
|
||||||
res = dev[0].request("SCAN_RESULTS")
|
res = dev[0].request("SCAN_RESULTS")
|
||||||
|
@ -1639,7 +1639,7 @@ def check_conn_capab_selection(dev, type, missing):
|
||||||
dev.request("INTERWORKING_SELECT freq=2412")
|
dev.request("INTERWORKING_SELECT freq=2412")
|
||||||
ev = dev.wait_event(["INTERWORKING-AP"])
|
ev = dev.wait_event(["INTERWORKING-AP"])
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Network selection timed out");
|
raise Exception("Network selection timed out")
|
||||||
if "type=" + type not in ev:
|
if "type=" + type not in ev:
|
||||||
raise Exception("Unexpected network type")
|
raise Exception("Unexpected network type")
|
||||||
if missing and "conn_capab_missing=1" not in ev:
|
if missing and "conn_capab_missing=1" not in ev:
|
||||||
|
@ -1702,7 +1702,7 @@ def test_ap_hs20_req_conn_capab(dev, apdev):
|
||||||
for i in range(0, 2):
|
for i in range(0, 2):
|
||||||
ev = dev[0].wait_event(["INTERWORKING-AP"])
|
ev = dev[0].wait_event(["INTERWORKING-AP"])
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Network selection timed out");
|
raise Exception("Network selection timed out")
|
||||||
if bssid in ev and "conn_capab_missing=1" not in ev:
|
if bssid in ev and "conn_capab_missing=1" not in ev:
|
||||||
raise Exception("Missing protocol connection capability not reported")
|
raise Exception("Missing protocol connection capability not reported")
|
||||||
if bssid2 in ev and "conn_capab_missing=1" in ev:
|
if bssid2 in ev and "conn_capab_missing=1" in ev:
|
||||||
|
@ -1739,7 +1739,7 @@ def check_bandwidth_selection(dev, type, below):
|
||||||
dev.request("INTERWORKING_SELECT freq=2412")
|
dev.request("INTERWORKING_SELECT freq=2412")
|
||||||
ev = dev.wait_event(["INTERWORKING-AP"])
|
ev = dev.wait_event(["INTERWORKING-AP"])
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Network selection timed out");
|
raise Exception("Network selection timed out")
|
||||||
logger.debug("BSS entries:\n" + dev.request("BSS RANGE=ALL"))
|
logger.debug("BSS entries:\n" + dev.request("BSS RANGE=ALL"))
|
||||||
if "type=" + type not in ev:
|
if "type=" + type not in ev:
|
||||||
raise Exception("Unexpected network type")
|
raise Exception("Unexpected network type")
|
||||||
|
@ -2654,7 +2654,7 @@ def test_ap_hs20_fetch_osu_stop(dev, apdev):
|
||||||
ev = dev[0].wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH"],
|
ev = dev[0].wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH"],
|
||||||
timeout=15)
|
timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Network selection timed out");
|
raise Exception("Network selection timed out")
|
||||||
|
|
||||||
dev[0].dump_monitor()
|
dev[0].dump_monitor()
|
||||||
if "OK" not in dev[0].request("FETCH_OSU"):
|
if "OK" not in dev[0].request("FETCH_OSU"):
|
||||||
|
|
|
@ -19,8 +19,8 @@ def test_ap_pmf_required(dev, apdev):
|
||||||
"""WPA2-PSK AP with PMF required"""
|
"""WPA2-PSK AP with PMF required"""
|
||||||
ssid = "test-pmf-required"
|
ssid = "test-pmf-required"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
|
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
Wlantest.setup(hapd)
|
Wlantest.setup(hapd)
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
|
@ -57,8 +57,8 @@ def test_ap_pmf_optional(dev, apdev):
|
||||||
"""WPA2-PSK AP with PMF optional"""
|
"""WPA2-PSK AP with PMF optional"""
|
||||||
ssid = "test-pmf-optional"
|
ssid = "test-pmf-optional"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK";
|
params["wpa_key_mgmt"] = "WPA-PSK"
|
||||||
params["ieee80211w"] = "1";
|
params["ieee80211w"] = "1"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
Wlantest.setup(hapd)
|
Wlantest.setup(hapd)
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
|
@ -81,8 +81,8 @@ def test_ap_pmf_optional_2akm(dev, apdev):
|
||||||
"""WPA2-PSK AP with PMF optional (2 AKMs)"""
|
"""WPA2-PSK AP with PMF optional (2 AKMs)"""
|
||||||
ssid = "test-pmf-optional-2akm"
|
ssid = "test-pmf-optional-2akm"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK WPA-PSK-SHA256";
|
params["wpa_key_mgmt"] = "WPA-PSK WPA-PSK-SHA256"
|
||||||
params["ieee80211w"] = "1";
|
params["ieee80211w"] = "1"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
Wlantest.setup(hapd)
|
Wlantest.setup(hapd)
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
|
@ -133,8 +133,8 @@ def test_ap_pmf_assoc_comeback(dev, apdev):
|
||||||
"""WPA2-PSK AP with PMF association comeback"""
|
"""WPA2-PSK AP with PMF association comeback"""
|
||||||
ssid = "assoc-comeback"
|
ssid = "assoc-comeback"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
|
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
Wlantest.setup(hapd)
|
Wlantest.setup(hapd)
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
|
@ -158,8 +158,8 @@ def test_ap_pmf_assoc_comeback2(dev, apdev):
|
||||||
"""WPA2-PSK AP with PMF association comeback (using DROP_SA)"""
|
"""WPA2-PSK AP with PMF association comeback (using DROP_SA)"""
|
||||||
ssid = "assoc-comeback"
|
ssid = "assoc-comeback"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK";
|
params["wpa_key_mgmt"] = "WPA-PSK"
|
||||||
params["ieee80211w"] = "1";
|
params["ieee80211w"] = "1"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
Wlantest.setup(hapd)
|
Wlantest.setup(hapd)
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
|
@ -330,8 +330,8 @@ def test_ap_pmf_required_eap(dev, apdev):
|
||||||
"""WPA2-EAP AP with PMF required"""
|
"""WPA2-EAP AP with PMF required"""
|
||||||
ssid = "test-pmf-required-eap"
|
ssid = "test-pmf-required-eap"
|
||||||
params = hostapd.wpa2_eap_params(ssid=ssid)
|
params = hostapd.wpa2_eap_params(ssid=ssid)
|
||||||
params["wpa_key_mgmt"] = "WPA-EAP-SHA256";
|
params["wpa_key_mgmt"] = "WPA-EAP-SHA256"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
key_mgmt = hapd.get_config()['key_mgmt']
|
key_mgmt = hapd.get_config()['key_mgmt']
|
||||||
if key_mgmt.split(' ')[0] != "WPA-EAP-SHA256":
|
if key_mgmt.split(' ')[0] != "WPA-EAP-SHA256":
|
||||||
|
@ -348,7 +348,7 @@ def test_ap_pmf_required_eap(dev, apdev):
|
||||||
def test_ap_pmf_optional_eap(dev, apdev):
|
def test_ap_pmf_optional_eap(dev, apdev):
|
||||||
"""WPA2EAP AP with PMF optional"""
|
"""WPA2EAP AP with PMF optional"""
|
||||||
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
||||||
params["ieee80211w"] = "1";
|
params["ieee80211w"] = "1"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
|
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
|
||||||
identity="pap user", anonymous_identity="ttls",
|
identity="pap user", anonymous_identity="ttls",
|
||||||
|
@ -366,8 +366,8 @@ def test_ap_pmf_required_sha1(dev, apdev):
|
||||||
"""WPA2-PSK AP with PMF required with SHA1 AKM"""
|
"""WPA2-PSK AP with PMF required with SHA1 AKM"""
|
||||||
ssid = "test-pmf-required-sha1"
|
ssid = "test-pmf-required-sha1"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK";
|
params["wpa_key_mgmt"] = "WPA-PSK"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
Wlantest.setup(hapd)
|
Wlantest.setup(hapd)
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
|
@ -393,8 +393,8 @@ def test_ap_pmf_toggle(dev, apdev):
|
||||||
def _test_ap_pmf_toggle(dev, apdev):
|
def _test_ap_pmf_toggle(dev, apdev):
|
||||||
ssid = "test-pmf-optional"
|
ssid = "test-pmf-optional"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK";
|
params["wpa_key_mgmt"] = "WPA-PSK"
|
||||||
params["ieee80211w"] = "1";
|
params["ieee80211w"] = "1"
|
||||||
params["assoc_sa_query_max_timeout"] = "1"
|
params["assoc_sa_query_max_timeout"] = "1"
|
||||||
params["assoc_sa_query_retry_timeout"] = "1"
|
params["assoc_sa_query_retry_timeout"] = "1"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
@ -443,8 +443,8 @@ def test_ap_pmf_required_sta_no_pmf(dev, apdev):
|
||||||
"""WPA2-PSK AP with PMF required and PMF disabled on STA"""
|
"""WPA2-PSK AP with PMF required and PMF disabled on STA"""
|
||||||
ssid = "test-pmf-required"
|
ssid = "test-pmf-required"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
|
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
# Disable PMF on the station and try to connect
|
# Disable PMF on the station and try to connect
|
||||||
|
|
|
@ -1755,7 +1755,7 @@ def get_key_locations(buf, key, keyname):
|
||||||
if pos < 0:
|
if pos < 0:
|
||||||
break
|
break
|
||||||
logger.info("Found %s at %d" % (keyname, pos))
|
logger.info("Found %s at %d" % (keyname, pos))
|
||||||
context = 128;
|
context = 128
|
||||||
start = pos - context if pos > context else 0
|
start = pos - context if pos > context else 0
|
||||||
before = binascii.hexlify(buf[start:pos])
|
before = binascii.hexlify(buf[start:pos])
|
||||||
context += len(key)
|
context += len(key)
|
||||||
|
|
|
@ -88,7 +88,7 @@ def test_ap_roam_wpa2_psk_failed(dev, apdev, params):
|
||||||
|
|
||||||
ev = dev[0].wait_event(["CTRL-EVENT-SSID-REENABLED"], 3)
|
ev = dev[0].wait_event(["CTRL-EVENT-SSID-REENABLED"], 3)
|
||||||
if not ev:
|
if not ev:
|
||||||
raise Exception("CTRL-EVENT-SSID-REENABLED not seen");
|
raise Exception("CTRL-EVENT-SSID-REENABLED not seen")
|
||||||
|
|
||||||
dev[0].wait_connected(timeout=5)
|
dev[0].wait_connected(timeout=5)
|
||||||
hwsim_utils.test_connectivity(dev[0], hapd0)
|
hwsim_utils.test_connectivity(dev[0], hapd0)
|
||||||
|
|
|
@ -88,7 +88,7 @@ def tdls_check_dl(sta0, sta1, bssid, addr0, addr1):
|
||||||
|
|
||||||
def tdls_check_ap(sta0, sta1, bssid, addr0, addr1):
|
def tdls_check_ap(sta0, sta1, bssid, addr0, addr1):
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
wt.tdls_clear(bssid, addr0, addr1);
|
wt.tdls_clear(bssid, addr0, addr1)
|
||||||
hwsim_utils.test_connectivity_sta(sta0, sta1)
|
hwsim_utils.test_connectivity_sta(sta0, sta1)
|
||||||
[dl,inv_dl,ap,inv_ap] = wlantest_tdls_packet_counters(bssid, addr0, addr1)
|
[dl,inv_dl,ap,inv_ap] = wlantest_tdls_packet_counters(bssid, addr0, addr1)
|
||||||
if dl > 0:
|
if dl > 0:
|
||||||
|
@ -112,8 +112,8 @@ def setup_tdls(sta0, sta1, hapd, reverse=False, expect_fail=False):
|
||||||
addr0 = sta0.p2p_interface_addr()
|
addr0 = sta0.p2p_interface_addr()
|
||||||
addr1 = sta1.p2p_interface_addr()
|
addr1 = sta1.p2p_interface_addr()
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
wt.tdls_clear(bssid, addr0, addr1);
|
wt.tdls_clear(bssid, addr0, addr1)
|
||||||
wt.tdls_clear(bssid, addr1, addr0);
|
wt.tdls_clear(bssid, addr1, addr0)
|
||||||
sta0.tdls_setup(addr1)
|
sta0.tdls_setup(addr1)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
if expect_fail:
|
if expect_fail:
|
||||||
|
@ -122,7 +122,7 @@ def setup_tdls(sta0, sta1, hapd, reverse=False, expect_fail=False):
|
||||||
if reverse:
|
if reverse:
|
||||||
addr1 = sta0.p2p_interface_addr()
|
addr1 = sta0.p2p_interface_addr()
|
||||||
addr0 = sta1.p2p_interface_addr()
|
addr0 = sta1.p2p_interface_addr()
|
||||||
conf = wt.get_tdls_counter("setup_conf_ok", bssid, addr0, addr1);
|
conf = wt.get_tdls_counter("setup_conf_ok", bssid, addr0, addr1)
|
||||||
if conf == 0:
|
if conf == 0:
|
||||||
raise Exception("No TDLS Setup Confirm (success) seen")
|
raise Exception("No TDLS Setup Confirm (success) seen")
|
||||||
tdls_check_dl(sta0, sta1, bssid, addr0, addr1)
|
tdls_check_dl(sta0, sta1, bssid, addr0, addr1)
|
||||||
|
@ -142,7 +142,7 @@ def teardown_tdls(sta0, sta1, hapd, responder=False, wildcard=False):
|
||||||
sta0.tdls_teardown(addr1)
|
sta0.tdls_teardown(addr1)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
wt = Wlantest()
|
wt = Wlantest()
|
||||||
teardown = wt.get_tdls_counter("teardown", bssid, addr0, addr1);
|
teardown = wt.get_tdls_counter("teardown", bssid, addr0, addr1)
|
||||||
if teardown == 0:
|
if teardown == 0:
|
||||||
raise Exception("No TDLS Setup Teardown seen")
|
raise Exception("No TDLS Setup Teardown seen")
|
||||||
tdls_check_ap(sta0, sta1, bssid, addr0, addr1)
|
tdls_check_ap(sta0, sta1, bssid, addr0, addr1)
|
||||||
|
|
|
@ -57,8 +57,8 @@ def test_ap_vlan_wpa2(dev, apdev):
|
||||||
"""AP VLAN with WPA2-PSK"""
|
"""AP VLAN with WPA2-PSK"""
|
||||||
params = hostapd.wpa2_params(ssid="test-vlan",
|
params = hostapd.wpa2_params(ssid="test-vlan",
|
||||||
passphrase="12345678")
|
passphrase="12345678")
|
||||||
params['dynamic_vlan'] = "1";
|
params['dynamic_vlan'] = "1"
|
||||||
params['accept_mac_file'] = "hostapd.accept";
|
params['accept_mac_file'] = "hostapd.accept"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
dev[0].connect("test-vlan", psk="12345678", scan_freq="2412")
|
dev[0].connect("test-vlan", psk="12345678", scan_freq="2412")
|
||||||
|
@ -71,7 +71,7 @@ def test_ap_vlan_wpa2(dev, apdev):
|
||||||
def test_ap_vlan_wpa2_radius(dev, apdev):
|
def test_ap_vlan_wpa2_radius(dev, apdev):
|
||||||
"""AP VLAN with WPA2-Enterprise and RADIUS attributes"""
|
"""AP VLAN with WPA2-Enterprise and RADIUS attributes"""
|
||||||
params = hostapd.wpa2_eap_params(ssid="test-vlan")
|
params = hostapd.wpa2_eap_params(ssid="test-vlan")
|
||||||
params['dynamic_vlan'] = "1";
|
params['dynamic_vlan'] = "1"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
dev[0].connect("test-vlan", key_mgmt="WPA-EAP", eap="PAX",
|
dev[0].connect("test-vlan", key_mgmt="WPA-EAP", eap="PAX",
|
||||||
|
@ -93,7 +93,7 @@ def test_ap_vlan_wpa2_radius(dev, apdev):
|
||||||
def test_ap_vlan_wpa2_radius_2(dev, apdev):
|
def test_ap_vlan_wpa2_radius_2(dev, apdev):
|
||||||
"""AP VLAN with WPA2-Enterprise and RADIUS EGRESS_VLANID attributes"""
|
"""AP VLAN with WPA2-Enterprise and RADIUS EGRESS_VLANID attributes"""
|
||||||
params = hostapd.wpa2_eap_params(ssid="test-vlan")
|
params = hostapd.wpa2_eap_params(ssid="test-vlan")
|
||||||
params['dynamic_vlan'] = "1";
|
params['dynamic_vlan'] = "1"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
dev[0].connect("test-vlan", key_mgmt="WPA-EAP", eap="PAX",
|
dev[0].connect("test-vlan", key_mgmt="WPA-EAP", eap="PAX",
|
||||||
|
@ -141,7 +141,7 @@ def generic_ap_vlan_wpa2_radius_id_change(dev, apdev, tagged):
|
||||||
authserv = hostapd.add_ap(apdev[1], as_params)
|
authserv = hostapd.add_ap(apdev[1], as_params)
|
||||||
|
|
||||||
params = hostapd.wpa2_eap_params(ssid="test-vlan")
|
params = hostapd.wpa2_eap_params(ssid="test-vlan")
|
||||||
params['dynamic_vlan'] = "1";
|
params['dynamic_vlan'] = "1"
|
||||||
params['auth_server_port'] = "18128"
|
params['auth_server_port'] = "18128"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ def generic_ap_vlan_wpa2_radius_id_change(dev, apdev, tagged):
|
||||||
def test_ap_vlan_wpa2_radius_required(dev, apdev):
|
def test_ap_vlan_wpa2_radius_required(dev, apdev):
|
||||||
"""AP VLAN with WPA2-Enterprise and RADIUS attributes required"""
|
"""AP VLAN with WPA2-Enterprise and RADIUS attributes required"""
|
||||||
params = hostapd.wpa2_eap_params(ssid="test-vlan")
|
params = hostapd.wpa2_eap_params(ssid="test-vlan")
|
||||||
params['dynamic_vlan'] = "2";
|
params['dynamic_vlan'] = "2"
|
||||||
hostapd.add_ap(apdev[0], params)
|
hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
dev[0].connect("test-vlan", key_mgmt="WPA-EAP", eap="PAX",
|
dev[0].connect("test-vlan", key_mgmt="WPA-EAP", eap="PAX",
|
||||||
|
@ -461,9 +461,9 @@ def test_ap_vlan_without_station(dev, apdev, p):
|
||||||
# inject decrypted frames into pcap
|
# inject decrypted frames into pcap
|
||||||
params = hostapd.wpa2_params(ssid="test-vlan",
|
params = hostapd.wpa2_params(ssid="test-vlan",
|
||||||
passphrase="12345678x")
|
passphrase="12345678x")
|
||||||
params['dynamic_vlan'] = "1";
|
params['dynamic_vlan'] = "1"
|
||||||
params['vlan_file'] = 'hostapd.wlan3.vlan'
|
params['vlan_file'] = 'hostapd.wlan3.vlan'
|
||||||
params['accept_mac_file'] = "hostapd.accept";
|
params['accept_mac_file'] = "hostapd.accept"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
# inject some traffic
|
# inject some traffic
|
||||||
|
@ -614,8 +614,8 @@ def test_ap_vlan_reconnect(dev, apdev):
|
||||||
"""AP VLAN with WPA2-PSK connect, disconnect, connect"""
|
"""AP VLAN with WPA2-PSK connect, disconnect, connect"""
|
||||||
params = hostapd.wpa2_params(ssid="test-vlan",
|
params = hostapd.wpa2_params(ssid="test-vlan",
|
||||||
passphrase="12345678")
|
passphrase="12345678")
|
||||||
params['dynamic_vlan'] = "1";
|
params['dynamic_vlan'] = "1"
|
||||||
params['accept_mac_file'] = "hostapd.accept";
|
params['accept_mac_file'] = "hostapd.accept"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
logger.info("connect sta")
|
logger.info("connect sta")
|
||||||
|
|
|
@ -2477,7 +2477,7 @@ def test_ap_wps_ssdp_msearch(dev, apdev):
|
||||||
ssdp_send_msearch("upnp:rootdevice")
|
ssdp_send_msearch("upnp:rootdevice")
|
||||||
ssdp_send_msearch("uuid:" + ap_uuid)
|
ssdp_send_msearch("uuid:" + ap_uuid)
|
||||||
ssdp_send_msearch("urn:schemas-wifialliance-org:service:WFAWLANConfig:1")
|
ssdp_send_msearch("urn:schemas-wifialliance-org:service:WFAWLANConfig:1")
|
||||||
ssdp_send_msearch("urn:schemas-wifialliance-org:device:WFADevice:1");
|
ssdp_send_msearch("urn:schemas-wifialliance-org:device:WFADevice:1")
|
||||||
|
|
||||||
msg = '\r\n'.join([
|
msg = '\r\n'.join([
|
||||||
'M-SEARCH * HTTP/1.1',
|
'M-SEARCH * HTTP/1.1',
|
||||||
|
|
|
@ -419,13 +419,13 @@ def _test_dbus_get_set_wps(dev, apdev):
|
||||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||||
if if_obj.Get(WPAS_DBUS_IFACE_WPS, "ProcessCredentials",
|
if if_obj.Get(WPAS_DBUS_IFACE_WPS, "ProcessCredentials",
|
||||||
dbus_interface=dbus.PROPERTIES_IFACE) != True:
|
dbus_interface=dbus.PROPERTIES_IFACE) != True:
|
||||||
raise Exception("Unexpected Get(ProcessCredentials) result after Set");
|
raise Exception("Unexpected Get(ProcessCredentials) result after Set")
|
||||||
if_obj.Set(WPAS_DBUS_IFACE_WPS, "ProcessCredentials",
|
if_obj.Set(WPAS_DBUS_IFACE_WPS, "ProcessCredentials",
|
||||||
dbus.Boolean(0),
|
dbus.Boolean(0),
|
||||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||||
if if_obj.Get(WPAS_DBUS_IFACE_WPS, "ProcessCredentials",
|
if if_obj.Get(WPAS_DBUS_IFACE_WPS, "ProcessCredentials",
|
||||||
dbus_interface=dbus.PROPERTIES_IFACE) != False:
|
dbus_interface=dbus.PROPERTIES_IFACE) != False:
|
||||||
raise Exception("Unexpected Get(ProcessCredentials) result after Set");
|
raise Exception("Unexpected Get(ProcessCredentials) result after Set")
|
||||||
|
|
||||||
self.dbus_sets_done = True
|
self.dbus_sets_done = True
|
||||||
return False
|
return False
|
||||||
|
@ -4190,7 +4190,7 @@ def test_dbus_p2p_go_neg_auth(dev, apdev):
|
||||||
if not dev1.discover_peer(addr0):
|
if not dev1.discover_peer(addr0):
|
||||||
raise Exception("Peer not found")
|
raise Exception("Peer not found")
|
||||||
dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 display go_intent=0")
|
dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 display go_intent=0")
|
||||||
ev = dev1.wait_global_event(["P2P-GROUP-STARTED"], timeout=15);
|
ev = dev1.wait_global_event(["P2P-GROUP-STARTED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group formation timed out")
|
raise Exception("Group formation timed out")
|
||||||
self.sta_group_ev = ev
|
self.sta_group_ev = ev
|
||||||
|
@ -4279,7 +4279,7 @@ def test_dbus_p2p_go_neg_init(dev, apdev):
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Timeout while waiting for GO Neg Request")
|
raise Exception("Timeout while waiting for GO Neg Request")
|
||||||
dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 display go_intent=15")
|
dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 display go_intent=15")
|
||||||
ev = dev1.wait_global_event(["P2P-GROUP-STARTED"], timeout=15);
|
ev = dev1.wait_global_event(["P2P-GROUP-STARTED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group formation timed out")
|
raise Exception("Group formation timed out")
|
||||||
self.sta_group_ev = ev
|
self.sta_group_ev = ev
|
||||||
|
@ -4369,7 +4369,7 @@ def test_dbus_p2p_group_termination_by_go(dev, apdev):
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Timeout while waiting for GO Neg Request")
|
raise Exception("Timeout while waiting for GO Neg Request")
|
||||||
dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 display go_intent=15")
|
dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 display go_intent=15")
|
||||||
ev = dev1.wait_global_event(["P2P-GROUP-STARTED"], timeout=15);
|
ev = dev1.wait_global_event(["P2P-GROUP-STARTED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group formation timed out")
|
raise Exception("Group formation timed out")
|
||||||
self.sta_group_ev = ev
|
self.sta_group_ev = ev
|
||||||
|
@ -4465,7 +4465,7 @@ def _test_dbus_p2p_group_idle_timeout(dev, apdev):
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Timeout while waiting for GO Neg Request")
|
raise Exception("Timeout while waiting for GO Neg Request")
|
||||||
dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 display go_intent=15")
|
dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 display go_intent=15")
|
||||||
ev = dev1.wait_global_event(["P2P-GROUP-STARTED"], timeout=15);
|
ev = dev1.wait_global_event(["P2P-GROUP-STARTED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group formation timed out")
|
raise Exception("Group formation timed out")
|
||||||
self.sta_group_ev = ev
|
self.sta_group_ev = ev
|
||||||
|
@ -4700,7 +4700,7 @@ def test_dbus_p2p_two_groups(dev, apdev):
|
||||||
dev2 = WpaSupplicant('wlan2', '/tmp/wpas-wlan2')
|
dev2 = WpaSupplicant('wlan2', '/tmp/wpas-wlan2')
|
||||||
dev2.scan_for_bss(bssid, freq=2412)
|
dev2.scan_for_bss(bssid, freq=2412)
|
||||||
dev2.global_request("P2P_CONNECT " + bssid + " 12345670 join freq=2412")
|
dev2.global_request("P2P_CONNECT " + bssid + " 12345670 join freq=2412")
|
||||||
ev = dev2.wait_global_event(["P2P-GROUP-STARTED"], timeout=15);
|
ev = dev2.wait_global_event(["P2P-GROUP-STARTED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group join timed out")
|
raise Exception("Group join timed out")
|
||||||
self.dev2_group_ev = ev
|
self.dev2_group_ev = ev
|
||||||
|
|
|
@ -113,18 +113,18 @@ def test_dfs(dev, apdev):
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("DFS-RADAR-DETECTED event not reported")
|
raise Exception("DFS-RADAR-DETECTED event not reported")
|
||||||
if "freq=5260" not in ev:
|
if "freq=5260" not in ev:
|
||||||
raise Exception("Incorrect frequency in radar detected event: " + ev);
|
raise Exception("Incorrect frequency in radar detected event: " + ev)
|
||||||
ev = hapd.wait_event(["DFS-NEW-CHANNEL"], timeout=70)
|
ev = hapd.wait_event(["DFS-NEW-CHANNEL"], timeout=70)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("DFS-NEW-CHANNEL event not reported")
|
raise Exception("DFS-NEW-CHANNEL event not reported")
|
||||||
if "freq=5260" in ev:
|
if "freq=5260" in ev:
|
||||||
raise Exception("Channel did not change after radar was detected");
|
raise Exception("Channel did not change after radar was detected")
|
||||||
|
|
||||||
ev = hapd.wait_event(["AP-CSA-FINISHED"], timeout=70)
|
ev = hapd.wait_event(["AP-CSA-FINISHED"], timeout=70)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("AP-CSA-FINISHED event not reported")
|
raise Exception("AP-CSA-FINISHED event not reported")
|
||||||
if "freq=5260" in ev:
|
if "freq=5260" in ev:
|
||||||
raise Exception("Channel did not change after radar was detected(2)");
|
raise Exception("Channel did not change after radar was detected(2)")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
hwsim_utils.test_connectivity(dev[0], hapd)
|
hwsim_utils.test_connectivity(dev[0], hapd)
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -147,7 +147,7 @@ class FstLauncher:
|
||||||
self.nof_aps -= 1
|
self.nof_aps -= 1
|
||||||
else:
|
else:
|
||||||
self.nof_stas -= 1
|
self.nof_stas -= 1
|
||||||
config_file = self.get_cfg_pathname(cfg);
|
config_file = self.get_cfg_pathname(cfg)
|
||||||
if os.path.exists(config_file):
|
if os.path.exists(config_file):
|
||||||
os.remove(config_file)
|
os.remove(config_file)
|
||||||
|
|
||||||
|
|
|
@ -1065,7 +1065,7 @@ def test_fst_disconnect_non_fst_sta(dev, apdev, test_params):
|
||||||
def test_fst_disconnect_fst_sta(dev, apdev, test_params):
|
def test_fst_disconnect_fst_sta(dev, apdev, test_params):
|
||||||
"""FST disconnect FST STA"""
|
"""FST disconnect FST STA"""
|
||||||
ap1, ap2, fst_sta1, fst_sta2 = fst_module_aux.start_two_ap_sta_pairs(apdev)
|
ap1, ap2, fst_sta1, fst_sta2 = fst_module_aux.start_two_ap_sta_pairs(apdev)
|
||||||
external_sta_connected = False;
|
external_sta_connected = False
|
||||||
try:
|
try:
|
||||||
vals = fst_sta1.scan(freq=fst_test_common.fst_test_def_freq_a)
|
vals = fst_sta1.scan(freq=fst_test_common.fst_test_def_freq_a)
|
||||||
fst_sta1.connect(ap1, key_mgmt="NONE",
|
fst_sta1.connect(ap1, key_mgmt="NONE",
|
||||||
|
|
|
@ -203,8 +203,8 @@ def test_mbo_cell_capa_update_pmf(dev, apdev):
|
||||||
ssid = "test-wnm-mbo"
|
ssid = "test-wnm-mbo"
|
||||||
passphrase = "12345678"
|
passphrase = "12345678"
|
||||||
params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
|
params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
|
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
params['mbo'] = '1'
|
params['mbo'] = '1'
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
bssid = apdev[0]['bssid']
|
bssid = apdev[0]['bssid']
|
||||||
|
|
|
@ -255,28 +255,28 @@ def test_autogo_tdls(dev):
|
||||||
dev[1].tdls_setup(addr2)
|
dev[1].tdls_setup(addr2)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
hwsim_utils.test_connectivity_p2p(dev[1], dev[2])
|
hwsim_utils.test_connectivity_p2p(dev[1], dev[2])
|
||||||
conf = wt.get_tdls_counter("setup_conf_ok", bssid, addr1, addr2);
|
conf = wt.get_tdls_counter("setup_conf_ok", bssid, addr1, addr2)
|
||||||
if conf == 0:
|
if conf == 0:
|
||||||
raise Exception("No TDLS Setup Confirm (success) seen")
|
raise Exception("No TDLS Setup Confirm (success) seen")
|
||||||
dl = wt.get_tdls_counter("valid_direct_link", bssid, addr1, addr2);
|
dl = wt.get_tdls_counter("valid_direct_link", bssid, addr1, addr2)
|
||||||
if dl == 0:
|
if dl == 0:
|
||||||
raise Exception("No valid frames through direct link")
|
raise Exception("No valid frames through direct link")
|
||||||
wt.tdls_clear(bssid, addr1, addr2);
|
wt.tdls_clear(bssid, addr1, addr2)
|
||||||
dev[1].tdls_teardown(addr2)
|
dev[1].tdls_teardown(addr2)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
teardown = wt.get_tdls_counter("teardown", bssid, addr1, addr2);
|
teardown = wt.get_tdls_counter("teardown", bssid, addr1, addr2)
|
||||||
if teardown == 0:
|
if teardown == 0:
|
||||||
raise Exception("No TDLS Setup Teardown seen")
|
raise Exception("No TDLS Setup Teardown seen")
|
||||||
wt.tdls_clear(bssid, addr1, addr2);
|
wt.tdls_clear(bssid, addr1, addr2)
|
||||||
hwsim_utils.test_connectivity_p2p(dev[1], dev[2])
|
hwsim_utils.test_connectivity_p2p(dev[1], dev[2])
|
||||||
ap_path = wt.get_tdls_counter("valid_ap_path", bssid, addr1, addr2);
|
ap_path = wt.get_tdls_counter("valid_ap_path", bssid, addr1, addr2)
|
||||||
if ap_path == 0:
|
if ap_path == 0:
|
||||||
raise Exception("No valid frames via AP path")
|
raise Exception("No valid frames via AP path")
|
||||||
direct_link = wt.get_tdls_counter("valid_direct_link", bssid, addr1, addr2);
|
direct_link = wt.get_tdls_counter("valid_direct_link", bssid, addr1, addr2)
|
||||||
if direct_link > 0:
|
if direct_link > 0:
|
||||||
raise Exception("Unexpected frames through direct link")
|
raise Exception("Unexpected frames through direct link")
|
||||||
idirect_link = wt.get_tdls_counter("invalid_direct_link", bssid, addr1,
|
idirect_link = wt.get_tdls_counter("invalid_direct_link", bssid, addr1,
|
||||||
addr2);
|
addr2)
|
||||||
if idirect_link > 0:
|
if idirect_link > 0:
|
||||||
raise Exception("Unexpected frames through direct link (invalid)")
|
raise Exception("Unexpected frames through direct link (invalid)")
|
||||||
dev[2].remove_group()
|
dev[2].remove_group()
|
||||||
|
|
|
@ -235,7 +235,7 @@ def test_go_neg_with_bss_connected(dev, apdev):
|
||||||
|
|
||||||
if dev[0].get_mcc() > 1:
|
if dev[0].get_mcc() > 1:
|
||||||
logger.info("Skip as-client case due to MCC being enabled")
|
logger.info("Skip as-client case due to MCC being enabled")
|
||||||
return;
|
return
|
||||||
|
|
||||||
#dev[0] as client
|
#dev[0] as client
|
||||||
[i_res2, r_res2] = go_neg_pbc(i_dev=dev[0], i_intent=1, r_dev=dev[1],
|
[i_res2, r_res2] = go_neg_pbc(i_dev=dev[0], i_intent=1, r_dev=dev[1],
|
||||||
|
@ -859,7 +859,7 @@ def _test_p2p_go_move_scm_peer_supports(dev, apdev):
|
||||||
|
|
||||||
hapd = hostapd.add_ap(apdev[0], { "ssid" : 'ap-test',
|
hapd = hostapd.add_ap(apdev[0], { "ssid" : 'ap-test',
|
||||||
"channel" : '11' })
|
"channel" : '11' })
|
||||||
logger.info('Connecting client to to an AP on channel 11');
|
logger.info('Connecting client to to an AP on channel 11')
|
||||||
dev[0].connect("ap-test", key_mgmt="NONE",
|
dev[0].connect("ap-test", key_mgmt="NONE",
|
||||||
scan_freq="2462")
|
scan_freq="2462")
|
||||||
|
|
||||||
|
@ -909,7 +909,7 @@ def _test_p2p_go_move_scm_peer_does_not_support(dev, apdev):
|
||||||
|
|
||||||
hapd = hostapd.add_ap(apdev[0], { "ssid" : 'ap-test',
|
hapd = hostapd.add_ap(apdev[0], { "ssid" : 'ap-test',
|
||||||
"channel" : '11' })
|
"channel" : '11' })
|
||||||
logger.info('Connecting client to to an AP on channel 11');
|
logger.info('Connecting client to to an AP on channel 11')
|
||||||
dev[0].connect("ap-test", key_mgmt="NONE",
|
dev[0].connect("ap-test", key_mgmt="NONE",
|
||||||
scan_freq="2462")
|
scan_freq="2462")
|
||||||
|
|
||||||
|
@ -1010,7 +1010,7 @@ def test_p2p_delay_go_csa(dev, apdev, params):
|
||||||
addr1 = dev[1].p2p_dev_addr()
|
addr1 = dev[1].p2p_dev_addr()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dev[1].p2p_listen();
|
dev[1].p2p_listen()
|
||||||
if not wpas.discover_peer(addr1, social=True):
|
if not wpas.discover_peer(addr1, social=True):
|
||||||
raise Exception("Peer " + addr1 + " not found")
|
raise Exception("Peer " + addr1 + " not found")
|
||||||
wpas.p2p_stop_find()
|
wpas.p2p_stop_find()
|
||||||
|
@ -1048,7 +1048,7 @@ def test_p2p_delay_go_csa(dev, apdev, params):
|
||||||
|
|
||||||
pin = dev[1].wps_read_pin()
|
pin = dev[1].wps_read_pin()
|
||||||
dev[1].global_request("P2P_CONNECT " + addr0 + " " + pin + " join auth")
|
dev[1].global_request("P2P_CONNECT " + addr0 + " " + pin + " join auth")
|
||||||
dev[1].p2p_listen();
|
dev[1].p2p_listen()
|
||||||
|
|
||||||
# Force P2P GO channel switch on successful invitation signaling
|
# Force P2P GO channel switch on successful invitation signaling
|
||||||
wpas.group_request("SET p2p_go_csa_on_inv 1")
|
wpas.group_request("SET p2p_go_csa_on_inv 1")
|
||||||
|
|
|
@ -999,7 +999,7 @@ def test_p2p_msg_invitation_resp(dev, apdev):
|
||||||
msg['payload'] += ie_p2p(attrs)
|
msg['payload'] += ie_p2p(attrs)
|
||||||
mgmt_tx(dev[1], "MGMT_TX {} {} freq={} wait_time=200 no_cck=1 action={}".format(addr0, addr0, rx_msg['freq'], binascii.hexlify(msg['payload'])))
|
mgmt_tx(dev[1], "MGMT_TX {} {} freq={} wait_time=200 no_cck=1 action={}".format(addr0, addr0, rx_msg['freq'], binascii.hexlify(msg['payload'])))
|
||||||
|
|
||||||
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=15);
|
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group was not started")
|
raise Exception("Group was not started")
|
||||||
|
|
||||||
|
@ -1031,11 +1031,11 @@ def test_p2p_msg_invitation_resend(dev, apdev):
|
||||||
mgmt_tx(dev[1], "MGMT_TX {} {} freq={} wait_time=200 no_cck=1 action={}".format(addr0, addr0, rx_msg['freq'], binascii.hexlify(msg['payload'])))
|
mgmt_tx(dev[1], "MGMT_TX {} {} freq={} wait_time=200 no_cck=1 action={}".format(addr0, addr0, rx_msg['freq'], binascii.hexlify(msg['payload'])))
|
||||||
ev = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
|
ev = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Timeout on invitation result");
|
raise Exception("Timeout on invitation result")
|
||||||
if "status=7" not in ev:
|
if "status=7" not in ev:
|
||||||
raise Exception("Unexpected invitation result: " + ev)
|
raise Exception("Unexpected invitation result: " + ev)
|
||||||
|
|
||||||
logger.info("Any channel allowed, only preference provided in invitation");
|
logger.info("Any channel allowed, only preference provided in invitation")
|
||||||
invite(dev[0], dev[1], extra="pref=2422")
|
invite(dev[0], dev[1], extra="pref=2422")
|
||||||
rx_msg = dev[1].mgmt_rx()
|
rx_msg = dev[1].mgmt_rx()
|
||||||
if rx_msg is None:
|
if rx_msg is None:
|
||||||
|
@ -1054,14 +1054,14 @@ def test_p2p_msg_invitation_resend(dev, apdev):
|
||||||
mgmt_tx(dev[1], "MGMT_TX {} {} freq={} wait_time=200 no_cck=1 action={}".format(addr0, addr0, rx_msg['freq'], binascii.hexlify(msg['payload'])))
|
mgmt_tx(dev[1], "MGMT_TX {} {} freq={} wait_time=200 no_cck=1 action={}".format(addr0, addr0, rx_msg['freq'], binascii.hexlify(msg['payload'])))
|
||||||
ev = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
|
ev = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Timeout on invitation result");
|
raise Exception("Timeout on invitation result")
|
||||||
if "status=0" not in ev:
|
if "status=0" not in ev:
|
||||||
raise Exception("Unexpected invitation result: " + ev)
|
raise Exception("Unexpected invitation result: " + ev)
|
||||||
|
|
||||||
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=15);
|
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group was not started on dev0")
|
raise Exception("Group was not started on dev0")
|
||||||
ev = dev[1].wait_global_event(["P2P-GROUP-STARTED"], timeout=15);
|
ev = dev[1].wait_global_event(["P2P-GROUP-STARTED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group was not started on dev1")
|
raise Exception("Group was not started on dev1")
|
||||||
|
|
||||||
|
@ -1076,7 +1076,7 @@ def test_p2p_msg_invitation_resend_duplicate(dev, apdev):
|
||||||
if "FAIL" in dev[1].request("SET ext_mgmt_frame_handling 1"):
|
if "FAIL" in dev[1].request("SET ext_mgmt_frame_handling 1"):
|
||||||
raise Exception("Failed to enable external management frame handling")
|
raise Exception("Failed to enable external management frame handling")
|
||||||
|
|
||||||
logger.info("Any channel allowed, only preference provided in invitation");
|
logger.info("Any channel allowed, only preference provided in invitation")
|
||||||
invite(dev[0], dev[1], extra="pref=2422")
|
invite(dev[0], dev[1], extra="pref=2422")
|
||||||
rx_msg = dev[1].mgmt_rx()
|
rx_msg = dev[1].mgmt_rx()
|
||||||
if rx_msg is None:
|
if rx_msg is None:
|
||||||
|
@ -1116,7 +1116,7 @@ def test_p2p_msg_invitation_resend_duplicate(dev, apdev):
|
||||||
|
|
||||||
ev = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=10)
|
ev = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=10)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Timeout on invitation result");
|
raise Exception("Timeout on invitation result")
|
||||||
if "status=0" not in ev:
|
if "status=0" not in ev:
|
||||||
raise Exception("Unexpected invitation result: " + ev)
|
raise Exception("Unexpected invitation result: " + ev)
|
||||||
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=10)
|
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=10)
|
||||||
|
@ -1296,10 +1296,10 @@ def test_p2p_msg_go_neg_both_start(dev, apdev):
|
||||||
ev = dev[0].wait_global_event(["P2P-GO-NEG-SUCCESS"], timeout=10)
|
ev = dev[0].wait_global_event(["P2P-GO-NEG-SUCCESS"], timeout=10)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("GO Neg did not succeed")
|
raise Exception("GO Neg did not succeed")
|
||||||
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=5);
|
ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=5)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group formation not succeed")
|
raise Exception("Group formation not succeed")
|
||||||
ev = dev[1].wait_global_event(["P2P-GROUP-STARTED"], timeout=5);
|
ev = dev[1].wait_global_event(["P2P-GROUP-STARTED"], timeout=5)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Group formation not succeed")
|
raise Exception("Group formation not succeed")
|
||||||
|
|
||||||
|
|
|
@ -392,13 +392,13 @@ def test_persistent_group_without_persistent_reconnect(dev):
|
||||||
|
|
||||||
ev = dev[0].wait_global_event(["P2P-INVITATION-RECEIVED"], timeout=15)
|
ev = dev[0].wait_global_event(["P2P-INVITATION-RECEIVED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("No invitation request reported");
|
raise Exception("No invitation request reported")
|
||||||
if "persistent=" not in ev:
|
if "persistent=" not in ev:
|
||||||
raise Exception("Invalid invitation type reported: " + ev)
|
raise Exception("Invalid invitation type reported: " + ev)
|
||||||
|
|
||||||
ev2 = dev[1].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
|
ev2 = dev[1].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
|
||||||
if ev2 is None:
|
if ev2 is None:
|
||||||
raise Exception("No invitation response reported");
|
raise Exception("No invitation response reported")
|
||||||
if "status=1" not in ev2:
|
if "status=1" not in ev2:
|
||||||
raise Exception("Unexpected status: " + ev2)
|
raise Exception("Unexpected status: " + ev2)
|
||||||
dev[1].p2p_listen()
|
dev[1].p2p_listen()
|
||||||
|
@ -432,13 +432,13 @@ def test_persistent_group_without_persistent_reconnect(dev):
|
||||||
|
|
||||||
ev = dev[1].wait_global_event(["P2P-INVITATION-RECEIVED"], timeout=15)
|
ev = dev[1].wait_global_event(["P2P-INVITATION-RECEIVED"], timeout=15)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("No invitation request reported");
|
raise Exception("No invitation request reported")
|
||||||
if "persistent=" not in ev:
|
if "persistent=" not in ev:
|
||||||
raise Exception("Invalid invitation type reported: " + ev)
|
raise Exception("Invalid invitation type reported: " + ev)
|
||||||
|
|
||||||
ev2 = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
|
ev2 = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
|
||||||
if ev2 is None:
|
if ev2 is None:
|
||||||
raise Exception("No invitation response reported");
|
raise Exception("No invitation response reported")
|
||||||
if "status=1" not in ev2:
|
if "status=1" not in ev2:
|
||||||
raise Exception("Unexpected status: " + ev2)
|
raise Exception("Unexpected status: " + ev2)
|
||||||
dev[0].p2p_listen()
|
dev[0].p2p_listen()
|
||||||
|
|
|
@ -1119,7 +1119,7 @@ def test_p2ps_channel_one_connected(dev, apdev):
|
||||||
dev[1].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2442")
|
dev[1].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2442")
|
||||||
|
|
||||||
(grp_ifname0, grp_ifname1, ifnames) = p2ps_connect_p2ps_method(dev, keep_group=True, join_extra=" freq=2442")
|
(grp_ifname0, grp_ifname1, ifnames) = p2ps_connect_p2ps_method(dev, keep_group=True, join_extra=" freq=2442")
|
||||||
freq = dev[0].get_group_status_field('freq');
|
freq = dev[0].get_group_status_field('freq')
|
||||||
|
|
||||||
if freq != '2442':
|
if freq != '2442':
|
||||||
raise Exception('Unexpected frequency for group 2442 != ' + freq)
|
raise Exception('Unexpected frequency for group 2442 != ' + freq)
|
||||||
|
@ -1151,7 +1151,7 @@ def test_p2ps_channel_both_connected_same(dev, apdev):
|
||||||
|
|
||||||
tmpdev = [ dev[2], dev[1] ]
|
tmpdev = [ dev[2], dev[1] ]
|
||||||
(grp_ifname0, grp_ifname1, ifnames) = p2ps_connect_p2ps_method(tmpdev, keep_group=True, join_extra=" freq=2437", flush=False)
|
(grp_ifname0, grp_ifname1, ifnames) = p2ps_connect_p2ps_method(tmpdev, keep_group=True, join_extra=" freq=2437", flush=False)
|
||||||
freq = dev[2].get_group_status_field('freq');
|
freq = dev[2].get_group_status_field('freq')
|
||||||
|
|
||||||
if freq != '2437':
|
if freq != '2437':
|
||||||
raise Exception('Unexpected frequency for group 2437 != ' + freq)
|
raise Exception('Unexpected frequency for group 2437 != ' + freq)
|
||||||
|
@ -1193,7 +1193,7 @@ def test_p2ps_channel_both_connected_different(dev, apdev):
|
||||||
ev1, ev0 = p2ps_provision(dev[1], dev[0], adv_id, auto_accept=False,
|
ev1, ev0 = p2ps_provision(dev[1], dev[0], adv_id, auto_accept=False,
|
||||||
handler=disconnect_handler)
|
handler=disconnect_handler)
|
||||||
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
|
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
|
||||||
freq = dev[0].get_group_status_field('freq');
|
freq = dev[0].get_group_status_field('freq')
|
||||||
if freq != '2457':
|
if freq != '2457':
|
||||||
raise Exception('Unexpected frequency for group 2457 != ' + freq)
|
raise Exception('Unexpected frequency for group 2457 != ' + freq)
|
||||||
finally:
|
finally:
|
||||||
|
@ -1219,7 +1219,7 @@ def test_p2ps_channel_both_connected_different_mcc(dev, apdev):
|
||||||
dev[1].connect("bss-channel-10", key_mgmt="NONE", scan_freq="2457")
|
dev[1].connect("bss-channel-10", key_mgmt="NONE", scan_freq="2457")
|
||||||
|
|
||||||
(grp_ifname0, grp_ifname1, ifnames) = p2ps_connect_p2ps_method(dev, keep_group=True)
|
(grp_ifname0, grp_ifname1, ifnames) = p2ps_connect_p2ps_method(dev, keep_group=True)
|
||||||
freq = dev[0].get_group_status_field('freq');
|
freq = dev[0].get_group_status_field('freq')
|
||||||
|
|
||||||
if freq != '2422' and freq != '2457':
|
if freq != '2422' and freq != '2457':
|
||||||
raise Exception('Unexpected frequency for group =' + freq)
|
raise Exception('Unexpected frequency for group =' + freq)
|
||||||
|
@ -1252,7 +1252,7 @@ def test_p2ps_channel_disallow_freq(dev, apdev):
|
||||||
handler=clear_disallow_handler)
|
handler=clear_disallow_handler)
|
||||||
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
|
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
|
||||||
|
|
||||||
freq = dev[0].get_group_status_field('freq');
|
freq = dev[0].get_group_status_field('freq')
|
||||||
if freq != '2412':
|
if freq != '2412':
|
||||||
raise Exception('Unexpected frequency for group 2412 != ' + freq)
|
raise Exception('Unexpected frequency for group 2412 != ' + freq)
|
||||||
finally:
|
finally:
|
||||||
|
@ -1287,7 +1287,7 @@ def test_p2ps_channel_sta_connected_disallow_freq(dev, apdev):
|
||||||
handler=clear_disallow_handler)
|
handler=clear_disallow_handler)
|
||||||
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
|
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
|
||||||
|
|
||||||
freq = dev[0].get_group_status_field('freq');
|
freq = dev[0].get_group_status_field('freq')
|
||||||
if freq != '2437':
|
if freq != '2437':
|
||||||
raise Exception('Unexpected frequency for group 2437 != ' + freq)
|
raise Exception('Unexpected frequency for group 2437 != ' + freq)
|
||||||
finally:
|
finally:
|
||||||
|
@ -1317,7 +1317,7 @@ def test_p2ps_channel_sta_connected_disallow_freq_mcc(dev, apdev):
|
||||||
tmpdev = [ dev[0], wpas ]
|
tmpdev = [ dev[0], wpas ]
|
||||||
(grp_ifname0, grp_ifname1, ifnames) = p2ps_connect_p2ps_method(tmpdev, keep_group=True)
|
(grp_ifname0, grp_ifname1, ifnames) = p2ps_connect_p2ps_method(tmpdev, keep_group=True)
|
||||||
|
|
||||||
freq = dev[0].get_group_status_field('freq');
|
freq = dev[0].get_group_status_field('freq')
|
||||||
if freq == '2437':
|
if freq == '2437':
|
||||||
raise Exception('Unexpected frequency=2437')
|
raise Exception('Unexpected frequency=2437')
|
||||||
finally:
|
finally:
|
||||||
|
@ -1458,7 +1458,7 @@ def test_p2ps_channel_active_go_and_station_different(dev, apdev):
|
||||||
handler=disconnect_handler, adv_role='2',
|
handler=disconnect_handler, adv_role='2',
|
||||||
seeker_role='4')
|
seeker_role='4')
|
||||||
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
|
p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
|
||||||
freq = dev[0].get_group_status_field('freq');
|
freq = dev[0].get_group_status_field('freq')
|
||||||
if freq != '2462':
|
if freq != '2462':
|
||||||
raise Exception('Unexpected frequency for group 2462!=' + freq)
|
raise Exception('Unexpected frequency for group 2462!=' + freq)
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -70,9 +70,9 @@ def test_ext_radio_work(dev, apdev):
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Timeout while waiting radio work to start")
|
raise Exception("Timeout while waiting radio work to start")
|
||||||
if "FAIL" not in dev[0].request("RADIO_WORK done 12345678"):
|
if "FAIL" not in dev[0].request("RADIO_WORK done 12345678"):
|
||||||
raise Exception("Invalid RADIO_WORK done accepted");
|
raise Exception("Invalid RADIO_WORK done accepted")
|
||||||
if "FAIL" not in dev[0].request("RADIO_WORK foo"):
|
if "FAIL" not in dev[0].request("RADIO_WORK foo"):
|
||||||
raise Exception("Invalid RADIO_WORK accepted");
|
raise Exception("Invalid RADIO_WORK accepted")
|
||||||
dev[0].request("FLUSH")
|
dev[0].request("FLUSH")
|
||||||
items = dev[0].request("RADIO_WORK show")
|
items = dev[0].request("RADIO_WORK show")
|
||||||
if items != "":
|
if items != "":
|
||||||
|
|
|
@ -854,7 +854,7 @@ def test_scan_specify_ssid(dev, apdev):
|
||||||
if bss is None:
|
if bss is None:
|
||||||
raise Exception("BSS entry for hidden AP not found")
|
raise Exception("BSS entry for hidden AP not found")
|
||||||
if 'test-hidden' not in dev[0].request("SCAN_RESULTS"):
|
if 'test-hidden' not in dev[0].request("SCAN_RESULTS"):
|
||||||
raise Exception("Expected SSID not included in the scan results");
|
raise Exception("Expected SSID not included in the scan results")
|
||||||
|
|
||||||
hapd.disable()
|
hapd.disable()
|
||||||
dev[0].flush_scan_cache(freq=2432)
|
dev[0].flush_scan_cache(freq=2432)
|
||||||
|
|
|
@ -23,7 +23,7 @@ def check_suite_b_capa(dev):
|
||||||
def check_suite_b_tls_lib(dev):
|
def check_suite_b_tls_lib(dev):
|
||||||
tls = dev[0].request("GET tls_library")
|
tls = dev[0].request("GET tls_library")
|
||||||
if not tls.startswith("OpenSSL"):
|
if not tls.startswith("OpenSSL"):
|
||||||
raise HwsimSkip("TLS library not supported for Suite B: " + tls);
|
raise HwsimSkip("TLS library not supported for Suite B: " + tls)
|
||||||
supported = False
|
supported = False
|
||||||
for ver in [ '1.0.2', '1.1.0' ]:
|
for ver in [ '1.0.2', '1.1.0' ]:
|
||||||
if "build=OpenSSL " + ver in tls and "run=OpenSSL " + ver in tls:
|
if "build=OpenSSL " + ver in tls and "run=OpenSSL " + ver in tls:
|
||||||
|
|
|
@ -180,8 +180,8 @@ def test_wext_pmf(dev, apdev):
|
||||||
wpas = get_wext_interface()
|
wpas = get_wext_interface()
|
||||||
|
|
||||||
params = hostapd.wpa2_params(ssid="wext-wpa2-psk", passphrase="12345678")
|
params = hostapd.wpa2_params(ssid="wext-wpa2-psk", passphrase="12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
|
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
wpas.connect("wext-wpa2-psk", psk="12345678", ieee80211w="1",
|
wpas.connect("wext-wpa2-psk", psk="12345678", ieee80211w="1",
|
||||||
|
|
|
@ -39,6 +39,6 @@ def test_wmediumd_simple(dev, apdev):
|
||||||
p.terminate()
|
p.terminate()
|
||||||
p.wait()
|
p.wait()
|
||||||
# test that releasing hwsim works correctly
|
# test that releasing hwsim works correctly
|
||||||
_test_ap_open(dev, apdev);
|
_test_ap_open(dev, apdev)
|
||||||
finally:
|
finally:
|
||||||
os.unlink(fn)
|
os.unlink(fn)
|
||||||
|
|
|
@ -78,8 +78,8 @@ def test_wnm_ess_disassoc_imminent(dev, apdev):
|
||||||
def test_wnm_ess_disassoc_imminent_pmf(dev, apdev):
|
def test_wnm_ess_disassoc_imminent_pmf(dev, apdev):
|
||||||
"""WNM ESS Disassociation Imminent"""
|
"""WNM ESS Disassociation Imminent"""
|
||||||
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
|
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
|
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
params["bss_transition"] = "1"
|
params["bss_transition"] = "1"
|
||||||
hapd = hostapd.add_ap(apdev[0], params)
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
|
||||||
|
@ -195,8 +195,8 @@ def test_wnm_sleep_mode_ap_oom(dev, apdev):
|
||||||
def test_wnm_sleep_mode_rsn_pmf(dev, apdev):
|
def test_wnm_sleep_mode_rsn_pmf(dev, apdev):
|
||||||
"""WNM Sleep Mode - RSN with PMF"""
|
"""WNM Sleep Mode - RSN with PMF"""
|
||||||
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
|
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
|
||||||
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
|
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
|
||||||
params["ieee80211w"] = "2";
|
params["ieee80211w"] = "2"
|
||||||
params["time_advertisement"] = "2"
|
params["time_advertisement"] = "2"
|
||||||
params["time_zone"] = "EST5"
|
params["time_zone"] = "EST5"
|
||||||
params["wnm_sleep_mode"] = "1"
|
params["wnm_sleep_mode"] = "1"
|
||||||
|
@ -565,7 +565,7 @@ def test_wnm_bss_tm(dev, apdev):
|
||||||
raise Exception("Unexpected scan started")
|
raise Exception("Unexpected scan started")
|
||||||
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=0.5)
|
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=0.5)
|
||||||
if ev is not None:
|
if ev is not None:
|
||||||
raise Exception("Unexpected reassociation");
|
raise Exception("Unexpected reassociation")
|
||||||
finally:
|
finally:
|
||||||
dev[0].request("DISCONNECT")
|
dev[0].request("DISCONNECT")
|
||||||
if hapd:
|
if hapd:
|
||||||
|
|
|
@ -189,10 +189,10 @@ def test_wpas_ctrl_network(dev):
|
||||||
raise Exception("Too short PSK accepted")
|
raise Exception("Too short PSK accepted")
|
||||||
if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' psk "1234567890123456789012345678901234567890123456789012345678901234"'):
|
if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' psk "1234567890123456789012345678901234567890123456789012345678901234"'):
|
||||||
raise Exception("Too long PSK accepted")
|
raise Exception("Too long PSK accepted")
|
||||||
dev[0].set_network_quoted(id, "psk", "123456768");
|
dev[0].set_network_quoted(id, "psk", "123456768")
|
||||||
dev[0].set_network_quoted(id, "psk", "123456789012345678901234567890123456789012345678901234567890123");
|
dev[0].set_network_quoted(id, "psk", "123456789012345678901234567890123456789012345678901234567890123")
|
||||||
if dev[0].get_network(id, "psk") != '*':
|
if dev[0].get_network(id, "psk") != '*':
|
||||||
raise Exception("Unexpected psk read result");
|
raise Exception("Unexpected psk read result")
|
||||||
|
|
||||||
if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' eap UNKNOWN'):
|
if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' eap UNKNOWN'):
|
||||||
raise Exception("Unknown EAP method accepted")
|
raise Exception("Unknown EAP method accepted")
|
||||||
|
|
|
@ -381,7 +381,7 @@ class WpaSupplicant:
|
||||||
if field in params:
|
if field in params:
|
||||||
self.set_cred(id, field, params[field])
|
self.set_cred(id, field, params[field])
|
||||||
|
|
||||||
return id;
|
return id
|
||||||
|
|
||||||
def select_network(self, id, freq=None):
|
def select_network(self, id, freq=None):
|
||||||
if freq:
|
if freq:
|
||||||
|
@ -679,14 +679,14 @@ class WpaSupplicant:
|
||||||
def p2p_go_neg_auth_result(self, timeout=1, expect_failure=False):
|
def p2p_go_neg_auth_result(self, timeout=1, expect_failure=False):
|
||||||
go_neg_res = None
|
go_neg_res = None
|
||||||
ev = self.wait_global_event(["P2P-GO-NEG-SUCCESS",
|
ev = self.wait_global_event(["P2P-GO-NEG-SUCCESS",
|
||||||
"P2P-GO-NEG-FAILURE"], timeout);
|
"P2P-GO-NEG-FAILURE"], timeout)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
if expect_failure:
|
if expect_failure:
|
||||||
return None
|
return None
|
||||||
raise Exception("Group formation timed out")
|
raise Exception("Group formation timed out")
|
||||||
if "P2P-GO-NEG-SUCCESS" in ev:
|
if "P2P-GO-NEG-SUCCESS" in ev:
|
||||||
go_neg_res = ev
|
go_neg_res = ev
|
||||||
ev = self.wait_global_event(["P2P-GROUP-STARTED"], timeout);
|
ev = self.wait_global_event(["P2P-GROUP-STARTED"], timeout)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
if expect_failure:
|
if expect_failure:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue