]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: wpa_supplicant mesh with dynamic interface and removal
authorJouni Malinen <j@w1.fi>
Sun, 29 Jan 2017 15:38:37 +0000 (17:38 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Jan 2017 15:42:02 +0000 (17:42 +0200)
This is a regression test case for SIGSEGV in
wpa_supplicant_remove_iface() if the main interface is removed while a
separate mesh interface is in use.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wpas_mesh.py

index 7c4ad2e29d1fbac7de24fcdd958a47ac447cc636..77dde5ae548e73ba838128b1d329596554e4ee38 100644 (file)
@@ -673,6 +673,28 @@ def test_wpas_mesh_dynamic_interface(dev):
         if mesh1:
             dev[1].request("MESH_GROUP_REMOVE " + mesh1)
 
+def test_wpas_mesh_dynamic_interface_remove(dev):
+    """wpa_supplicant mesh with dynamic interface and removal"""
+    wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+    wpas.interface_add("wlan5")
+    check_mesh_support(wpas)
+    mesh5 = wpas.request("MESH_INTERFACE_ADD ifname=mesh5")
+    if "FAIL" in mesh5:
+        raise Exception("MESH_INTERFACE_ADD failed")
+
+    wpas5 = WpaSupplicant(ifname=mesh5)
+    logger.info(mesh5 + " address " + wpas5.get_status_field("address"))
+    add_open_mesh_network(wpas5)
+    add_open_mesh_network(dev[0])
+    check_mesh_group_added(wpas5)
+    check_mesh_group_added(dev[0])
+    check_mesh_peer_connected(wpas5)
+    check_mesh_peer_connected(dev[0])
+    hwsim_utils.test_connectivity(wpas5, dev[0])
+
+    # Remove the main interface while mesh interface is in use
+    wpas.interface_remove("wlan5")
+
 def test_wpas_mesh_max_peering(dev, apdev, params):
     """Mesh max peering limit"""
     check_mesh_support(dev[0])