tests: Test configuration propagation to group interface

When a dedicated P2P Device interface is used, its configuration should
be cloned to the group interface. Add a test that covers this both when
a separate group interface is used and not.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Andrei Otcheretianski 2016-04-07 13:32:09 +03:00 committed by Jouni Malinen
parent 9b377be037
commit a274b1bcbb

View file

@ -476,3 +476,31 @@ def test_p2p_device_persistent_group2_no_group_iface(dev):
form(wpas, dev[0]) form(wpas, dev[0])
invite_from_cli(wpas, dev[0]) invite_from_cli(wpas, dev[0])
invite_from_go(wpas, dev[0]) invite_from_go(wpas, dev[0])
def p2p_device_group_conf(dev1, dev2):
dev1.global_request("SET p2p_group_idle 12")
dev1.global_request("SET p2p_go_freq_change_policy 2")
dev1.global_request("SET p2p_go_ctwindow 7")
[i_res, r_res] = go_neg_pin_authorized(i_dev=dev1, i_intent=15,
r_dev=dev2, r_intent=0)
check_grpform_results(i_res, r_res)
if (dev1.group_request("GET p2p_group_idle") != "12" or
dev1.group_request("GET p2p_go_freq_change_policy") != "2" or
dev1.group_request("GET p2p_go_ctwindow") != "7"):
raise Exception("Unexpected configuration value")
remove_group(dev1, dev2)
dev1.global_request("P2P_FLUSH")
dev2.global_request("P2P_FLUSH")
def test_p2p_device_conf(dev, apdev):
"""P2P configuration with cfg80211 P2P Device"""
with HWSimRadio(use_p2p_device=True) as (radio, iface):
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add(iface)
wpas.global_request("SET p2p_no_group_iface 1")
p2p_device_group_conf(wpas, dev[0])
wpas.global_request("SET p2p_no_group_iface 0")
p2p_device_group_conf(wpas, dev[0])