diff options
author | 2015-11-30 09:39:54 +0100 | |
---|---|---|
committer | 2015-11-30 14:53:03 +0100 | |
commit | 8c358c29b07ad126614c1c327d2d95f517d793f4 (patch) | |
tree | a765c94bf35fd78127a85d59ae8d938ca525a6ff /testcases/functest_utils.py | |
parent | 0045f29f59ee5c800261cd77145fec0e9558740f (diff) |
Add functions to retrieve POD name in Functest
JIRA: FUNCTEST-108
Change-Id: I3453933e12cd7af9b06f50b327873f7516609566
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r-- | testcases/functest_utils.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py index 323297f2..59af2175 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) |