]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Insert sleep after DATA_TEST_FRAME where needed
authorBenjamin Berg <benjamin.berg@intel.com>
Fri, 27 Sep 2024 09:36:21 +0000 (11:36 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 19 Dec 2024 21:55:02 +0000 (23:55 +0200)
If the frame is not fully processed the neighbor entries of the bridge
will not yet be updated. Add a sleep to ensure that the tests are not
racy.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
tests/hwsim/test_ap_hs20.py
tests/hwsim/test_hs20_filter.py

index 35cb0b8fe9ca0378c9d95f7eea8a147cda129da2..b53a8373d30586721cca155a223c0ccdb8f7eb76 100644 (file)
@@ -4357,6 +4357,9 @@ def _test_ap_hs20_proxyarp(dev, apdev):
     if "OK" not in dev[1].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()):
         raise Exception("DATA_TEST_FRAME failed")
 
+    # Wait for frames to be processed
+    time.sleep(0.1)
+
     matches = get_permanent_neighbors("ap-br0")
     logger.info("After connect: " + str(matches))
     if len(matches) != 3:
@@ -4489,6 +4492,9 @@ def _test_ap_hs20_proxyarp_dgaf(dev, apdev, disabled):
     if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()):
         raise Exception("DATA_TEST_FRAME failed")
 
+    # Wait for frames to be processed
+    time.sleep(0.1)
+
     matches = get_permanent_neighbors("ap-br0")
     logger.info("After connect: " + str(matches))
     if len(matches) != 2:
@@ -4949,6 +4955,9 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False):
     if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()):
         raise Exception("DATA_TEST_FRAME failed")
 
+    # Wait for frames to be processed
+    time.sleep(0.1)
+
     macs = get_bridge_macs("ap-br0")
     logger.info("After connect (showmacs): " + str(macs))
 
index 11cf347563197cace280f7e1db427d823d173e14..b916da567e3e726cf7b446574674712c03d91fcf 100644 (file)
@@ -172,6 +172,9 @@ def test_ip4_drop_gratuitous_arp(devs, apdevs, params):
             if "OK" not in hapd.request('DATA_TEST_FRAME ' + pkt):
                 raise Exception("DATA_TEST_FRAME failed")
 
+            # Wait for frames to be processed
+            time.sleep(0.1)
+
             if hapd.own_addr() in subprocess.check_output(['ip', 'neigh', 'show']).decode():
                 raise Exception("gratuitous ARP frame updated erroneously")
         finally:
@@ -199,6 +202,9 @@ def test_ip6_drop_unsolicited_na(devs, apdevs, params):
             if "OK" not in hapd.request('DATA_TEST_FRAME ' + pkt):
                 raise Exception("DATA_TEST_FRAME failed")
 
+            # Wait for frames to be processed
+            time.sleep(0.1)
+
             if hapd.own_addr() in subprocess.check_output(['ip', 'neigh', 'show']).decode():
                 raise Exception("unsolicited NA frame updated erroneously")
         finally: