The local overlay ('local-charm-overlay.yaml') is generated on the
fly during deploy time and it assumes that the application name
will match the charm name. However this is not always the case so
allow charms to override the deploy time generated template with
one from the local tests/bundle/overlay directory.
This is really another stop-gap until the whole bundle generation
piece is rewritten.
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
Currently interacting with functions in zaza.model requires the
model to be passed in. This has resulted in multiple calls to
get_juju_model(). It is cleaner to push these calls down into
the model wrapper and make the model_name an optional
argument. In addition, the current model name is now cached
without having to check the os.env each time.
Unfortunately this has resulted in the signature changing on a
great many function so this diff is bigger than would normally
be desirable.
Recently functions were added to zaza.model for adding and removing
models. These duplicated existing functions in zaza.controller.
Given these functions act against the controller, zaza.controller
feels like the correct location. In addition the implementations in
zaza.controller correctly handle disconnects which the new ones
did not.
This PR removes the duplicates and points any existing references
from zaza.model to zaza.controller. Finally, docstrings were added
and documentation links.
* 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
This pr adds a number of new fuctions to zaza.model. As discussed
zaza.model needs to be broken up as it has become too large. I would
like to continue the discussion around that and submit a subsequent
patch for that at a later date.
The _local_utils module was misnamed as the utilities it contained
may be used outside of zaza proper. For example in mojo.
This change separates the utilities into functional modules:
cli_utils: For utilities pertaining to running scripts from command line.
juju_utils: For utilities pertaining to juju commands.
generic_utils: For helper utilities that are generic in nature.
Without introducing mojoisms into zaza there are some changes that are
required to enable mojo's use of zaza.
The goal is to keep mojo specific utilities in openstack-mojo-specs and
to move any generalized tools here in zaza.
This change updates some generalized zaza tools to enable mojo to use
them.
The configure.network script had already made this change. Using
run_from_cli ran into the fact that it was not changed in
utilities._local_utils.
Update for consistency.
* Add the ability to wait for bespoke statuses
This change adds the ability to wait for bespoke work load
statuses and messages. These are defined in the charms tests.yaml
* Add unit tests
* Remove debug print
* Fix typos and add checks for errored units
* Restore juju_wait as openstack_utils imports it
Take the last 12 characters from a uuid for generating the model name.
uuid.uuid4 takes into account the host and the current timestamp and
should be sufficient for our needs.
Issue #34 Long model names cause OpenStack DNS to break. We gain fairly
little by stacking information in the model name.
This change uses zaza-$TIMESTAMP as model names.
Closes Issue: #34
The vault charm action to authorise the charm within vault needs to
be run on the leader. This mp adds run_action_on_leader to support
that and updates the tests.
Models which are created by Zaza should enable test mode,
to prevent artificially ticking metrics in the charm store for charm usage.
In addition, models must not retry failed hooks as we
consider a hook failure to be an error.
Closes#33
Changed the name of configure_dragent
Removed the network.yaml file requirement for tests
Made a bright line distinction between declared overcloud network
settings and environment specific undercloud settings
The tests will declare the overcloud settings and acquire the
undercloud settings from environment variables.
Add tests for the authorize-charm action on the vault app. To
support this add get_action method to return an applications
actions. However, this is not implemented in libjuju yet so
fallback to subprocess
Add the testing required for neutron dynamic routing A.K.A dragent.
Create the zaza.charm_tests.dragent module for testing neutron dynamic
routing.
Create the zaza.configure module for reusable configuration tools.
Update utilities to simplify authenticating clients.
Stop requiring the charm to ship with a boiler plate overlay for
setting a relative path for local charm location. Instead render the
overlay from a string var. As part of this some of the template
rendering code was refactored.