tests: Remove extra semicolons from python scripts

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2016-07-03 19:37:50 +03:00
parent 208ebb9d1a
commit bc6e32880f
29 changed files with 124 additions and 124 deletions

View file

@ -346,7 +346,7 @@ def parse_nl80211_attrs(msg):
alen,attr = struct.unpack("@HH", msg[0:4])
if alen < 4:
raise Exception("Too short nl80211 attribute")
alen -= 4;
alen -= 4
msg = msg[4:]
if alen > len(msg):
raise Exception("nl80211 attribute underflow")

View file

@ -121,7 +121,7 @@ def invite(inv, resp, extra=None, persistent_reconnect=True, use_listen=True):
peer = inv.get_peer(addr)
cmd = "P2P_INVITE persistent=" + peer['persistent'] + " peer=" + addr
if extra:
cmd = cmd + " " + extra;
cmd = cmd + " " + extra
inv.global_request(cmd)
def check_result(go, cli):

View file

@ -18,7 +18,7 @@ def execute_thread(command, reply):
cmd = ' '.join(command)
logger.debug("thread run: " + cmd)
try:
status = 0;
status = 0
buf = subprocess.check_output(command, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
status = e.returncode
@ -47,7 +47,7 @@ class Host():
def local_execute(self, command):
logger.debug("execute: " + str(command))
try:
status = 0;
status = 0
buf = subprocess.check_output(command, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
status = e.returncode

View file

@ -196,10 +196,10 @@ def test_ap_ft_pmf(dev, apdev):
passphrase="12345678"
params = ft_params1(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
params["ieee80211w"] = "2"
hapd0 = hostapd.add_ap(apdev[0], params)
params = ft_params2(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
params["ieee80211w"] = "2"
hapd1 = hostapd.add_ap(apdev[1], params)
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase)
@ -351,10 +351,10 @@ def test_ap_ft_pmf_over_ds(dev, apdev):
passphrase="12345678"
params = ft_params1(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
params["ieee80211w"] = "2"
hapd0 = hostapd.add_ap(apdev[0], params)
params = ft_params2(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
params["ieee80211w"] = "2"
hapd1 = hostapd.add_ap(apdev[1], params)
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"
params = ft_params1(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
params["ieee80211w"] = "2"
hapd0 = hostapd.add_ap(apdev[0], params)
params = ft_params2_incorrect_rrb_key(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
params["ieee80211w"] = "2"
hapd1 = hostapd.add_ap(apdev[1], params)
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"
params = ft_params1(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
params["ieee80211w"] = "2"
hapd0 = hostapd.add_ap(apdev[0], params)
params = ft_params2_r0kh_mismatch(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
params["ieee80211w"] = "2"
hapd1 = hostapd.add_ap(apdev[1], params)
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"
params = ft_params1(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "1";
params["ieee80211w"] = "1"
# This is the RSN element used normally by hostapd
params['own_ie_override'] = '30140100000fac040100000fac040100000fac048c00' + '3603a1b201'
hapd = hostapd.add_ap(apdev[0], params)

View file

@ -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"],
timeout=15)
if ev is None:
raise Exception("Network selection timed out");
raise Exception("Network selection timed out")
if no_match:
if "INTERWORKING-NO-MATCH" not in ev:
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"],
timeout=15)
if ev is None:
raise Exception("Network selection timed out");
raise Exception("Network selection timed out")
if "INTERWORKING-NO-MATCH" in ev:
raise Exception("Matching network not found")
if bssid and bssid not in ev:
@ -420,7 +420,7 @@ def test_ap_hs20_select(dev, apdev):
'domain': "no.match.example.com" })
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")
res = dev[0].request("SCAN_RESULTS")
@ -1639,7 +1639,7 @@ def check_conn_capab_selection(dev, type, missing):
dev.request("INTERWORKING_SELECT freq=2412")
ev = dev.wait_event(["INTERWORKING-AP"])
if ev is None:
raise Exception("Network selection timed out");
raise Exception("Network selection timed out")
if "type=" + type not in ev:
raise Exception("Unexpected network type")
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):
ev = dev[0].wait_event(["INTERWORKING-AP"])
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:
raise Exception("Missing protocol connection capability not reported")
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")
ev = dev.wait_event(["INTERWORKING-AP"])
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"))
if "type=" + type not in ev:
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"],
timeout=15)
if ev is None:
raise Exception("Network selection timed out");
raise Exception("Network selection timed out")
dev[0].dump_monitor()
if "OK" not in dev[0].request("FETCH_OSU"):

View file

@ -19,8 +19,8 @@ def test_ap_pmf_required(dev, apdev):
"""WPA2-PSK AP with PMF required"""
ssid = "test-pmf-required"
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
params["ieee80211w"] = "2"
hapd = hostapd.add_ap(apdev[0], params)
Wlantest.setup(hapd)
wt = Wlantest()
@ -57,8 +57,8 @@ def test_ap_pmf_optional(dev, apdev):
"""WPA2-PSK AP with PMF optional"""
ssid = "test-pmf-optional"
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK";
params["ieee80211w"] = "1";
params["wpa_key_mgmt"] = "WPA-PSK"
params["ieee80211w"] = "1"
hapd = hostapd.add_ap(apdev[0], params)
Wlantest.setup(hapd)
wt = Wlantest()
@ -81,8 +81,8 @@ def test_ap_pmf_optional_2akm(dev, apdev):
"""WPA2-PSK AP with PMF optional (2 AKMs)"""
ssid = "test-pmf-optional-2akm"
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK WPA-PSK-SHA256";
params["ieee80211w"] = "1";
params["wpa_key_mgmt"] = "WPA-PSK WPA-PSK-SHA256"
params["ieee80211w"] = "1"
hapd = hostapd.add_ap(apdev[0], params)
Wlantest.setup(hapd)
wt = Wlantest()
@ -133,8 +133,8 @@ def test_ap_pmf_assoc_comeback(dev, apdev):
"""WPA2-PSK AP with PMF association comeback"""
ssid = "assoc-comeback"
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
params["ieee80211w"] = "2"
hapd = hostapd.add_ap(apdev[0], params)
Wlantest.setup(hapd)
wt = Wlantest()
@ -158,8 +158,8 @@ def test_ap_pmf_assoc_comeback2(dev, apdev):
"""WPA2-PSK AP with PMF association comeback (using DROP_SA)"""
ssid = "assoc-comeback"
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK";
params["ieee80211w"] = "1";
params["wpa_key_mgmt"] = "WPA-PSK"
params["ieee80211w"] = "1"
hapd = hostapd.add_ap(apdev[0], params)
Wlantest.setup(hapd)
wt = Wlantest()
@ -330,8 +330,8 @@ def test_ap_pmf_required_eap(dev, apdev):
"""WPA2-EAP AP with PMF required"""
ssid = "test-pmf-required-eap"
params = hostapd.wpa2_eap_params(ssid=ssid)
params["wpa_key_mgmt"] = "WPA-EAP-SHA256";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-EAP-SHA256"
params["ieee80211w"] = "2"
hapd = hostapd.add_ap(apdev[0], params)
key_mgmt = hapd.get_config()['key_mgmt']
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):
"""WPA2EAP AP with PMF optional"""
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
params["ieee80211w"] = "1";
params["ieee80211w"] = "1"
hapd = hostapd.add_ap(apdev[0], params)
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="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"""
ssid = "test-pmf-required-sha1"
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-PSK"
params["ieee80211w"] = "2"
hapd = hostapd.add_ap(apdev[0], params)
Wlantest.setup(hapd)
wt = Wlantest()
@ -393,8 +393,8 @@ def test_ap_pmf_toggle(dev, apdev):
def _test_ap_pmf_toggle(dev, apdev):
ssid = "test-pmf-optional"
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK";
params["ieee80211w"] = "1";
params["wpa_key_mgmt"] = "WPA-PSK"
params["ieee80211w"] = "1"
params["assoc_sa_query_max_timeout"] = "1"
params["assoc_sa_query_retry_timeout"] = "1"
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"""
ssid = "test-pmf-required"
params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
params["ieee80211w"] = "2"
hapd = hostapd.add_ap(apdev[0], params)
# Disable PMF on the station and try to connect

View file

@ -1755,7 +1755,7 @@ def get_key_locations(buf, key, keyname):
if pos < 0:
break
logger.info("Found %s at %d" % (keyname, pos))
context = 128;
context = 128
start = pos - context if pos > context else 0
before = binascii.hexlify(buf[start:pos])
context += len(key)

View file

@ -88,7 +88,7 @@ def test_ap_roam_wpa2_psk_failed(dev, apdev, params):
ev = dev[0].wait_event(["CTRL-EVENT-SSID-REENABLED"], 3)
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)
hwsim_utils.test_connectivity(dev[0], hapd0)

View file

@ -88,7 +88,7 @@ def tdls_check_dl(sta0, sta1, bssid, addr0, addr1):
def tdls_check_ap(sta0, sta1, bssid, addr0, addr1):
wt = Wlantest()
wt.tdls_clear(bssid, addr0, addr1);
wt.tdls_clear(bssid, addr0, addr1)
hwsim_utils.test_connectivity_sta(sta0, sta1)
[dl,inv_dl,ap,inv_ap] = wlantest_tdls_packet_counters(bssid, addr0, addr1)
if dl > 0:
@ -112,8 +112,8 @@ def setup_tdls(sta0, sta1, hapd, reverse=False, expect_fail=False):
addr0 = sta0.p2p_interface_addr()
addr1 = sta1.p2p_interface_addr()
wt = Wlantest()
wt.tdls_clear(bssid, addr0, addr1);
wt.tdls_clear(bssid, addr1, addr0);
wt.tdls_clear(bssid, addr0, addr1)
wt.tdls_clear(bssid, addr1, addr0)
sta0.tdls_setup(addr1)
time.sleep(1)
if expect_fail:
@ -122,7 +122,7 @@ def setup_tdls(sta0, sta1, hapd, reverse=False, expect_fail=False):
if reverse:
addr1 = sta0.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:
raise Exception("No TDLS Setup Confirm (success) seen")
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)
time.sleep(1)
wt = Wlantest()
teardown = wt.get_tdls_counter("teardown", bssid, addr0, addr1);
teardown = wt.get_tdls_counter("teardown", bssid, addr0, addr1)
if teardown == 0:
raise Exception("No TDLS Setup Teardown seen")
tdls_check_ap(sta0, sta1, bssid, addr0, addr1)

View file

@ -57,8 +57,8 @@ def test_ap_vlan_wpa2(dev, apdev):
"""AP VLAN with WPA2-PSK"""
params = hostapd.wpa2_params(ssid="test-vlan",
passphrase="12345678")
params['dynamic_vlan'] = "1";
params['accept_mac_file'] = "hostapd.accept";
params['dynamic_vlan'] = "1"
params['accept_mac_file'] = "hostapd.accept"
hapd = hostapd.add_ap(apdev[0], params)
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):
"""AP VLAN with WPA2-Enterprise and RADIUS attributes"""
params = hostapd.wpa2_eap_params(ssid="test-vlan")
params['dynamic_vlan'] = "1";
params['dynamic_vlan'] = "1"
hapd = hostapd.add_ap(apdev[0], params)
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):
"""AP VLAN with WPA2-Enterprise and RADIUS EGRESS_VLANID attributes"""
params = hostapd.wpa2_eap_params(ssid="test-vlan")
params['dynamic_vlan'] = "1";
params['dynamic_vlan'] = "1"
hapd = hostapd.add_ap(apdev[0], params)
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)
params = hostapd.wpa2_eap_params(ssid="test-vlan")
params['dynamic_vlan'] = "1";
params['dynamic_vlan'] = "1"
params['auth_server_port'] = "18128"
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):
"""AP VLAN with WPA2-Enterprise and RADIUS attributes required"""
params = hostapd.wpa2_eap_params(ssid="test-vlan")
params['dynamic_vlan'] = "2";
params['dynamic_vlan'] = "2"
hostapd.add_ap(apdev[0], params)
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
params = hostapd.wpa2_params(ssid="test-vlan",
passphrase="12345678x")
params['dynamic_vlan'] = "1";
params['dynamic_vlan'] = "1"
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)
# inject some traffic
@ -614,8 +614,8 @@ def test_ap_vlan_reconnect(dev, apdev):
"""AP VLAN with WPA2-PSK connect, disconnect, connect"""
params = hostapd.wpa2_params(ssid="test-vlan",
passphrase="12345678")
params['dynamic_vlan'] = "1";
params['accept_mac_file'] = "hostapd.accept";
params['dynamic_vlan'] = "1"
params['accept_mac_file'] = "hostapd.accept"
hapd = hostapd.add_ap(apdev[0], params)
logger.info("connect sta")

View file

@ -2477,7 +2477,7 @@ def test_ap_wps_ssdp_msearch(dev, apdev):
ssdp_send_msearch("upnp:rootdevice")
ssdp_send_msearch("uuid:" + ap_uuid)
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([
'M-SEARCH * HTTP/1.1',

View file

@ -419,13 +419,13 @@ def _test_dbus_get_set_wps(dev, apdev):
dbus_interface=dbus.PROPERTIES_IFACE)
if if_obj.Get(WPAS_DBUS_IFACE_WPS, "ProcessCredentials",
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",
dbus.Boolean(0),
dbus_interface=dbus.PROPERTIES_IFACE)
if if_obj.Get(WPAS_DBUS_IFACE_WPS, "ProcessCredentials",
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
return False
@ -4190,7 +4190,7 @@ def test_dbus_p2p_go_neg_auth(dev, apdev):
if not dev1.discover_peer(addr0):
raise Exception("Peer not found")
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:
raise Exception("Group formation timed out")
self.sta_group_ev = ev
@ -4279,7 +4279,7 @@ def test_dbus_p2p_go_neg_init(dev, apdev):
if ev is None:
raise Exception("Timeout while waiting for GO Neg Request")
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:
raise Exception("Group formation timed out")
self.sta_group_ev = ev
@ -4369,7 +4369,7 @@ def test_dbus_p2p_group_termination_by_go(dev, apdev):
if ev is None:
raise Exception("Timeout while waiting for GO Neg Request")
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:
raise Exception("Group formation timed out")
self.sta_group_ev = ev
@ -4465,7 +4465,7 @@ def _test_dbus_p2p_group_idle_timeout(dev, apdev):
if ev is None:
raise Exception("Timeout while waiting for GO Neg Request")
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:
raise Exception("Group formation timed out")
self.sta_group_ev = ev
@ -4700,7 +4700,7 @@ def test_dbus_p2p_two_groups(dev, apdev):
dev2 = WpaSupplicant('wlan2', '/tmp/wpas-wlan2')
dev2.scan_for_bss(bssid, 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:
raise Exception("Group join timed out")
self.dev2_group_ev = ev

View file

@ -113,18 +113,18 @@ def test_dfs(dev, apdev):
if ev is None:
raise Exception("DFS-RADAR-DETECTED event not reported")
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)
if ev is None:
raise Exception("DFS-NEW-CHANNEL event not reported")
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)
if ev is None:
raise Exception("AP-CSA-FINISHED event not reported")
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)
hwsim_utils.test_connectivity(dev[0], hapd)
finally:

View file

@ -147,7 +147,7 @@ class FstLauncher:
self.nof_aps -= 1
else:
self.nof_stas -= 1
config_file = self.get_cfg_pathname(cfg);
config_file = self.get_cfg_pathname(cfg)
if os.path.exists(config_file):
os.remove(config_file)

View 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):
"""FST disconnect FST STA"""
ap1, ap2, fst_sta1, fst_sta2 = fst_module_aux.start_two_ap_sta_pairs(apdev)
external_sta_connected = False;
external_sta_connected = False
try:
vals = fst_sta1.scan(freq=fst_test_common.fst_test_def_freq_a)
fst_sta1.connect(ap1, key_mgmt="NONE",

View file

@ -203,8 +203,8 @@ def test_mbo_cell_capa_update_pmf(dev, apdev):
ssid = "test-wnm-mbo"
passphrase = "12345678"
params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
params["ieee80211w"] = "2"
params['mbo'] = '1'
hapd = hostapd.add_ap(apdev[0], params)
bssid = apdev[0]['bssid']

View file

@ -255,28 +255,28 @@ def test_autogo_tdls(dev):
dev[1].tdls_setup(addr2)
time.sleep(1)
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:
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:
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)
time.sleep(1)
teardown = wt.get_tdls_counter("teardown", bssid, addr1, addr2);
teardown = wt.get_tdls_counter("teardown", bssid, addr1, addr2)
if teardown == 0:
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])
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:
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:
raise Exception("Unexpected frames through direct link")
idirect_link = wt.get_tdls_counter("invalid_direct_link", bssid, addr1,
addr2);
addr2)
if idirect_link > 0:
raise Exception("Unexpected frames through direct link (invalid)")
dev[2].remove_group()

View file

@ -235,7 +235,7 @@ def test_go_neg_with_bss_connected(dev, apdev):
if dev[0].get_mcc() > 1:
logger.info("Skip as-client case due to MCC being enabled")
return;
return
#dev[0] as client
[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',
"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",
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',
"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",
scan_freq="2462")
@ -1010,7 +1010,7 @@ def test_p2p_delay_go_csa(dev, apdev, params):
addr1 = dev[1].p2p_dev_addr()
try:
dev[1].p2p_listen();
dev[1].p2p_listen()
if not wpas.discover_peer(addr1, social=True):
raise Exception("Peer " + addr1 + " not found")
wpas.p2p_stop_find()
@ -1048,7 +1048,7 @@ def test_p2p_delay_go_csa(dev, apdev, params):
pin = dev[1].wps_read_pin()
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
wpas.group_request("SET p2p_go_csa_on_inv 1")

View file

@ -999,7 +999,7 @@ def test_p2p_msg_invitation_resp(dev, apdev):
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'])))
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:
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'])))
ev = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
if ev is None:
raise Exception("Timeout on invitation result");
raise Exception("Timeout on invitation result")
if "status=7" not in 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")
rx_msg = dev[1].mgmt_rx()
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'])))
ev = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
if ev is None:
raise Exception("Timeout on invitation result");
raise Exception("Timeout on invitation result")
if "status=0" not in 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:
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:
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"):
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")
rx_msg = dev[1].mgmt_rx()
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)
if ev is None:
raise Exception("Timeout on invitation result");
raise Exception("Timeout on invitation result")
if "status=0" not in ev:
raise Exception("Unexpected invitation result: " + ev)
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)
if ev is None:
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:
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:
raise Exception("Group formation not succeed")

View file

@ -392,13 +392,13 @@ def test_persistent_group_without_persistent_reconnect(dev):
ev = dev[0].wait_global_event(["P2P-INVITATION-RECEIVED"], timeout=15)
if ev is None:
raise Exception("No invitation request reported");
raise Exception("No invitation request reported")
if "persistent=" not in ev:
raise Exception("Invalid invitation type reported: " + ev)
ev2 = dev[1].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
if ev2 is None:
raise Exception("No invitation response reported");
raise Exception("No invitation response reported")
if "status=1" not in ev2:
raise Exception("Unexpected status: " + ev2)
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)
if ev is None:
raise Exception("No invitation request reported");
raise Exception("No invitation request reported")
if "persistent=" not in ev:
raise Exception("Invalid invitation type reported: " + ev)
ev2 = dev[0].wait_global_event(["P2P-INVITATION-RESULT"], timeout=15)
if ev2 is None:
raise Exception("No invitation response reported");
raise Exception("No invitation response reported")
if "status=1" not in ev2:
raise Exception("Unexpected status: " + ev2)
dev[0].p2p_listen()

View file

@ -1119,7 +1119,7 @@ def test_p2ps_channel_one_connected(dev, apdev):
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")
freq = dev[0].get_group_status_field('freq');
freq = dev[0].get_group_status_field('freq')
if freq != '2442':
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] ]
(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':
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,
handler=disconnect_handler)
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':
raise Exception('Unexpected frequency for group 2457 != ' + freq)
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")
(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':
raise Exception('Unexpected frequency for group =' + freq)
@ -1252,7 +1252,7 @@ def test_p2ps_channel_disallow_freq(dev, apdev):
handler=clear_disallow_handler)
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':
raise Exception('Unexpected frequency for group 2412 != ' + freq)
finally:
@ -1287,7 +1287,7 @@ def test_p2ps_channel_sta_connected_disallow_freq(dev, apdev):
handler=clear_disallow_handler)
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':
raise Exception('Unexpected frequency for group 2437 != ' + freq)
finally:
@ -1317,7 +1317,7 @@ def test_p2ps_channel_sta_connected_disallow_freq_mcc(dev, apdev):
tmpdev = [ dev[0], wpas ]
(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':
raise Exception('Unexpected frequency=2437')
finally:
@ -1458,7 +1458,7 @@ def test_p2ps_channel_active_go_and_station_different(dev, apdev):
handler=disconnect_handler, adv_role='2',
seeker_role='4')
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':
raise Exception('Unexpected frequency for group 2462!=' + freq)
finally:

View file

@ -70,9 +70,9 @@ def test_ext_radio_work(dev, apdev):
if ev is None:
raise Exception("Timeout while waiting radio work to start")
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"):
raise Exception("Invalid RADIO_WORK accepted");
raise Exception("Invalid RADIO_WORK accepted")
dev[0].request("FLUSH")
items = dev[0].request("RADIO_WORK show")
if items != "":

View file

@ -854,7 +854,7 @@ def test_scan_specify_ssid(dev, apdev):
if bss is None:
raise Exception("BSS entry for hidden AP not found")
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()
dev[0].flush_scan_cache(freq=2432)

View file

@ -23,7 +23,7 @@ def check_suite_b_capa(dev):
def check_suite_b_tls_lib(dev):
tls = dev[0].request("GET tls_library")
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
for ver in [ '1.0.2', '1.1.0' ]:
if "build=OpenSSL " + ver in tls and "run=OpenSSL " + ver in tls:

View file

@ -180,8 +180,8 @@ def test_wext_pmf(dev, apdev):
wpas = get_wext_interface()
params = hostapd.wpa2_params(ssid="wext-wpa2-psk", passphrase="12345678")
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
params["ieee80211w"] = "2"
hapd = hostapd.add_ap(apdev[0], params)
wpas.connect("wext-wpa2-psk", psk="12345678", ieee80211w="1",

View file

@ -39,6 +39,6 @@ def test_wmediumd_simple(dev, apdev):
p.terminate()
p.wait()
# test that releasing hwsim works correctly
_test_ap_open(dev, apdev);
_test_ap_open(dev, apdev)
finally:
os.unlink(fn)

View file

@ -78,8 +78,8 @@ def test_wnm_ess_disassoc_imminent(dev, apdev):
def test_wnm_ess_disassoc_imminent_pmf(dev, apdev):
"""WNM ESS Disassociation Imminent"""
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
params["ieee80211w"] = "2"
params["bss_transition"] = "1"
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):
"""WNM Sleep Mode - RSN with PMF"""
params = hostapd.wpa2_params("test-wnm-rsn", "12345678")
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
params["ieee80211w"] = "2";
params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
params["ieee80211w"] = "2"
params["time_advertisement"] = "2"
params["time_zone"] = "EST5"
params["wnm_sleep_mode"] = "1"
@ -565,7 +565,7 @@ def test_wnm_bss_tm(dev, apdev):
raise Exception("Unexpected scan started")
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=0.5)
if ev is not None:
raise Exception("Unexpected reassociation");
raise Exception("Unexpected reassociation")
finally:
dev[0].request("DISCONNECT")
if hapd:

View file

@ -189,10 +189,10 @@ def test_wpas_ctrl_network(dev):
raise Exception("Too short PSK accepted")
if "FAIL" not in dev[0].request('SET_NETWORK ' + str(id) + ' psk "1234567890123456789012345678901234567890123456789012345678901234"'):
raise Exception("Too long PSK accepted")
dev[0].set_network_quoted(id, "psk", "123456768");
dev[0].set_network_quoted(id, "psk", "123456789012345678901234567890123456789012345678901234567890123");
dev[0].set_network_quoted(id, "psk", "123456768")
dev[0].set_network_quoted(id, "psk", "123456789012345678901234567890123456789012345678901234567890123")
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'):
raise Exception("Unknown EAP method accepted")

View file

@ -381,7 +381,7 @@ class WpaSupplicant:
if field in params:
self.set_cred(id, field, params[field])
return id;
return id
def select_network(self, id, freq=None):
if freq:
@ -679,14 +679,14 @@ class WpaSupplicant:
def p2p_go_neg_auth_result(self, timeout=1, expect_failure=False):
go_neg_res = None
ev = self.wait_global_event(["P2P-GO-NEG-SUCCESS",
"P2P-GO-NEG-FAILURE"], timeout);
"P2P-GO-NEG-FAILURE"], timeout)
if ev is None:
if expect_failure:
return None
raise Exception("Group formation timed out")
if "P2P-GO-NEG-SUCCESS" in 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 expect_failure:
return None