]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make wpas_mesh_mode_scan more robust
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 18 Feb 2022 14:47:29 +0000 (16:47 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 18 Feb 2022 14:47:29 +0000 (16:47 +0200)
Clear scan results to avoid issues with get_bss() finding an entry from
an earlier test case when checking for mesh information.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_wpas_mesh.py

index 4b9209e595200cff9235624623e46569ee847ebf..cbc2857f98cb1c1e5b8ec723d1be0618ab838603 100644 (file)
@@ -70,6 +70,10 @@ def check_mesh_scan(dev, params, other_started=False, beacon_int=0):
     bss = dev.get_bss(bssid)
     if bss is None:
         raise Exception("Could not get BSS entry for mesh")
+    if 'mesh_id' not in bss:
+        raise Exception("mesh_id missing from BSS entry")
+    if bss['mesh_id'] != "wpas-mesh-open":
+        raise Exception("Incorrect mesh_id: " + bss['mesh_id'])
     if 'mesh_capability' not in bss:
         raise Exception("mesh_capability missing from BSS entry")
     if beacon_int:
@@ -243,6 +247,7 @@ def test_wpas_mesh_peer_disconnected(dev):
 def test_wpas_mesh_mode_scan(dev):
     """wpa_supplicant MESH scan support"""
     check_mesh_support(dev[0])
+    dev[0].flush_scan_cache()
     add_open_mesh_network(dev[0])
     add_open_mesh_network(dev[1], beacon_int=175)