tests: WPS config method update for WPS and P2P

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-09-05 21:58:18 +03:00
parent 1067f49520
commit 926404a6b2
2 changed files with 44 additions and 0 deletions

View file

@ -5309,3 +5309,16 @@ def test_ap_wps_adv_oom(dev, apdev):
with alloc_fail(hapd, 1, "ssdp_listener_start"): with alloc_fail(hapd, 1, "ssdp_listener_start"):
if "FAIL" not in hapd.request("ENABLE"): if "FAIL" not in hapd.request("ENABLE"):
raise Exception("ENABLE succeeded during OOM") raise Exception("ENABLE succeeded during OOM")
def test_wps_config_methods(dev):
"""WPS config method update"""
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add("wlan5")
if "OK" not in wpas.request("SET config_methods display label"):
raise Exception("Failed to set config_methods")
if wpas.request("GET config_methods").strip() != "display label":
raise Exception("config_methods were not updated")
if "OK" not in wpas.request("SET config_methods "):
raise Exception("Failed to clear config_methods")
if wpas.request("GET config_methods").strip() != "":
raise Exception("config_methods were not cleared")

View file

@ -444,3 +444,34 @@ def test_p2p_listen_and_scan(dev):
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 15) ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 15)
if ev is None: if ev is None:
raise Exception("Scan timed out") raise Exception("Scan timed out")
def test_p2p_config_methods(dev):
"""P2P and WPS config method update"""
addr0 = dev[0].p2p_dev_addr()
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add("wlan5")
addr1 = wpas.p2p_dev_addr()
if "OK" not in wpas.request("SET config_methods keypad virtual_push_button"):
raise Exception("Failed to set config_methods")
wpas.p2p_listen()
if not dev[0].discover_peer(addr1):
raise Exception("Device discovery timed out")
dev[0].p2p_stop_find()
peer = dev[0].get_peer(addr1)
if peer['config_methods'] != '0x180':
raise Exception("Unexpected peer config methods(1): " + peer['config_methods'])
dev[0].global_request("P2P_FLUSH")
if "OK" not in wpas.request("SET config_methods virtual_display"):
raise Exception("Failed to set config_methods")
if not dev[0].discover_peer(addr1):
raise Exception("Device discovery timed out")
dev[0].p2p_stop_find()
peer = dev[0].get_peer(addr1)
if peer['config_methods'] != '0x8':
raise Exception("Unexpected peer config methods(2): " + peer['config_methods'])
wpas.p2p_stop_find()