tests: Fix p2ps_connect_adv_go_pin_method case
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Wed, 10 Jun 2015 08:43:38 +0000 (11:43 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 14 Jun 2015 20:16:55 +0000 (23:16 +0300)
test_p2ps_connect_adv_go_pin_method() expects that
p2ps_provision_keypad_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.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
tests/hwsim/test_p2ps.py

index e2d68a8..1d1e612 100644 (file)
@@ -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