Browse Source

tests: P2PS advertisement as GO having persistent group (no peer entry)

This is a regression test case for the dev NULL pointer dereference in
p2p_build_prov_disc_resp().

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 9 years ago
parent
commit
f56478ab88
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tests/hwsim/test_p2ps.py

+ 18 - 0
tests/hwsim/test_p2ps.py

@@ -809,6 +809,24 @@ def test_p2ps_connect_adv_go_persistent(dev):
     p2ps_connect_pd(dev[0], dev[1], ev0, ev1)
     remove_group(dev[0], dev[1])
 
+def test_p2ps_adv_go_persistent_no_peer_entry(dev):
+    """P2PS advertisement as GO having persistent group (no peer entry)"""
+    go_neg_pin_authorized_persistent(i_dev=dev[0], i_intent=15,
+                                     r_dev=dev[1], r_intent=0)
+    dev[0].remove_group()
+    dev[1].wait_go_ending_session()
+
+    p2ps_advertise(r_dev=dev[0], r_role='4', svc_name='org.wi-fi.wfds.send.rx',
+                   srv_info='I can receive files upto size 2 GB')
+    [adv_id, rcvd_svc_name] = p2ps_exact_seek(i_dev=dev[1], r_dev=dev[0],
+                                              svc_name='org.wi-fi.wfds.send.rx',
+                                              srv_info='2 GB')
+    dev[0].global_request("P2P_FLUSH")
+    dev[0].p2p_listen()
+    ev1, ev0 = p2ps_provision(dev[1], dev[0], adv_id)
+    if "persist=" not in ev0 or "persist=" not in ev1:
+        raise Exception("Persistent group isn't used by peers")
+
 def test_p2ps_pd_follow_on_status_failure(dev):
     """P2PS PD follow on request with status 11"""
     addr0 = dev[0].p2p_dev_addr()