Code Review
/
functest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add tempest section in rally.conf
[functest.git]
/
functest
/
opnfv_tests
/
openstack
/
tempest
/
tempest.py
diff --git
a/functest/opnfv_tests/openstack/tempest/tempest.py
b/functest/opnfv_tests/openstack/tempest/tempest.py
index
9e200bb
..
a7d608b
100644
(file)
--- a/
functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/
functest/opnfv_tests/openstack/tempest/tempest.py
@@
-254,6
+254,7
@@
class TempestCommon(singlevm.VmReady1):
"""Set image name as tempest img_name_regex"""
rconfig = configparser.RawConfigParser()
rconfig.read(rally_conf)
"""Set image name as tempest img_name_regex"""
rconfig = configparser.RawConfigParser()
rconfig.read(rally_conf)
+ rconfig.add_section('tempest')
rconfig.set('tempest', 'img_name_regex', '^{}$'.format(
self.image.name))
with open(rally_conf, 'wb') as config_file:
rconfig.set('tempest', 'img_name_regex', '^{}$'.format(
self.image.name))
with open(rally_conf, 'wb') as config_file:
@@
-286,7
+287,8
@@
class TempestCommon(singlevm.VmReady1):
def run(self, **kwargs):
self.start_time = time.time()
try:
def run(self, **kwargs):
self.start_time = time.time()
try:
- super(TempestCommon, self).run(**kwargs)
+ assert super(TempestCommon, self).run(
+ **kwargs) == testcase.TestCase.EX_OK
self.update_rally_regex()
self.configure(**kwargs)
self.generate_test_list(**kwargs)
self.update_rally_regex()
self.configure(**kwargs)
self.generate_test_list(**kwargs)
@@
-297,6
+299,7
@@
class TempestCommon(singlevm.VmReady1):
res = testcase.TestCase.EX_OK
except Exception: # pylint: disable=broad-except
LOGGER.exception('Error with run')
res = testcase.TestCase.EX_OK
except Exception: # pylint: disable=broad-except
LOGGER.exception('Error with run')
+ self.result = 0
res = testcase.TestCase.EX_RUN_ERROR
self.stop_time = time.time()
return res
res = testcase.TestCase.EX_RUN_ERROR
self.stop_time = time.time()
return res
@@
-306,5
+309,7
@@
class TempestCommon(singlevm.VmReady1):
Cleanup all OpenStack objects. Should be called on completion.
"""
super(TempestCommon, self).clean()
Cleanup all OpenStack objects. Should be called on completion.
"""
super(TempestCommon, self).clean()
- self.cloud.delete_image(self.image_alt)
- self.orig_cloud.delete_flavor(self.flavor_alt.id)
+ if self.image_alt:
+ self.cloud.delete_image(self.image_alt)
+ if self.flavor_alt:
+ self.orig_cloud.delete_flavor(self.flavor_alt.id)