diff options
Diffstat (limited to 'testcases')
-rw-r--r-- | testcases/VIM/OpenStack/CI/libraries/run_tempest.py | 32 | ||||
-rw-r--r-- | testcases/vIMS/CI/vIMS.py | 4 |
2 files changed, 25 insertions, 11 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_tempest.py b/testcases/VIM/OpenStack/CI/libraries/run_tempest.py index 0097a567..3b937e92 100644 --- a/testcases/VIM/OpenStack/CI/libraries/run_tempest.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_tempest.py @@ -21,6 +21,7 @@ import re import requests import subprocess import sys +import time import yaml import keystoneclient.v2_0.client as ksclient from neutronclient.v2_0 import client as neutronclient @@ -173,8 +174,8 @@ def configure_tempest(): logger.debug("Finding tempest.conf file...") tempest_conf_file = RALLY_INSTALLATION_DIR+"/tempest/for-deployment-" \ +deployment_uuid+"/tempest.conf" - if tempest_conf_file == "": - logger.debug(" Tempest configuration file NOT found") + if not os.path.isfile(tempest_conf_file): + logger.error(" Tempest configuration file %s NOT found." % tempest_conf_file) return False logger.debug(" Updating fixed_network_name...") @@ -201,6 +202,8 @@ def configure_tempest(): +USER_PASSWORD functest_utils.execute_command(cmd,logger) + # Copy tempest.conf to /home/opnfv/functest/results/tempest/ + print shutil.copyfile(tempest_conf_file,TEMPEST_RESULTS_DIR+'/tempest.conf') return True @@ -218,15 +221,23 @@ def run_tempest(OPTION): if CI_DEBUG == "true" or CI_DEBUG == "True": subprocess.call(cmd_line, shell=True, stderr=subprocess.STDOUT) else: - if not os.path.exists(TEMPEST_RESULTS_DIR): - os.makedirs(TEMPEST_RESULTS_DIR) + header = "Tempest environment:\n"\ + " Installer: %s\n Scenario: %s\n Node: %s\n Date: %s\n" % \ + (os.getenv('INSTALLER_TYPE','Unknown'), \ + os.getenv('DEPLOY_SCENARIO','Unknown'), \ + os.getenv('NODE_NAME','Unknown'), \ + time.strftime("%a %b %d %H:%M:%S %Z %Y")) - f = open(TEMPEST_RESULTS_DIR+"/tempest.log", 'w+') - FNULL = open(os.devnull, 'w') + f_stdout = open(TEMPEST_RESULTS_DIR+"/tempest.log", 'w+') + f_stderr = open(TEMPEST_RESULTS_DIR+"/tempest-error.log", 'w+') + f_env = open(TEMPEST_RESULTS_DIR+"/environment.log", 'w+') + f_env.write(header) - subprocess.call(cmd_line, shell=True, stdout=FNULL, stderr=f) - f.close() - FNULL.close() + subprocess.call(cmd_line, shell=True, stdout=f_stdout, stderr=f_stderr) + + f_stdout.close() + f_stderr.close() + f_env.close() cmd_line = "rally verify show" subprocess.call(cmd_line, shell=True) @@ -273,6 +284,9 @@ def main(): else: MODE = "--set "+args.mode + if not os.path.exists(TEMPEST_RESULTS_DIR): + os.makedirs(TEMPEST_RESULTS_DIR) + create_tempest_resources() configure_tempest() run_tempest(MODE) diff --git a/testcases/vIMS/CI/vIMS.py b/testcases/vIMS/CI/vIMS.py index 360c5d78..ae2ad9d2 100644 --- a/testcases/vIMS/CI/vIMS.py +++ b/testcases/vIMS/CI/vIMS.py @@ -131,8 +131,8 @@ def push_results(): if args.report: logger.debug("Pushing results to DB....") - scenario = functest_utils.get_scenario(self.logger) - pod_name = functest_utils.get_pod_name(self.logger) + scenario = functest_utils.get_scenario(logger) + pod_name = functest_utils.get_pod_name(logger) functest_utils.push_results_to_db(db_url=DB_URL, case_name="vIMS", logger=logger, pod_name=pod_name, |