[PATCH 08/19] tests: Fix p2ps_connect_adv_go_pin_method case

Ilan Peer ilan.peer
Wed Jun 10 01:43:38 PDT 2015


From: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

The test_p2ps_connect_adv_go_pin_method() expects that
p2ps_provision_keypad_method() method returns P2PS-PROV-DONE with details
needed for a connection. However, this event was overridden which resulted
in an incorrect test flow skipping the connection establishement.
The test would pass, however, without really trying to connect.
Fix this by returning the correct event.
In addition, fix inconsistent indentation.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
Reviewed-by: Ilan Peer <ilan.peer at intel.com>
---
 tests/hwsim/test_p2ps.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/hwsim/test_p2ps.py b/tests/hwsim/test_p2ps.py
index e2d68a8..2c5963c 100644
--- a/tests/hwsim/test_p2ps.py
+++ b/tests/hwsim/test_p2ps.py
@@ -174,10 +174,10 @@ def p2ps_provision_keypad_method(i_dev, r_dev, autoaccept,
         ev1 = i_dev.wait_global_event(["P2PS-PROV-DONE"], timeout=10)
         if ev1 is None:
             raise Exception("P2PS-PROV-DONE timeout on seeker side")
-        ev1 = i_dev.wait_global_event(["P2P-PROV-DISC-ENTER-PIN"], timeout=10)
-        if ev1 is None:
+        ev2 = i_dev.wait_global_event(["P2P-PROV-DISC-ENTER-PIN"], timeout=10)
+        if ev2 is None:
             raise Exception("P2P-PROV-DISC-ENTER-PIN failed on seeker side")
-        if r_dev.p2p_dev_addr() not in ev1:
+        if r_dev.p2p_dev_addr() not in ev2:
             raise Exception("Unknown peer ")
         return ev1
 
@@ -622,7 +622,7 @@ def test_p2ps_connect_adv_go_pin_method(dev):
         ev1 = dev[1].wait_global_event(["P2P-GROUP-STARTED"], timeout=10)
         if ev1 is None:
             raise Exception("P2P-GROUP-STARTED timeout on seeker side")
-	dev[1].group_form_result(ev1)
+        dev[1].group_form_result(ev1)
 
         ev0 = dev[0].wait_global_event(["AP-STA-CONNECTED"], timeout=10)
         if ev0 is None:
-- 
1.9.1




More information about the Hostap mailing list