From 84d746c8ddd7d139c9548731bc8ae990f4eb4da2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 27 May 2014 12:26:21 +0300 Subject: [PATCH] tests: P2P persistent group during concurrent operation Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_concurrency.py | 19 +++++++++++++++++++ tests/hwsim/test_p2p_persistent.py | 6 ++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_p2p_concurrency.py b/tests/hwsim/test_p2p_concurrency.py index 7689b15b5..365ed1201 100644 --- a/tests/hwsim/test_p2p_concurrency.py +++ b/tests/hwsim/test_p2p_concurrency.py @@ -14,6 +14,9 @@ from test_p2p_grpform import go_neg_pin_authorized from test_p2p_grpform import go_neg_pbc from test_p2p_grpform import check_grpform_results from test_p2p_grpform import remove_group +from test_p2p_persistent import form +from test_p2p_persistent import invite_from_cli +from test_p2p_persistent import invite_from_go def test_concurrent_autogo(dev, apdev): """Concurrent P2P autonomous GO""" @@ -145,3 +148,19 @@ def test_concurrent_grpform_while_connecting3(dev, apdev): logger.info("Confirm AP connection after P2P group removal") dev[0].wait_completed() hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) + +def test_concurrent_persistent_group(dev, apdev): + """Concurrent P2P persistent group""" + logger.info("Connect to an infrastructure AP") + hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-open", "channel": "2" }) + dev[0].request("SET p2p_no_group_iface 0") + dev[0].connect("test-open", key_mgmt="NONE", scan_freq="2417") + + logger.info("Run persistent group test while associated to an AP") + form(dev[0], dev[1]) + [go_res, cli_res] = invite_from_cli(dev[0], dev[1]) + if go_res['freq'] != '2417': + raise Exception("Unexpected channel selected: " + go_res['freq']) + [go_res, cli_res] = invite_from_go(dev[0], dev[1]) + if go_res['freq'] != '2417': + raise Exception("Unexpected channel selected: " + go_res['freq']) diff --git a/tests/hwsim/test_p2p_persistent.py b/tests/hwsim/test_p2p_persistent.py index 2cb69b179..b5c290fd5 100644 --- a/tests/hwsim/test_p2p_persistent.py +++ b/tests/hwsim/test_p2p_persistent.py @@ -93,16 +93,18 @@ def form(go, cli, test_data=True, reverse_init=False): def invite_from_cli(go, cli): logger.info("Re-invoke persistent group from client") invite(cli, go) - check_result(go, cli) + [go_res, cli_res] = check_result(go, cli) hwsim_utils.test_connectivity_p2p(go, cli) terminate_group(go, cli) + return [go_res, cli_res] def invite_from_go(go, cli): logger.info("Re-invoke persistent group from GO") invite(go, cli) - check_result(go, cli) + [go_res, cli_res] = check_result(go, cli) hwsim_utils.test_connectivity_p2p(go, cli) terminate_group(go, cli) + return [go_res, cli_res] def test_persistent_group(dev): """P2P persistent group formation and re-invocation"""