From 7e6ca8a534c351db5ac7e73808e69c8585b72b8a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 5 Mar 2014 22:14:15 +0200 Subject: [PATCH] tests: Extended listen timing in GO Negotiation messages Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_grpform.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/hwsim/test_p2p_grpform.py b/tests/hwsim/test_p2p_grpform.py index 306c3a9a3..9f5b97c1b 100644 --- a/tests/hwsim/test_p2p_grpform.py +++ b/tests/hwsim/test_p2p_grpform.py @@ -237,6 +237,32 @@ def test_grpform_pd(dev): check_grpform_results(i_res, r_res) remove_group(dev[0], dev[1]) +def test_grpform_ext_listen(dev): + """P2P group formation with extended listen timing enabled""" + try: + if "OK" not in dev[0].global_request("P2P_EXT_LISTEN 100 50000"): + raise Exception("Failed to set extended listen timing") + if "OK" not in dev[1].global_request("P2P_EXT_LISTEN 200 40000"): + raise Exception("Failed to set extended listen timing") + [i_res, r_res] = go_neg_pbc(i_dev=dev[0], provdisc=True, r_dev=dev[1], r_listen=True) + check_grpform_results(i_res, r_res) + peer1 = dev[0].get_peer(dev[1].p2p_dev_addr()) + if peer1['ext_listen_interval'] != "40000": + raise Exception("Extended listen interval not discovered correctly") + if peer1['ext_listen_period'] != "200": + raise Exception("Extended listen period not discovered correctly") + peer0 = dev[1].get_peer(dev[0].p2p_dev_addr()) + if peer0['ext_listen_interval'] != "50000": + raise Exception("Extended listen interval not discovered correctly") + if peer0['ext_listen_period'] != "100": + raise Exception("Extended listen period not discovered correctly") + remove_group(dev[0], dev[1]) + finally: + if "OK" not in dev[0].global_request("P2P_EXT_LISTEN"): + raise Exception("Failed to clear extended listen timing") + if "OK" not in dev[1].global_request("P2P_EXT_LISTEN"): + raise Exception("Failed to clear extended listen timing") + def test_both_go_intent_15(dev): """P2P GO Negotiation with both devices using GO intent 15""" go_neg_pin_authorized(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=15, expect_failure=True, i_go_neg_status=9)