From 78ebbf0916683fcc68306854e5827bd095ba51a8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 9 Mar 2013 17:51:22 +0200 Subject: [PATCH] tests: Add autogo test with two clients Signed-hostap: Jouni Malinen --- tests/hwsim/test_p2p_autogo.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py index 7a4174623..5272934b4 100644 --- a/tests/hwsim/test_p2p_autogo.py +++ b/tests/hwsim/test_p2p_autogo.py @@ -11,25 +11,37 @@ logger = logging.getLogger(__name__) import hwsim_utils -def autogo(go, client): +def autogo(go): logger.info("Start autonomous GO " + go.ifname) res = go.p2p_start_go() logger.debug("res: " + str(res)) +def connect_cli(go, client): logger.info("Try to connect the client to the GO") pin = client.wps_read_pin() go.p2p_go_authorize_client(pin) client.p2p_connect_group(go.p2p_dev_addr(), pin, timeout=60) - logger.info("Group formed") + logger.info("Client connected") hwsim_utils.test_connectivity_p2p(go, client) def test_autogo(dev): - autogo(go=dev[0], client=dev[1]) + autogo(dev[0]) + connect_cli(dev[0], dev[1]) dev[0].remove_group() try: dev[1].remove_group() except: pass +def test_autogo_2cli(dev): + autogo(dev[0]) + connect_cli(dev[0], dev[1]) + connect_cli(dev[0], dev[2]) + hwsim_utils.test_connectivity_p2p(dev[1], dev[2]) + dev[2].remove_group() + dev[1].remove_group() + dev[0].remove_group() + def add_tests(tests): tests.append(test_autogo) + tests.append(test_autogo_2cli)