cleanup
This commit is contained in:
@@ -25,7 +25,6 @@ import zaza.openstack.charm_tests.glance.setup as glance_setup
|
||||
import zaza.openstack.charm_tests.tempest.templates.tempest_v2 as tempest_v2
|
||||
import zaza.openstack.charm_tests.tempest.templates.tempest_v3 as tempest_v3
|
||||
import zaza.openstack.charm_tests.tempest.templates.accounts as accounts
|
||||
#import tempest.cmd.main
|
||||
|
||||
import keystoneauth1
|
||||
import novaclient
|
||||
@@ -154,49 +153,21 @@ def render_tempest_config(target_file, ctxt, tempest_template):
|
||||
|
||||
|
||||
def setup_tempest(tempest_template, accounts_template):
|
||||
#try:
|
||||
# os.makedirs('tempest/etc/')
|
||||
#except FileExistsError:
|
||||
# pass
|
||||
if os.path.isdir('tempest-workspace'):
|
||||
try:
|
||||
subprocess.check_call(['tempest', 'workspace', 'remove', '--rmdir', '--name', 'tempest-workspace'])
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
#shutil.rmtree('tempest-workspace')
|
||||
subprocess.check_call(['tempest', 'init', '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()
|
||||
|
||||
# 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/
|
||||
try:
|
||||
subprocess.check_call(['tempest', 'init', 'tempest-workspace'])
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
render_tempest_config(
|
||||
'tempest-workspace/etc/tempest.conf',
|
||||
#workspace_etc_tempest,
|
||||
get_tempest_context(),
|
||||
tempest_template)
|
||||
render_tempest_config(
|
||||
'tempest-workspace/etc/accounts.yaml',
|
||||
#workspace_etc_accounts,
|
||||
get_tempest_context(),
|
||||
accounts_template)
|
||||
|
||||
|
||||
@@ -17,16 +17,6 @@ class TempestTest():
|
||||
charm_config = zaza.charm_lifecycle.utils.get_charm_config()
|
||||
tempest_options = ['tempest', 'run', '--workspace', 'tempest-workspace',
|
||||
'--config', 'tempest-workspace/etc/tempest.conf']
|
||||
#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',
|
||||
# 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:
|
||||
@@ -56,10 +46,6 @@ class TempestTest():
|
||||
f.write('\n')
|
||||
tempest_options.extend(['--blacklist-file', black_file])
|
||||
print(tempest_options)
|
||||
#the_app = tempest.cmd.main.Main()
|
||||
#project_root = os.getcwd()
|
||||
#_exec_tempest = the_app.run(tempest_options)
|
||||
#os.chdir(project_root)
|
||||
try:
|
||||
subprocess.check_call(tempest_options)
|
||||
except subprocess.CalledProcessError:
|
||||
|
||||
Reference in New Issue
Block a user