summaryrefslogtreecommitdiffstats
path: root/testcases/features
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-01-27 15:20:49 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-01-27 17:59:51 +0000
commit9ad4eafd01cd8d860379abd6ac1b1f323da7b76d (patch)
tree2318457e57f5b27e537b23085722b9ed11dba6e9 /testcases/features
parentbb433f757c531c3d6dfae4e3ae89f93798afa2fd (diff)
Print json result file of Promise testcase
JIRA: FUNCTEST-68 Change-Id: Ib89e84b7f4d6f3cfe990655c941705af1da24bfb Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com> (cherry picked from commit 5c705a0c56af8d622edafa1e99e9806ba627754e)
Diffstat (limited to 'testcases/features')
-rw-r--r--testcases/features/promise.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/testcases/features/promise.py b/testcases/features/promise.py
index cc7cf0ab8..f361d8ba6 100644
--- a/testcases/features/promise.py
+++ b/testcases/features/promise.py
@@ -12,9 +12,11 @@
import argparse
import logging
import os
-import time
+import subprocess
import sys
+import time
import yaml
+
import keystoneclient.v2_0.client as ksclient
import glanceclient.client as glclient
import novaclient.client as nvclient
@@ -179,20 +181,30 @@ def main():
os.environ["OS_TEST_IMAGE"] = image_id
os.environ["OS_TEST_FLAVOR"] = flavor_id
- cmd = 'DEBUG=1 npm run -s test'
+ results_file=open('promise-results.json','w+')
+ cmd = 'DEBUG=1 npm run -s test -- --reporter json'
start_time_ts = time.time()
logger.info("Running command: %s" % cmd)
os.chdir(PROMISE_REPO)
- ret = functest_utils.execute_command(cmd, exit_on_error=False)
+ ret = subprocess.call(cmd, shell=True, stdout=results_file, \
+ stderr=subprocess.STDOUT)
end_time_ts = time.time()
duration = round(end_time_ts - start_time_ts, 1)
- test_status = 'Failed'
- if ret:
+
+ if ret == 0:
+ logger.info("The test succeeded.")
test_status = 'OK'
+ else:
+ logger.info("The command '%s' failed." % cmd)
+ test_status = "Failed"
+
+ # Print output of file
+ print results_file.read()
+ results_file.close()
+
- logger.info("Test status: %s" % test_status)
details = {
'timestart': start_time_ts,
'duration': duration,