diff options
author | Ryota Mibu <r-mibu@cq.jp.nec.com> | 2017-09-04 13:41:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-09-04 13:41:52 +0000 |
commit | 836a8932d6c6a502980009b9578f0c6ecf64cb47 (patch) | |
tree | 612de457cac28efe5d0a6af3b86451ba21b95a73 /tests/utils.py | |
parent | f14135782ba970d7627d43df40935778954ed294 (diff) | |
parent | e4487625b094b19f518d5bf9e90c2c8d1d2b618e (diff) |
Merge "Test port data plane status on Sample Inspector"
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py index 41e22353..fd8c4cd7 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -76,3 +76,15 @@ class SSHClient(object): elif method == 'get': ftp.get(source, dest) ftp.close() + +def run_async(func): + from threading import Thread + from functools import wraps + + @wraps(func) + def async_func(*args, **kwargs): + thread = Thread(target=func, args=args, kwargs=kwargs) + thread.start() + return thread + + return async_func |