]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Remove dynamically added hostapd interfaces
authorAvraham Stern <avraham.stern@intel.com>
Wed, 15 Feb 2023 23:09:03 +0000 (01:09 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Mar 2023 21:55:00 +0000 (23:55 +0200)
When an in interface is added dynamically to hostapd with
HWSimRadio, it's not removed during device reset.
This requires to manually remove it, otherwise subsequent tests may
fail. Better do it during device reset.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
tests/hwsim/run-tests.py

index 0784575f283d15bff800e487cb5757093c1cfc0d..f63bb567766c5ad749bd479a006c3107c29c8842 100755 (executable)
@@ -69,13 +69,10 @@ def reset_devs(dev, apdev):
     try:
         hapd = HostapdGlobal()
         hapd.flush()
-        hapd.remove('wlan3-6')
-        hapd.remove('wlan3-5')
-        hapd.remove('wlan3-4')
-        hapd.remove('wlan3-3')
-        hapd.remove('wlan3-2')
-        for ap in apdev:
-            hapd.remove(ap['ifname'])
+        ifaces = hapd.request("INTERFACES").splitlines()
+        for iface in ifaces:
+            if iface.startswith("wlan"):
+                hapd.remove(iface)
         hapd.remove('as-erp')
     except Exception as e:
         logger.info("Failed to remove hostapd interface")