summaryrefslogtreecommitdiffstats
path: root/testcases/functest_utils.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2015-11-30 17:26:26 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-11-30 17:26:27 +0000
commit89ba89f97c3a84ead9897455bccfbd6662d40f95 (patch)
tree85cbfe05ae2847708e42fd817ea9891901e6cb92 /testcases/functest_utils.py
parent581e00817e399a6d3785f503f392dbaf84e83938 (diff)
parent8c358c29b07ad126614c1c327d2d95f517d793f4 (diff)
Merge "Add functions to retrieve POD name in Functest"
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r--testcases/functest_utils.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index 323297f28..59af2175e 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -210,6 +210,7 @@ def create_neutron_port(neutron_client, name, network_id, ip):
print "Error:", sys.exc_info()[0]
return False
+
def delete_neutron_port(neutron_client, port_id):
try:
neutron_client.delete_port(port_id)
@@ -218,6 +219,7 @@ def delete_neutron_port(neutron_client, port_id):
print "Error:", sys.exc_info()[0]
return False
+
def get_network_id(neutron_client, network_name):
networks = neutron_client.list_networks()['networks']
id = ''
@@ -444,6 +446,19 @@ def get_installer_type(logger=None):
return installer
+
+def get_pod_name(logger=None):
+ """
+ Get PoD Name from env variable NODE_NAME
+ """
+ try:
+ return os.environ['NODE_NAME']
+ except KeyError:
+ if logger:
+ logger.error("Unable to retrieve the POD name from environment.Using pod name 'unknown-pod'")
+ return "unknown-pod"
+
+
def push_results_to_db(db_url, case_name, logger, pod_name, git_version, payload):
url = db_url + "/results"
installer = get_installer_type(logger)