summaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
authorCarlos Goncalves <carlos.goncalves@neclab.eu>2017-08-15 19:01:00 +0200
committerCarlos Goncalves <mail@cgoncalves.pt>2017-08-17 13:12:13 +0000
commite4487625b094b19f518d5bf9e90c2c8d1d2b618e (patch)
treed2e0abed2006322be6ff33494cb78f8873b063f9 /tests/utils.py
parent5b1401a9194daae197a8f5ae534b9a37dd483eac (diff)
Test port data plane status on Sample Inspector
Exercise the Neutron port data plane status API on the Sample Inspector. Setting the data_plane_status field of Neutron Port objects to 'DOWN' when a network failure on a node is detected. To keep the test simple enough to verify the Neutron API, we don't consider a scenario where multiple NIC ports could be present on that particular node. It could still be done, though. JIRA: DOCTOR-107 Change-Id: I9ffa0a23626b7edfaeb601dc90d55c756216cc41 Signed-off-by: Carlos Goncalves <carlos.goncalves@neclab.eu>
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py12
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