3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-21 22:09:23 +01:00

test-runner: add wait_for_dbus_service

Common API to wait for a DBus service to appear on the bus
This commit is contained in:
James Prestwood 2020-12-17 11:36:06 -08:00 committed by Denis Kenzior
parent 5525f32cdd
commit e8031bab2a

View File

@ -616,6 +616,15 @@ class Namespace:
return False
def wait_for_dbus_service(self, service):
tries = 0
while not self._bus.name_has_owner(service):
if tries > 200:
raise TimeoutError('DBus service %s did not appear', service)
tries += 1
sleep(0.1)
def __str__(self):
ret = 'Namespace: %s\n' % self.name
ret += 'Processes:\n'