mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 09:39:25 +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:
parent
5525f32cdd
commit
e8031bab2a
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user