From 06f94fd0e1f269fa78dead1dda9202624d5b9951 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 28 Sep 2014 18:09:53 +0300 Subject: [PATCH] tests: Increase P2P persistent group with per-STA PSK coverage Remove and re-start the persistent group manually to increase test coverage to include the case of re-configuring the PSK list entries from a stored persistent group. Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_persistent.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/hwsim/test_p2p_persistent.py b/tests/hwsim/test_p2p_persistent.py index 38f7eb335..8e9a3b43a 100644 --- a/tests/hwsim/test_p2p_persistent.py +++ b/tests/hwsim/test_p2p_persistent.py @@ -190,6 +190,24 @@ def test_persistent_group_per_sta_psk(dev): raise Exception("Same PSK assigned for both clients") hwsim_utils.test_connectivity_p2p_sta(dev[1], dev[2]) + logger.info("Remove persistent group and re-start it manually") + dev[0].remove_group() + dev[1].wait_go_ending_session() + dev[2].wait_go_ending_session() + dev[0].dump_monitor() + + for i in range(0, 3): + networks = dev[i].list_networks() + if len(networks) != 1: + raise Exception("Unexpected number of networks") + if "[P2P-PERSISTENT]" not in networks[0]['flags']: + raise Exception("Not the persistent group data") + if "OK" not in dev[i].global_request("P2P_GROUP_ADD persistent=" + networks[0]['id'] + " freq=2412"): + raise Exception("Could not re-start persistent group") + ev = dev[i].wait_global_event(["P2P-GROUP-STARTED"], timeout=30) + if ev is None: + raise Exception("Timeout on group restart") + logger.info("Leave persistent group and rejoin it") dev[2].remove_group() ev = dev[2].wait_event(["P2P-GROUP-REMOVED"], timeout=3)