summaryrefslogtreecommitdiffstats
path: root/testcases
diff options
context:
space:
mode:
Diffstat (limited to 'testcases')
-rw-r--r--testcases/features/promise.py5
-rw-r--r--testcases/functest_utils.py7
2 files changed, 7 insertions, 5 deletions
diff --git a/testcases/features/promise.py b/testcases/features/promise.py
index f361d8ba6..0dc755b57 100644
--- a/testcases/features/promise.py
+++ b/testcases/features/promise.py
@@ -181,15 +181,15 @@ def main():
os.environ["OS_TEST_IMAGE"] = image_id
os.environ["OS_TEST_FLAVOR"] = flavor_id
+ os.chdir(PROMISE_REPO)
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 = subprocess.call(cmd, shell=True, stdout=results_file, \
stderr=subprocess.STDOUT)
-
+ results_file.close()
end_time_ts = time.time()
duration = round(end_time_ts - start_time_ts, 1)
@@ -201,6 +201,7 @@ def main():
test_status = "Failed"
# Print output of file
+ results_file=open('promise-results.json','r')
print results_file.read()
results_file.close()
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index 21fd8cc2f..b3549ee93 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -88,8 +88,8 @@ def get_instance_status(nova_client, instance):
instance = nova_client.servers.get(instance.id)
return instance.status
except Exception, e:
- print "Error [get_instance_status(nova_client, instance)]:" % \
- str(instance), e
+ print "Error [get_instance_status(nova_client, '%s')]:" % \
+ str(instance), e
return None
@@ -98,7 +98,8 @@ def get_instance_by_name(nova_client, instance_name):
instance = nova_client.servers.find(name=instance_name)
return instance
except Exception, e:
- print "Error [get_instance_by_name(nova_client, '%s')]:" %instance_name, e
+ print "Error [get_instance_by_name(nova_client, '%s')]:" % \
+ instance_name, e
return None