Add heat_plugin support

Some options required by heat_plugin will be set automatically
by tempestconf in order to generate a tempest.conf which can
pass at least some heat tempest plugin tests and make user's
life easier.

Story: 2005456
Task: 30509

Change-Id: I69da92e63bc0c0a676a5b9afa0754c530fad2b5a
This commit is contained in:
Martin Kopec 2019-03-22 08:25:28 +00:00
parent 507940a586
commit 50920bd50b
2 changed files with 48 additions and 0 deletions

View File

@ -25,3 +25,44 @@ class OrchestrationService(Service):
@staticmethod
def get_codename():
return 'heat'
def set_default_tempest_options(self, conf):
uri = conf.get('identity', 'uri')
if 'v3' not in uri:
return
sec = 'heat_plugin'
# Tempest doesn't differentiate between admin or demo creds anymore
username = conf.get('auth', 'admin_username')
password = conf.get('auth', 'admin_password')
conf.set(sec, 'username', username)
conf.set(sec, 'password', password)
conf.set(sec, 'admin_username', username)
conf.set(sec, 'admin_password', password)
conf.set(sec, 'project_name', conf.get('identity', 'project_name'))
conf.set(sec, 'region', conf.get('identity', 'region'))
conf.set(sec, 'auth_url', uri)
v = '3' if conf.get('identity', 'auth_version') == 'v3' else '2'
conf.set(sec, 'auth_version', v)
domain_name = conf.get('auth', 'admin_domain_name')
conf.set(sec, 'project_domain_name', domain_name)
conf.set(sec, 'user_domain_name', domain_name)
conf.set(sec, 'image_ssh_user', 'root')
conf.set(sec, 'network_for_ssh', 'public')
conf.set(sec, 'fixed_network_name', 'public')
# should be set to True if using self-signed SSL certificates which
# is a general case
conf.set(sec, 'disable_ssl_certificate_validation', 'True')
def post_configuration(self, conf, is_service):
conf.set('heat_plugin', 'minimal_instance_type',
conf.get('compute', 'flavor_ref'))
conf.set('heat_plugin', 'instance_type',
conf.get('compute', 'flavor_ref_alt'))
conf.set('heat_plugin', 'minimal_image_ref',
conf.get('compute', 'image_ref'))
conf.set('heat_plugin', 'image_ref',
conf.get('compute', 'image_ref_alt'))

View File

@ -0,0 +1,7 @@
---
features:
- |
A support for heat-tempest-plugin is added to python-tempestconf which
means, that some options required by heat_plugin will be set automatically
in order to generate a tempest.conf which can pass at least some
heat-tempest-plugin tests and make user's life easier.