summaryrefslogtreecommitdiffstats
path: root/testcases/functest_utils.py
diff options
context:
space:
mode:
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)