From a274b1bcbb79aed3f4518f3e1ec544b36b23b0fc Mon Sep 17 00:00:00 2001 From: Andrei Otcheretianski Date: Thu, 7 Apr 2016 13:32:09 +0300 Subject: [PATCH] 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 --- tests/hwsim/test_p2p_device.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/hwsim/test_p2p_device.py b/tests/hwsim/test_p2p_device.py index 575bad214..36a704125 100644 --- a/tests/hwsim/test_p2p_device.py +++ b/tests/hwsim/test_p2p_device.py @@ -476,3 +476,31 @@ def test_p2p_device_persistent_group2_no_group_iface(dev): form(wpas, dev[0]) invite_from_cli(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])