3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

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.
This commit is contained in:
James Prestwood 2020-10-23 15:19:00 -07:00 committed by Denis Kenzior
parent 26c4b8b4fe
commit 3e69c33f74

View File

@ -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)