From 3e69c33f74607f33b11574893ae7bf4790c41ec5 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 23 Oct 2020 15:19:00 -0700 Subject: [PATCH] auto-t: only return expected number from list_devices If the caller specifies the number of devices only return that many. Some sub-tests may only need a subset of the total number of devices for the test. If the number of devices expected is less than the total being returned, python would throw an exception. --- autotests/util/iwd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index dc4f93a2..0ec33ac3 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -1078,7 +1078,7 @@ class IWD(AsyncOpAbstract): if not self._wait_timed_out: GLib.source_remove(timeout) - return list(self._devices.values() if not p2p else self._devices.p2p_dict.values()) + return list(self._devices.values() if not p2p else self._devices.p2p_dict.values())[:wait_to_appear] def list_p2p_devices(self, *args, **kwargs): return self.list_devices(*args, **kwargs, p2p=True)