mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
autotests: Add IWD.wait utility for sleeping inside tests
This commit is contained in:
parent
b1d0dbc3e4
commit
920e79b32c
@ -589,6 +589,17 @@ class IWD(AsyncOpAbstract):
|
||||
+ str(max_wait) + ' sec')
|
||||
GLib.source_remove(timeout)
|
||||
|
||||
def wait(self, time):
|
||||
self._wait_timed_out = False
|
||||
def wait_timeout_cb():
|
||||
self._wait_timed_out = True
|
||||
return False
|
||||
|
||||
GLib.timeout_add(int(time * 1000), wait_timeout_cb)
|
||||
context = mainloop.get_context()
|
||||
while not self._wait_timed_out:
|
||||
context.iteration(may_block=True)
|
||||
|
||||
@staticmethod
|
||||
def clear_storage():
|
||||
os.system('rm -rf ' + IWD_STORAGE_DIR + '/*')
|
||||
|
Loading…
Reference in New Issue
Block a user