]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: P2P group formation with random interface addresses
authorJouni Malinen <j@w1.fi>
Sat, 12 Jan 2019 17:18:02 +0000 (19:18 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 12 Jan 2019 17:18:02 +0000 (19:18 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_p2p_grpform.py

index 9b442d21876be3132c63096154685801215387c9..b967085f984967807929d4a56711468a10ee3949 100644 (file)
@@ -1161,3 +1161,25 @@ def test_grpform_go_neg_stopped(dev):
     dev[1].p2p_stop_find()
     if ev is None:
         raise Exception("Did not find peer quickly enough after stopped P2P_CONNECT")
+
+def test_grpform_random_addr(dev):
+    """P2P group formation with random interface addresses"""
+    dev[0].global_request("SET p2p_no_group_iface 0")
+    dev[1].global_request("SET p2p_no_group_iface 0")
+    try:
+        if "OK" not in dev[0].global_request("SET p2p_interface_random_mac_addr 1"):
+            raise Exception("Failed to set p2p_interface_random_mac_addr")
+        if "OK" not in dev[1].global_request("SET p2p_interface_random_mac_addr 1"):
+            raise Exception("Failed to set p2p_interface_random_mac_addr")
+        [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
+                                               r_dev=dev[1], r_intent=0)
+        if "p2p-wlan" not in i_res['ifname']:
+            raise Exception("Unexpected group interface name")
+        check_grpform_results(i_res, r_res)
+        hwsim_utils.test_connectivity_p2p(dev[0], dev[1])
+        remove_group(dev[0], dev[1])
+        if i_res['ifname'] in utils.get_ifnames():
+            raise Exception("Group interface netdev was not removed")
+    finally:
+        dev[0].global_request("SET p2p_interface_random_mac_addr 0")
+        dev[1].global_request("SET p2p_interface_random_mac_addr 0")