aboutsummaryrefslogtreecommitdiffstats
path: root/testcases
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-05-28 22:18:45 +0800
committerjose.lausuch <jose.lausuch@ericsson.com>2016-05-30 13:47:37 +0200
commitbcde99e21f704355a3d03ab98ceace451a0436fc (patch)
tree77f114c1d54f383e2f210905d4fa406384876e8e /testcases
parent7c7e82c2fbd4b08c4d0c322aa8c1379926db4d00 (diff)
Bugfix: can not find tempest.log
JIRA: FUNCTEST-269 Remove dependency on CI_DEBUG and use subprocess.call to redirect stdout to tempest.log in any case. Change-Id: Ibac68bec7f98007d24def25fd609051b5c528fc7 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testcases')
-rw-r--r--testcases/OpenStack/tempest/run_tempest.py45
1 files changed, 21 insertions, 24 deletions
diff --git a/testcases/OpenStack/tempest/run_tempest.py b/testcases/OpenStack/tempest/run_tempest.py
index 93581f0a9..f77332137 100644
--- a/testcases/OpenStack/tempest/run_tempest.py
+++ b/testcases/OpenStack/tempest/run_tempest.py
@@ -256,30 +256,27 @@ def run_tempest(OPTION):
cmd_line = "rally verify start " + OPTION + " --system-wide"
CI_DEBUG = os.environ.get("CI_DEBUG")
- if CI_DEBUG == "true" or CI_DEBUG == "True":
- ft_utils.execute_command(cmd_line, logger, exit_on_error=True)
- else:
- 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_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=f_stdout, stderr=f_stderr)
-
- f_stdout.close()
- f_stderr.close()
- f_env.close()
-
- cmd_line = "rally verify show"
- ft_utils.execute_command(cmd_line, logger,
- exit_on_error=True, info=True)
+ 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_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=f_stdout, stderr=f_stderr)
+
+ f_stdout.close()
+ f_stderr.close()
+ f_env.close()
+
+ cmd_line = "rally verify show"
+ ft_utils.execute_command(cmd_line, logger,
+ exit_on_error=True, info=True)
cmd_line = "rally verify list"
logger.debug('Executing command : {}'.format(cmd_line))