[PATCH 4/9] tests: Few trivial fixes to p2ps tests

Ilan Peer ilan.peer
Thu Jul 2 06:14:55 PDT 2015


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

1. Remove unused variables
2. replace split(" ") with just split()
3. Remove call to flash_scan_cache() as it is no longer needed.

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

diff --git a/tests/hwsim/test_p2ps.py b/tests/hwsim/test_p2ps.py
index dacaf1b..fadfdcf 100644
--- a/tests/hwsim/test_p2ps.py
+++ b/tests/hwsim/test_p2ps.py
@@ -281,8 +281,6 @@ def set_no_group_iface(dev, enable):
 
 def test_p2ps_exact_search(dev):
     """P2PS exact service request"""
-    addr0 = dev[0].p2p_dev_addr()
-    addr1 = dev[1].p2p_dev_addr()
     p2ps_advertise(r_dev=dev[0], r_role='1', 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],
@@ -294,8 +292,6 @@ def test_p2ps_exact_search(dev):
 
 def test_p2ps_exact_search_srvinfo(dev):
     """P2PS exact service request with service info"""
-    addr0 = dev[0].p2p_dev_addr()
-    addr1 = dev[1].p2p_dev_addr()
     p2ps_advertise(r_dev=dev[0], r_role='0', 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],
@@ -308,13 +304,11 @@ def test_p2ps_exact_search_srvinfo(dev):
 
 def test_p2ps_nonexact_search(dev):
     """P2PS nonexact seek request"""
-    addr0 = dev[0].p2p_dev_addr()
-    addr1 = dev[1].p2p_dev_addr()
     p2ps_advertise(r_dev=dev[0], r_role='0', svc_name='org.wi-fi.wfds.play.rx',
                    srv_info='I support Miracast Mode ')
     ev_list = p2ps_nonexact_seek(i_dev=dev[1], r_dev=dev[0],
                                  svc_name='org.wi-fi.wfds.play*')
-    adv_id = ev_list[0].split(" ")[0]
+    adv_id = ev_list[0].split()[0]
 
     ev0 = dev[0].global_request("P2P_SERVICE_DEL asp " + str(adv_id))
     if ev0 is None:
@@ -322,14 +316,12 @@ def test_p2ps_nonexact_search(dev):
 
 def test_p2ps_nonexact_search_srvinfo(dev):
     """P2PS nonexact seek request with service info"""
-    addr0 = dev[0].p2p_dev_addr()
-    addr1 = dev[1].p2p_dev_addr()
     p2ps_advertise(r_dev=dev[0], r_role='0', svc_name='org.wi-fi.wfds.send.rx',
                    srv_info='I can receive files upto size 2 GB')
     ev_list = p2ps_nonexact_seek(i_dev=dev[1], r_dev=dev[0],
                                  svc_name='org.wi-fi.wfds.send*',
                                  srv_info='2 GB')
-    adv_id = ev_list[0].split(" ")[0]
+    adv_id = ev_list[0].split()[0]
     ev0 = dev[0].global_request("P2P_SERVICE_DEL asp " + str(adv_id))
     if ev0 is None:
         raise Exception("Unable to remove the advertisement instance")
@@ -651,7 +643,6 @@ def test_p2ps_connect_adv_client_pin_method(dev):
     """P2PS advertiser as client with keypad config method on seeker side and auto-accept"""
     addr0 = dev[0].p2p_dev_addr()
     addr1 = dev[1].p2p_dev_addr()
-    dev[0].flush_scan_cache()
     p2ps_advertise(r_dev=dev[0], r_role='2', 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],
-- 
1.9.1




More information about the Hostap mailing list