It is likely that there are other commands that we
would like to run in our tests, so this is a new SSH
command runner that the existing SSH check has been
updated to use.
resource_removed is used in many places to monitor removal of
different kinds of OpenStack resource. It is reasonable to expect a
flavor to be removed in a few seconds where as an image based instance
may take minutes to be removed. With that in mind this change
exposes the retry options used by tenacity allowing the caller to
set reasonable expectations for the resource removal.
* Expose resource_reaches_status' retry options
resource_reaches_status is used in many places to monitor many
different kinds of OpenStack resource. It is reasonable to expect a
flavor to be created in a few seconds where as an image based instance
may take minutes to become active. With that in mind this change
exposes the retry options used by tenacity allowing the caller to
set reasonable expectations for the resource state change.
In addition the image based instance creation call is updated
to retry for longer as this has been timing out.
* Remove swap files
* Make image creation a noop if image already exists
* Two admin projects are created, one in the default domain and
one in the admin domain. To differentiate between them specify the
admin domain when searching for the project id. This, in turn, ensures
that the security group rules are applied to the correct 'default' security
group.
* Fix cirros image name
The get_undercloud_keystone_session function was mistakenly using the
get_keystone_scope function. The get_keystone_scope function is only
for use with the overcloud.
Use of the get_keystone_scope function mistakenly caused undercloud
authentication to mix overcloud authentication.
We would only see this when the overcloud is Liberty because only
liberty uses scope=DOMAIN with keystone v3.
It was a functionality available in charm helpers. It is implemented in
a similar way:
* Get the current series from the `keystone` machine
* Get the OS version from `get_current_os_versions`
* Try to find the built string in `OPENSTACK_RELEASES_PAIRS`
It is thus possible to compare release pairs as it returns integers.
This is a bundle of disparate changes that enable testing the
creating of a guest instance. At a high level these are:
* Add helpers for downloading ubuntu images.
* Add method for setting up a basic overcloud network. This is very
similar to zaza.configure.network.run_from_cli
* Add nova setup module that includes create_flavors and
manage_ssh_key
* Add nova test base class for launching an instance and two
derived classes for launching a cirros and lts image respectively.
* Fixes to zaza.charm_tests.test_utils after the refactor of the model
argument in zaza.models
* New certs.is_keys_valid function to check if a public and private
key are a pair.
* Methods in utilities.openstack for managing ssh keys. On creation of
a new key the private key is stored locally and the public key is
retrieved from Openstack
* Methods in utilities.openstack for testing guests at various points
of the creation process.
At present the check for which transport to use references a
configuration option that has been removed.
Update check to test for current configuration option plus
add a check for presence of `tls-certificates` relation.
Also remove insecure option and add verify option to allow
control of verification including providing own CA certificate
bundle.
Reference for verify option:
https://docs.openstack.org/keystoneauth/latest/api/keystoneauth1.html#keystoneauth1.session.Session
* Add OpenStackAPITest class which can be used by OpenStack API
charms. It provides the framework for common tests like pause
and resume. It also provides lower level entites like an
authenticated keystone session.
* Add generic openstack resource managment functions to
zaza.utilities.openstack. These are based on existing functions
in charmhelpers. Main difference is that they use tenacity to
manage retry logic and throw AssertionError if then required state
is not reached rather than returning True/False
* Add image management functions to zaza.utilities.openstack.
* Add set of glance setup/configuration/tests. These are equivalent
to the existing glance amulet tests with all the introspection
tests removed (see below for more detail).
Tests replicated here:
test_410_glance_image_create_delete
test_411_set_disk_format
test_900_glance_restart_on_config_change
test_901_pause_resume
Tests removed
test_100_services
test_102_service_catalog
test_104_glance_endpoint
test_106_keystone_endpoint
test_110_users
test_115_memcache
test_200_mysql_glance_db_relation
test_201_glance_mysql_db_relation
test_202_keystone_glance_id_relation
test_203_glance_keystone_id_relation
test_204_rabbitmq_glance_amqp_relation
test_205_glance_rabbitmq_amqp_relation
test_300_glance_api_default_config
test_302_glance_registry_default_config