diff --git a/tests/hwsim/remotehost.py b/tests/hwsim/remotehost.py index a1ef1f34b..dec1ad5a8 100644 --- a/tests/hwsim/remotehost.py +++ b/tests/hwsim/remotehost.py @@ -57,6 +57,7 @@ class Host(): self.ifname = ifname self.port = port self.dev = None + self.monitor_params = [] if self.name == "" and host != None: self.name = host diff --git a/tests/remote/monitor.py b/tests/remote/monitor.py index a97eaf928..5bd801c61 100644 --- a/tests/remote/monitor.py +++ b/tests/remote/monitor.py @@ -26,7 +26,8 @@ def create(devices, setup_params, refs, duts, monitors): mons.append(monitor) for mon in mons: - dev = config.get_device(devices, mon) + word = mon.split(":") + dev = config.get_device(devices, word[0]) if dev is None: continue @@ -35,6 +36,15 @@ def create(devices, setup_params, refs, duts, monitors): port=dev['port'], name=dev['name']) + for iface_param in word[1:]: + params = iface_param.split(",") + if len(params) > 3: + monitor_param = { "freq" : rutils.c2f(params[0]), + "bw" : params[1], + "center_freq1" : rutils.c2f(params[2]), + "center_freq2" : rutils.c2f(params[3]) } + host.monitor_params.append(monitor_param) + try: host.execute(["iw", "reg", "set", setup_params['country']]) rutils.setup_hw_host(host, setup_params, True) @@ -49,11 +59,15 @@ def destroy(devices, hosts): stop(host) for monitor in host.monitors: host.execute(["ifconfig", monitor, "down"]) + host.monitor_params = [] -def setup(host, monitor_params): +def setup(host, monitor_params=None): if host is None: return + if monitor_params == None: + monitor_params = host.monitor_params + ifaces = re.split('; | |, ', host.ifname) count = 0 for param in monitor_params: