[PATCH 03/23] tests: Put seeker into extended listen when deferred PD is expected

Ilan Peer ilan.peer
Thu Sep 24 10:37:53 PDT 2015


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

Not doing so may result in a deferred PD flow failure (currently the
hwsim tests succeeded because seeker never stopped find, spending enough
time listening, so the follow-on PD would succeed).

Fix this by calling p2p_ext_listen when the seeker receives a deferred
PD failure event. Cancel extended listening when PD is done and also
stop find when seek is done.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 tests/hwsim/test_p2ps.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/hwsim/test_p2ps.py b/tests/hwsim/test_p2ps.py
index 5f0b13b..cacb0d8 100644
--- a/tests/hwsim/test_p2ps.py
+++ b/tests/hwsim/test_p2ps.py
@@ -92,6 +92,7 @@ def p2ps_exact_seek(i_dev, r_dev, svc_name, srv_info=None,
         if rcvd_svc_name != svc_name:
             raise Exception("service name not matching")
 
+    i_dev.p2p_stop_find()
     return [adv_id, rcvd_svc_name]
 
 def p2ps_nonexact_seek(i_dev, r_dev, svc_name, srv_info=None, adv_num=None):
@@ -123,6 +124,8 @@ def p2ps_nonexact_seek(i_dev, r_dev, svc_name, srv_info=None, adv_num=None):
         adv_id = ev1.split(" ")[3]
         rcvd_svc_name = ev1.split(" ")[6]
         ev_list.append(''.join([adv_id, ' ', rcvd_svc_name]))
+
+    i_dev.p2p_stop_find()
     return ev_list
 
 def p2ps_parse_event(ev, *args):
@@ -153,6 +156,9 @@ def p2ps_provision(seeker, advertiser, adv_id, auto_accept=True, method="1000",
         if ev is None:
             raise Exception("P2P-PROV-DISC-FAILURE timeout on seeker side")
 
+        # Put seeker into a listen state, since we expect the deferred flow to continue
+        seeker.p2p_ext_listen(500, 500)
+
         if method == "100":
             ev = advertiser.wait_global_event(["P2P-PROV-DISC-ENTER-PIN"],
                                               timeout=10)
@@ -197,6 +203,7 @@ def p2ps_provision(seeker, advertiser, adv_id, auto_accept=True, method="1000",
             if addr1 not in ev:
                 raise Exception("Unknown peer " + addr1)
 
+        seeker.p2p_cancel_ext_listen()
         if pin is not None:
             return ev1, ev2, pin
         return ev1, ev2
-- 
1.9.1




More information about the Hostap mailing list