diff --git a/zaza/openstack/charm_tests/tempest/setup.py b/zaza/openstack/charm_tests/tempest/setup.py index 6d7c26e..04d4bf9 100644 --- a/zaza/openstack/charm_tests/tempest/setup.py +++ b/zaza/openstack/charm_tests/tempest/setup.py @@ -154,18 +154,36 @@ def render_tempest_config(target_file, ctxt, tempest_template): def setup_tempest(tempest_template, accounts_template): - tempest_workspace = 'tempest_workspace' + config_dir = '.tempest' + config_etc_dir = os.path.join(config_dir, 'etc') + config_etc_tempest = os.path.join(config_etc_dir, 'tempest.conf') + config_workspace_yaml = os.path.join(config_dir, 'workspace.yaml') + workspace_name = 'workspace' + workspace_dir = os.path.join(config_dir, workspace_name) + workspace_etc_dir = os.path.join(workspace_dir, 'etc') + workspace_etc_accounts = os.path.join(workspace_etc_dir, 'accounts.yaml') + workspace_etc_tempest = os.path.join(workspace_etc_dir, 'tempest.conf') the_app = tempest.cmd.main.Main() - tempest_options = ['init', '--workspace-path', './.tempest/workspace.yaml', - tempest_workspace] + + # note sure this is needed or not + if not os.path.isdir(config_dir): + os.mkdir(config_dir) + os.mkdir(config_etc_dir) + render_tempest_config( + config_etc_tempest, + get_tempest_context(), + tempest_template) + tempest_options = ['init', '--workspace-path', config_workspace_yaml, + '--name', workspace_name, workspace_dir] print(tempest_options) _exec_tempest = the_app.run(tempest_options) + # This was mising /etc/tempest/ and just going to /etc/ render_tempest_config( - os.path.join(tempest_workspace, 'etc/tempest.conf'), + workspace_etc_tempest, get_tempest_context(), tempest_template) render_tempest_config( - os.path.join(tempest_workspace, 'etc/accounts.yaml'), + workspace_etc_accounts, get_tempest_context(), accounts_template) diff --git a/zaza/openstack/charm_tests/tempest/tests.py b/zaza/openstack/charm_tests/tempest/tests.py index 27e12ed..9bc6221 100644 --- a/zaza/openstack/charm_tests/tempest/tests.py +++ b/zaza/openstack/charm_tests/tempest/tests.py @@ -14,11 +14,16 @@ class TempestTest(): def run(self): charm_config = zaza.charm_lifecycle.utils.get_charm_config() - tempest_workspace = 'tempest_workspace' + config_dir = '.tempest' + config_workspace_yaml = os.path.join(config_dir, 'workspace.yaml') + workspace_name = 'workspace' + workspace_dir = os.path.join(config_dir, workspace_name) + workspace_etc_dir = os.path.join(workspace_dir, 'etc') + workspace_etc_tempest = os.path.join(workspace_etc_dir, 'tempest.conf') tempest_options = ['run', '--config-file', - os.path.join(tempest_workspace, 'etc/tempest.conf'), - '--workspace-path', './.tempest/workspace.yaml', - '--workspace', tempest_workspace] + workspace_etc_tempest, + '--workspace-path', config_workspace_yaml, + '--workspace', workspace_name] 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: