Validation support

validation.image_ssh_user option is heavily used in CI and it's also needed
in refstack. Therefor set the value automatically when image used is cirros.

Change-Id: Ib823380225fda78462c727e50a0f4f82b6da4e74
This commit is contained in:
Martin Kopec 2018-05-28 15:12:33 +00:00
parent 1e3caa063c
commit 275b6b7591
4 changed files with 28 additions and 13 deletions

View File

@ -377,7 +377,7 @@ def config_tempest(**kwargs):
image = services.get_service('image') image = services.get_service('image')
image.set_image_preferences(kwargs.get('create', False), image.set_image_preferences(kwargs.get('create', False),
kwargs.get('image_name', C.DEFAULT_IMAGE), kwargs.get('image_path', C.DEFAULT_IMAGE),
kwargs.get('image_disk_format', kwargs.get('image_disk_format',
C.DEFAULT_IMAGE_FORMAT)) C.DEFAULT_IMAGE_FORMAT))
image.create_tempest_images(conf) image.create_tempest_images(conf)
@ -416,7 +416,7 @@ def main():
cloud_creds=cloud_creds, cloud_creds=cloud_creds,
debug=args.debug, debug=args.debug,
deployer_input=args.deployer_input, deployer_input=args.deployer_input,
image_name=args.image, image_path=args.image,
image_disk_format=args.image_disk_format, image_disk_format=args.image_disk_format,
network_id=args.network_id, network_id=args.network_id,
non_admin=args.non_admin, non_admin=args.non_admin,

View File

@ -44,6 +44,13 @@ class ImageService(VersionedService):
self.image_path = image_path self.image_path = image_path
self.disk_format = disk_format self.disk_format = disk_format
def set_default_tempest_options(self, conf):
# When cirros is the image, set validation.image_ssh_user to cirros.
# The option is heavily used in CI and it's also usefull for refstack,
# because we don't have to specify overrides.
if 'cirros' in self.image_path.rsplit('/')[-1]:
conf.set('validation', 'image_ssh_user', 'cirros')
def set_versions(self): def set_versions(self):
super(ImageService, self).set_versions(top_level=False) super(ImageService, self).set_versions(top_level=False)

View File

@ -27,13 +27,6 @@ admin_project_name=admin
admin_domain_name=Default admin_domain_name=Default
[compute]
# Should the tests ssh to instances? (boolean value)
#run_ssh=false $$$ REDHAT: use true
# This parameter is deprecated and will be removed in a future release
image_ssh_user = cirros
[identity] [identity]
# Full URI of the OpenStack Identity API (Keystone), v3 # Full URI of the OpenStack Identity API (Keystone), v3
@ -132,6 +125,3 @@ preserve_ports=true
[network-feature-enabled] [network-feature-enabled]
# Added in juno # Added in juno
ipv6_subnet_attributes=true ipv6_subnet_attributes=true
[validation]
image_ssh_user = cirros

View File

@ -0,0 +1,18 @@
---
features:
- |
validation.image_sh_user option is heavily used in CI and it's also needed
in refstack. Therefor the value is set to cirros automatically from now
everytime when image used is cirros.
The hardcoded value in default-overrides.conf is removed.
other:
- |
By this change compute.image_ssh_user is removed from
default-overrides.conf too, because it was deprecated. All of the
image_ssh_user values from different sections were moved to validation
section by this change:
https://review.openstack.org/#/c/434097/
Since that change, there is only one image_ssh_user value and it's the one
under validation section.