Add the "wpa_supplicant_radios=<radio_name_list>" option in hw.conf's
SETUP section that only reserves radios for the autotest to be able to
start wpa_supplicant on them, i.e. prevents iwd or hostapd from being
started on them.
---
tools/test-runner | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tools/test-runner b/tools/test-runner
index 6443af15..f2b75bc0 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -270,10 +270,8 @@ class Radio:
intf_id += 1
- self.interface = Interface(ifname, hapd.config)
- # IWD does not use interfaces in test-runner so any created
- # interface is assumed to be used by hostapd.
- self.use = 'hostapd'
+ self.interface = Interface(ifname, hapd.config if hapd else None)
+ self.use = 'hostapd' if hapd else 'other'
Process(['iw', 'phy', self.name, 'interface', 'add',
ifname,
'type', 'managed'], True)
@@ -466,6 +464,7 @@ class TestContext:
self.args = args
self.hw_config = None
self.hostapd = None
+ self.wpas_interfaces = None
self.cur_radio_id = 0
self.cur_iface_id = 0
self.radios = []
@@ -609,6 +608,15 @@ class TestContext:
self.hostapd = Hostapd(self, hapd_radios, hapd_configs, radius_config)
+ def start_wpas_interfaces(self):
+ if 'wpa_supplicant_radios' not in self.hw_config['SETUP']:
+ return
+
+ setting = self.hw_config['SETUP']['wpa_supplicant_radios']
+ wpas_radio_names = [name.strip() for name in setting.split(',')]
+ wpas_radios = [rad for rad in self.radios if rad.name in wpas_radio_names]
+ self.wpas_interfaces = [rad.create_interface(None) for rad in wpas_radios]
+
def start_ofono(self):
sim_keys = self.hw_config['SETUP'].get('sim_keys', None)
if not sim_keys:
@@ -676,6 +684,7 @@ class TestContext:
def stop_test_processes(self):
self.radios = []
self.hostapd = None
+ self.wpas_interfaces = None
self.iwd_extra_options = None
for p in [p for p in self.processes if p.multi_test is False]:
@@ -870,6 +879,7 @@ def pre_test(ctx, test):
ctx.start_dbus_monitor()
ctx.start_radios()
ctx.start_hostapd()
+ ctx.start_wpas_interfaces()
ctx.start_ofono()
if ctx.hw_config.has_option('SETUP', 'start_iwd'):
--
2.25.1