"rsn_pairwise": "CCMP",
"wpa_pairwise": "TKIP" }
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].connect(ssid, psk=passphrase, proto="WPA2",
pairwise="CCMP", group="TKIP", scan_freq="2412")
status = dev[0].get_status()
def test_ap_bss_add_remove(dev, apdev):
"""Dynamic BSS add/remove operations with hostapd"""
- for d in dev:
- d.request("SET ignore_old_scan_res 1")
ifname1 = apdev[0]['ifname']
ifname2 = apdev[0]['ifname'] + '-2'
ifname3 = apdev[0]['ifname'] + '-3'
def test_ap_bss_add_remove_during_ht_scan(dev, apdev):
"""Dynamic BSS add during HT40 co-ex scan"""
- for d in dev:
- d.request("SET ignore_old_scan_res 1")
ifname1 = apdev[0]['ifname']
ifname2 = apdev[0]['ifname'] + '-2'
hostapd.add_bss('phy3', ifname1, 'bss-ht40-1.conf')
def test_ap_multi_bss_config(dev, apdev):
"""hostapd start with a multi-BSS configuration file"""
- for d in dev:
- d.request("SET ignore_old_scan_res 1")
ifname1 = apdev[0]['ifname']
ifname2 = apdev[0]['ifname'] + '-2'
ifname3 = apdev[0]['ifname'] + '-3'
params['nai_realm'] = [ "0,example.com,13[5:6],21[2:4][5:7]" ]
hostapd.add_ap(apdev[1]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com", 'username': "test",
'password': "secret",
del params['venue_type']
hostapd.add_ap(apdev[1]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
wt = Wlantest()
params['hessid'] = bssid
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com", 'username': "test",
'password': "secret",
params['domain_name'] = "wlan.mnc444.mcc555.3gppnetwork.org"
hostapd.add_ap(ap['ifname'], params)
- dev.request("SET ignore_old_scan_res 1")
dev.hs20_enable()
dev.add_cred_values({ 'imsi': "555444-333222111", 'eap': method,
'milenage': "5122250214c33e723a5dd523fc145fc0:981d464c7c52eb6e5036234984ad0bcf:000000000123"})
params['domain_name'] = "wlan.mnc001.mcc232.3gppnetwork.org"
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
dev[0].request("SET external_sim 1")
dev[0].add_cred_values({ 'imsi': "23201-0000000000", 'eap': "SIM" })
params['domain_name'] = "wlan.mnc091.mcc244.3gppnetwork.org"
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
dev[0].request("SET external_sim 1")
dev[0].add_cred_values({ 'imsi': "23201-0000000000", 'eap': "SIM" })
params['hessid'] = bssid
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com",
'username': "hs20-test",
params['nai_realm'] = [ "0,example.com," + eap_params ]
hostapd.add_ap(ap['ifname'], params)
- dev.request("SET ignore_old_scan_res 1")
dev.hs20_enable()
dev.add_cred_values({ 'realm': "example.com",
'username': user,
params['nai_realm'] = [ "0,example.com,13[5:6]" ]
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
dev[0].add_cred_values({ 'realm': "example.com",
'username': "certificate-user",
params['nai_realm'] = [ "0,no.match.here;example.com;no.match.here.either,21[2:1][5:7]" ]
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com",
'username': "pap user",
params['hessid'] = bssid
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com",
'username': "user",
params['hessid'] = bssid
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "roaming.example.com",
'username': "hs20-test",
params['hessid'] = bssid
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com",
'username': "hs20-test",
del params['domain_name']
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com",
'username': "hs20-test",
params['hessid'] = bssid
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com",
'username': "hs20-test",
hapd = hostapd.Hostapd(apdev[0]['ifname'])
hapd.set("gas_frag_limit", "50")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
id = dev[0].add_cred_values({ 'realm': "example.com",
'username': "hs20-test",
params['hessid'] = bssid
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
values = { 'realm': "example.com",
'username': "hs20-test",
params['hessid'] = bssid
hostapd.add_ap(apdev[0]['ifname'], params)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].hs20_enable()
values = { 'realm': "example.com",
'username': "hs20-test",
dev.dump_monitor()
logger.info("Verify network selection to AP " + ap['ifname'])
bssid = ap['bssid']
- dev.request("SET ignore_old_scan_res 1")
dev.hs20_enable()
id = dev.add_cred_values(values)
dev.request("INTERWORKING_SELECT auto")
hapd.request("WPS_PBC")
if "PBC Status: Active" not in hapd.request("WPS_GET_STATUS"):
raise Exception("PBC status not shown correctly")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[0].request("WPS_PBC")
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
hapd = hostapd.Hostapd(apdev[0]['ifname'])
logger.info("WPS provisioning step")
hapd.request("WPS_PBC")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].scan(freq="2412")
bss = dev[0].get_bss(apdev[0]['bssid'])
if "[WPS-PBC]" not in bss['flags']:
if ev is None:
raise Exception("Association with the AP timed out")
- dev[1].request("SET ignore_old_scan_res 1")
dev[1].scan(freq="2412")
bss = dev[1].get_bss(apdev[0]['bssid'])
if "[WPS-PBC]" in bss['flags']:
logger.info("WPS provisioning step")
pin = dev[0].wps_read_pin()
hapd.request("WPS_PIN any " + pin)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].scan(freq="2412")
bss = dev[0].get_bss(apdev[0]['bssid'])
if "[WPS-AUTH]" not in bss['flags']:
if ev is None:
raise Exception("Association with the AP timed out")
- dev[1].request("SET ignore_old_scan_res 1")
dev[1].scan(freq="2412")
bss = dev[1].get_bss(apdev[0]['bssid'])
if "[WPS-AUTH]" in bss['flags']:
hapd = hostapd.Hostapd(apdev[0]['ifname'])
logger.info("WPS provisioning step")
hapd.request("WPS_PBC")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[0].request("WPS_PBC")
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
logger.info("WPS provisioning attempt 1")
hapd.request("WPS_PIN any 12345670")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[0].request("WPS_PIN any 55554444")
ev = dev[0].wait_event(["WPS-FAIL"], timeout=30)
logger.info("WPS provisioning step")
pin = dev[0].wps_read_pin()
hapd.request("WPS_PIN any " + pin)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[0].request("WPS_PIN any " + pin)
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
if status['key_mgmt'] != 'WPA2-PSK':
raise Exception("Unexpected key_mgmt")
- dev[1].request("SET ignore_old_scan_res 1")
dev[1].scan(freq="2412")
bss = dev[1].get_bss(apdev[0]['bssid'])
if "[WPS-AUTH]" in bss['flags']:
pin2 = "55554444"
hapd.request("WPS_PIN " + dev[0].get_status_field("uuid") + " " + pin)
hapd.request("WPS_PIN " + dev[1].get_status_field("uuid") + " " + pin)
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
- dev[1].request("SET ignore_old_scan_res 1")
dev[1].dump_monitor()
dev[0].request("WPS_PIN any " + pin)
dev[1].request("WPS_PIN any " + pin)
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
"ap_pin": appin})
logger.info("WPS provisioning step")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[0].wps_reg(apdev[0]['bssid'], appin)
status = dev[0].get_status()
if appin not in hapd.request("WPS_AP_PIN get"):
raise Exception("Could not fetch current AP PIN")
logger.info("WPS provisioning step")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].wps_reg(apdev[0]['bssid'], appin)
hapd.request("WPS_AP_PIN disable")
logger.info("WPS provisioning step with AP PIN disabled")
- dev[1].request("SET ignore_old_scan_res 1")
check_wps_reg_failure(dev[1], apdev[0], appin)
logger.info("WPS provisioning step with AP PIN reset")
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
"ap_pin": appin})
logger.info("WPS configuration step")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
new_ssid = "wps-new-ssid"
new_passphrase = "1234567890"
{ "ssid": ssid, "eap_server": "1", "wps_state": "1",
"ap_pin": appin})
logger.info("WPS configuration step")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].request("SET wps_version_number 0x10")
dev[0].dump_monitor()
new_ssid = "wps-new-ssid-with-tkip"
"wpa_passphrase": "12345678", "wpa": "2",
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
"ap_pin": appin})
- dev[0].request("SET ignore_old_scan_res 1")
new_ssid = "wps-new-ssid-test"
new_passphrase = "1234567890"
hapd = hostapd.Hostapd(apdev[0]['ifname'])
logger.info("WPS provisioning step")
hapd.request("WPS_PBC")
- dev[0].request("SET ignore_old_scan_res 1")
- dev[1].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[1].dump_monitor()
dev[0].request("WPS_PBC")
logger.info("Verify PBC enable/cancel")
hapd.request("WPS_PBC")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].scan(freq="2412")
bss = dev[0].get_bss(apdev[0]['bssid'])
if "[WPS-PBC]" not in bss['flags']:
logger.info("WPS configuration step")
new_passphrase = "1234567890"
dev[0].dump_monitor()
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].wps_reg(apdev[0]['bssid'], ap_pin, ssid, "WPA2PSK", "CCMP",
new_passphrase)
status = dev[0].get_status()
pin = dev[1].wps_read_pin()
dev[0].dump_monitor()
dev[0].request("WPS_ER_PIN any " + pin + " " + dev[1].p2p_interface_addr())
- dev[1].request("SET ignore_old_scan_res 1")
dev[1].dump_monitor()
dev[1].request("WPS_PIN any " + pin)
ev = dev[1].wait_event(["WPS-SUCCESS"], timeout=30)
"ap_pin": ap_pin, "uuid": ap_uuid, "upnp_iface": "lo"})
logger.info("Learn AP configuration")
dev[0].dump_monitor()
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].wps_reg(apdev[0]['bssid'], ap_pin)
status = dev[0].get_status()
if status['wpa_state'] != 'COMPLETED' or status['bssid'] != apdev[0]['bssid']:
logger.info("Add Enrollee using ER and PBC")
dev[0].dump_monitor()
enrollee = dev[1].p2p_interface_addr()
- dev[1].request("SET ignore_old_scan_res 1")
dev[1].dump_monitor()
dev[1].request("WPS_PBC")
hapd = hostapd.Hostapd(apdev[0]['ifname'])
logger.info("WPS provisioning step")
hapd.request("WPS_PBC")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[0].request("SET wps_fragment_size 50")
dev[0].request("WPS_PBC")
hapd = hostapd.Hostapd(apdev[0]['ifname'])
logger.info("WPS provisioning step")
hapd.request("WPS_PBC")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[0].request("SET wps_version_number 0x43")
dev[0].request("WPS_PBC")
if "FAIL" in hapd.request("SET wps_version_number 0x43"):
raise Exception("Failed to enable test functionality")
hapd.request("WPS_PBC")
- dev[0].request("SET ignore_old_scan_res 1")
dev[0].dump_monitor()
dev[0].request("WPS_PBC")
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
def test_nfc_wps_password_token_sta(dev, apdev):
"""NFC tag with password token on the station/Enrollee"""
- dev[0].request("SET ignore_old_scan_res 1")
ssid = "test-wps-nfc-pw-token-conf"
params = ap_wps_params(ssid)
hostapd.add_ap(apdev[0]['ifname'], params)
def test_nfc_wps_config_token_init(dev, apdev):
"""NFC tag with configuration token from AP with auto configuration"""
- dev[0].request("SET ignore_old_scan_res 1")
ssid = "test-wps-nfc-conf-token-init"
hostapd.add_ap(apdev[0]['ifname'],
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
def test_nfc_wps_password_token_sta_init(dev, apdev):
"""Initial AP configuration with first WPS NFC Enrollee"""
- dev[0].request("SET ignore_old_scan_res 1")
ssid = "test-wps-nfc-pw-token-init"
hostapd.add_ap(apdev[0]['ifname'],
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
def test_nfc_wps_password_token_ap(dev, apdev):
"""WPS registrar configuring an AP using AP password token"""
- dev[0].request("SET ignore_old_scan_res 1")
ssid = "test-wps-nfc-pw-token-init"
hostapd.add_ap(apdev[0]['ifname'],
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
logger.info("Connect legacy WPS client")
pin = dev[2].wps_read_pin()
dev[0].p2p_go_authorize_client(pin)
- dev[2].request("SET ignore_old_scan_res 1")
dev[2].request("P2P_SET disabled 1")
dev[2].dump_monitor()
dev[2].request("WPS_PIN any " + pin)
def test_grpform_pbc(dev):
"""P2P group formation using PBC and re-init GO Negotiation"""
- dev[0].request("SET ignore_old_scan_res 1")
- dev[1].request("SET ignore_old_scan_res 1")
[i_res, r_res] = go_neg_pbc(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0)
check_grpform_results(i_res, r_res)
if i_res['role'] != 'GO' or r_res['role'] != 'client':
res = self.request("FLUSH")
if not "OK" in res:
logger.info("FLUSH to " + self.ifname + " failed: " + res)
- self.request("SET ignore_old_scan_res 0")
self.request("SET external_sim 0")
self.request("SET hessid 00:00:00:00:00:00")
self.request("SET access_network_type 15")