[PATCH V3 18/20] tests: Start another dynamic wpa_supplicant interface
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Thu Feb 5 07:12:15 PST 2026
Tests that require different radio configurations may need more then one
supplicant instance, so "wlan5" wpa_supplicant isn't enough.
Add two more instances on wlan6/7.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
Signed-off-by: Daniel Gabay <daniel.gabay at intel.com>
---
tests/hwsim/run-tests.py | 51 +++++++++++++++++++++-------------------
tests/hwsim/start.sh | 4 ++++
tests/hwsim/stop.sh | 4 ++--
3 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index bb6fbf5203..3050929ed1 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -52,18 +52,19 @@ def reset_devs(dev, apdev):
logger.exception("Failed to reset device " + d.ifname)
ok = False
- wpas = None
- try:
- wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5', monitor=False)
- ifaces = wpas.global_request("INTERFACES").splitlines()
- for iface in ifaces:
- if iface.startswith("wlan"):
- wpas.interface_remove(iface)
- except Exception as e:
- pass
- if wpas:
- wpas.close_ctrl()
- del wpas
+ for ifname in ['/tmp/wpas-wlan5', '/tmp/wpas-wlan6', '/tmp/wpas-wlan7']:
+ wpas = None
+ try:
+ wpas = WpaSupplicant(global_iface=ifname, monitor=False)
+ ifaces = wpas.global_request("INTERFACES").splitlines()
+ for iface in ifaces:
+ if iface.startswith("wlan"):
+ wpas.interface_remove(iface)
+ except Exception as e:
+ pass
+ if wpas:
+ wpas.close_ctrl()
+ del wpas
try:
hapd = HostapdGlobal()
@@ -658,18 +659,20 @@ def main():
print("Leaving devices in current state")
else:
reset_ok = reset_devs(dev, apdev)
- wpas = None
- try:
- wpas = WpaSupplicant(global_iface="/tmp/wpas-wlan5",
- monitor=False)
- rename_log(args.logdir, 'log5', name, wpas)
- if not args.no_reset:
- wpas.remove_ifname()
- except Exception as e:
- pass
- if wpas:
- wpas.close_ctrl()
- del wpas
+
+ for i in [5, 6, 7]:
+ wpas = None
+ try:
+ wpas = WpaSupplicant(global_iface="/tmp/wpas-wlan%d" % i,
+ monitor=False)
+ rename_log(args.logdir, 'log%d' % i, name, wpas)
+ if not args.no_reset:
+ wpas.remove_ifname()
+ except Exception as e:
+ pass
+ if wpas:
+ wpas.close_ctrl()
+ del wpas
for i in range(0, 3):
rename_log(args.logdir, 'log' + str(i), name, dev[i])
diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh
index dc55001708..0ba3fdc667 100755
--- a/tests/hwsim/start.sh
+++ b/tests/hwsim/start.sh
@@ -131,6 +131,10 @@ for i in 0 1 2; do
done
sudo $(printf -- "$VALGRIND_WPAS" 5) $WPAS -g /tmp/wpas-wlan5 -G$GROUP \
-ddKt$TRACE -f $LOGDIR/log5 &
+sudo $(printf -- "$VALGRIND_WPAS" 6) $WPAS -g /tmp/wpas-wlan6 -G$GROUP \
+ -ddKt$TRACE -f $LOGDIR/log6 &
+sudo $(printf -- "$VALGRIND_WPAS" 7) $WPAS -g /tmp/wpas-wlan7 -G$GROUP \
+ -ddKt$TRACE -f $LOGDIR/log7 &
sudo $VALGRIND_HAPD $HAPD -ddKt$TRACE -g /var/run/hostapd-global -G $GROUP -f $LOGDIR/hostapd &
HPID=$!
diff --git a/tests/hwsim/stop.sh b/tests/hwsim/stop.sh
index 4eef7bf1a3..08720dda80 100755
--- a/tests/hwsim/stop.sh
+++ b/tests/hwsim/stop.sh
@@ -64,9 +64,9 @@ for i in `pidof valgrind.bin`; do
done
count=0
-for i in /tmp/wpas-wlan0 /tmp/wpas-wlan1 /tmp/wpas-wlan2 /tmp/wpas-wlan5 /var/run/hostapd-global /tmp/hlr_auc_gw.sock /tmp/wpa_ctrl_* /tmp/eap_sim_db_*; do
+for i in /tmp/wpas-wlan0 /tmp/wpas-wlan1 /tmp/wpas-wlan2 /tmp/wpas-wlan5 /tmp/wpas-wlan6 /tmp/wpas-wlan7 /var/run/hostapd-global /tmp/hlr_auc_gw.sock /tmp/wpa_ctrl_* /tmp/eap_sim_db_*; do
count=$(($count + 1))
- if [ $count -lt 7 -a -e $i ]; then
+ if [ $count -lt 8 -a -e $i ]; then
echo "Waiting for ctrl_iface $i to disappear"
sleep 1
fi
--
2.52.0
More information about the Hostap
mailing list