Use tempest workspace to avoid conflicts with any charm unit test .stestr config

This commit is contained in:
Corey Bryant
2020-03-05 14:24:55 +00:00
parent 2eaa55bd51
commit a8a6e72ef3
2 changed files with 12 additions and 4 deletions

View File

@@ -148,15 +148,15 @@ def render_tempest_config(target_file, ctxt, tempest_template):
def setup_tempest(tempest_template, accounts_template):
try:
os.makedirs('tempest/etc/')
os.makedirs('tempest_workspace/etc/')
except FileExistsError:
pass
render_tempest_config(
'tempest/etc/tempest.conf',
'tempest_workspace/etc/tempest.conf',
get_tempest_context(),
tempest_template)
render_tempest_config(
'tempest/etc/accounts.yaml',
'tempest_workspace/etc/accounts.yaml',
get_tempest_context(),
accounts_template)

View File

@@ -12,8 +12,16 @@ class TempestTest():
test_runner = zaza.charm_lifecycle.test.DIRECT
def run(self):
tempest_options = ['init', 'tempest_workspace']
the_app = tempest.cmd.main.Main()
print(tempest_options)
_exec_tempest = the_app.run(tempest_options)
#if not _exec_tempest:
# return False
charm_config = zaza.charm_lifecycle.utils.get_charm_config()
tempest_options = ['run', '--config', 'tempest/etc/tempest.conf']
tempest_options = ['run', '--config', 'tempest_workspace/etc/tempest.conf',
'--workspace', 'tempest_workspace']
for model_alias in zaza.model.get_juju_model_aliases().keys():
tempest_test_key = model_alias
if model_alias == zaza.charm_lifecycle.utils.DEFAULT_MODEL_ALIAS: