From 01370f49a65392b14341393a187ce63194446418 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 21 Nov 2013 11:39:12 +0200 Subject: [PATCH] tests: Verify that re-invoked P2P group is identified as persistent Signed-hostap: Jouni Malinen --- tests/hwsim/test_p2p_persistent.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/hwsim/test_p2p_persistent.py b/tests/hwsim/test_p2p_persistent.py index a4be1812a..38fad8ee4 100644 --- a/tests/hwsim/test_p2p_persistent.py +++ b/tests/hwsim/test_p2p_persistent.py @@ -53,6 +53,8 @@ def check_result(go, cli): ev = go.wait_global_event(["P2P-GROUP-STARTED"], timeout=30) if ev is None: raise Exception("Timeout on group re-invocation (on GO)") + if "[PERSISTENT]" not in ev: + raise Exception("Re-invoked group not marked persistent") go_res = go.group_form_result(ev) if go_res['role'] != 'GO': raise Exception("Persistent group GO did not become GO") @@ -61,6 +63,8 @@ def check_result(go, cli): ev = cli.wait_global_event(["P2P-GROUP-STARTED"], timeout=30) if ev is None: raise Exception("Timeout on group re-invocation (on client)") + if "[PERSISTENT]" not in ev: + raise Exception("Re-invoked group not marked persistent") cli_res = cli.group_form_result(ev) if cli_res['role'] != 'client': raise Exception("Persistent group client did not become client") @@ -263,3 +267,15 @@ def test_persistent_group_channel(dev): if go_res['freq'] != "2417": raise Exception("Persistent group client channel preference not followed") terminate_group(dev[0], dev[1]) + +def test_persistent_group_and_role_change(dev): + """P2P persistent group, auto GO in another role, and re-invocation""" + form(dev[0], dev[1]) + + logger.info("Start and stop autonomous GO on previous P2P client device") + dev[1].p2p_start_go() + dev[1].remove_group() + dev[1].dump_monitor() + + logger.info("Re-invoke the persistent group") + invite_from_go(dev[0], dev[1])