Commit Graph

154 Commits

Author SHA1 Message Date
Liam Young
76c539bae8 Fix typo 2018-05-31 09:23:40 +01:00
Liam Young
12317054d2 Lint fixes 2018-05-31 09:06:03 +01:00
Liam Young
56c8d60dcd Add tests for testing the glance charm
* 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
2018-05-30 13:40:50 +01:00
Frode Nordahl
f724044e4a Merge pull request #53 from gnuoy/more_blocks
Another batch of zaza.model helpers
2018-05-22 16:51:18 +02:00
Liam Young
313f7bee02 Remove debug print 2018-05-22 15:34:58 +01:00
Liam Young
86d641e333 Minor tidy 2018-05-22 15:33:34 +01:00
Liam Young
cbc14e32c6 Another batch of zaza.model helpers
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.
2018-05-22 15:28:28 +01:00
Liam Young
41b234e1f6 Merge pull request #52 from fnordahl/add-loglevel-command-line-argument
Add command line argument to set loglevel
2018-05-22 08:14:15 +01:00
Frode Nordahl
4f2abc87c8 Add unit tests for loglevel command line argument parsing 2018-05-22 09:05:44 +02:00
Frode Nordahl
d28784ce9c Add command line argument to set loglevel 2018-05-17 00:29:09 +02:00
Liam Young
8ca82a6dd5 Merge pull request #48 from openstack-charmers/dragent-infer-asn-from-deployment
Infer ASn from deployment for BGP speaker test configuration
2018-05-16 08:49:44 +01:00
Frode Nordahl
7a9d11973e Correct parameter name in docstring 2018-05-16 07:10:54 +02:00
Frode Nordahl
c4c2075532 Add unit test for model.get_relation_id() 2018-05-16 07:10:31 +02:00
Frode Nordahl
64b2d3de8b Infer ASn from deployment for BGP speaker test configuration 2018-05-15 21:59:19 +02:00
Liam Young
bb2d3531b4 Test Vault certificates relation (#49)
* Test vault issuing certs

* Fixes to bring tests inline with helpers

* Update action name
2018-05-15 15:02:06 +01:00
Frode Nordahl
3684d199d5 Fix incorrect import
setup_logging() moved from utilities.generic -> utilities.cli
2018-05-15 08:17:12 +02:00
Frode Nordahl
8655e2d684 Merge pull request #50 from thedac/controller
Controller Module and Functional Break up of Utilities
2018-05-14 20:00:51 +02:00
David Ames
ab431a58ad Fix misspelling of utilities 2018-05-14 10:49:49 -07:00
David Ames
a73f513b97 Shortname utilitites 2018-05-14 10:49:49 -07:00
David Ames
f2982a4f1f Split _local_utils into functional modules
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.
2018-05-14 10:49:49 -07:00
David Ames
ea120ee0a5 Add controller module
The controller module allows us to run commands against the controller
including listing all models and getting the cloud configuration name.
2018-05-14 10:49:49 -07:00
Liam Young
4cf4b7b5c4 Merge pull request #51 from fnordahl/add-generate-cert-san
Add support for generating certs with multiple SANs
2018-05-11 16:31:40 +01:00
Frode Nordahl
8906f7a8c1 Add support for generating certs with multiple SANs 2018-05-11 12:02:29 +02:00
David Ames
59f304147f Merge pull request #47 from gnuoy/feature/check-file-contents
Add block_until_file_has_contents helper
2018-05-08 09:39:05 -07:00
Liam Young
c7a8960036 Break up async_block_until_file_has_contents
Refactor so that async_block_until_file_has_contents
in a specialisation of async_block_until_file_ready
2018-05-08 12:19:21 +00:00
Liam Young
1cf86356dd Fixed a few docstring errors 2018-05-08 08:52:33 +00:00
Liam Young
458a7207d8 Add block_until_file_has_contents helper
Add a helper which will block until a string appears in a particular
file of an application.
2018-05-08 08:48:19 +00:00
Frode Nordahl
d865cd67e8 Merge pull request #46 from thedac/enable-mojo
Bug fixes for mojo's use of zaza
2018-05-07 07:42:17 +02:00
David Ames
77c7f896f7 Bug fixes for mojo's use of zaza
Now with more unit tests!
A couple of minor bug fixes exposed while testing mojo's use of zaza.
2018-05-04 23:09:34 +00:00
Frode Nordahl
85fb7e7f77 Merge pull request #45 from gnuoy/feature/sign-csrs
Add method for signing csrs
2018-05-03 19:21:54 +02:00
Liam Young
34c6431658 Add method for signing csrs 2018-05-03 16:30:06 +00:00
Liam Young
afdee65966 Merge pull request #44 from openstack-charmers/add-utilities-generate-cert
Add utility helper function for generating X.509 certs
2018-05-03 12:03:03 +01:00
Alex Kavanagh
e53b4087e6 Merge pull request #43 from thedac/enable-mojo
Functionality to enable mojo's use of zaza
2018-05-01 17:42:50 +01:00
Frode Nordahl
092c3c1f6b Add utility helper function for generating X.509 certs 2018-05-01 14:17:10 +02:00
David Ames
ae257a0955 Functionality to enable mojo's use of zaza
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.
2018-04-30 16:13:50 +00:00
Liam Young
a314a82d27 Always use startswith for checking WL status msgs (#42)
Currently there is no way for the tests.yaml to specify if the
expected workload status message should be checked as a prefix
or as an exact match. I think the prefix approach actually covers
all our use cases so rather than complicate the tests.yaml
options lets just always use startswith for checks.
2018-04-26 11:30:19 +01:00
Ryan Beisner
dad189ca04 Merge pull request #41 from thedac/rename-get-network-config
Rename get_net_info to get_network_config
2018-04-25 20:10:59 -05:00
David Ames
1461761fb8 Rename get_net_info to get_network_config
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.
2018-04-25 15:51:33 -07:00
David Ames
eb78f54508 Merge pull request #40 from gnuoy/increase-deploy-timeout
Bump deploy timeout
2018-04-25 12:07:21 -07:00
Liam Young
34b6f5638a Bump deploy timeout 2018-04-25 18:32:35 +00:00
Frode Nordahl
2698e60ecf Merge pull request #39 from gnuoy/bug/status-race
Fix race in checking deployment complete
2018-04-25 12:49:41 +02:00
Liam Young
d00af5028e Fix race in checking deployment complete
If the deployment state is assessed before any units have been
provisioned then the checks passes as there are no active units
or units with bad states etc. So, wait for at least one unit to
be provisioned before running checks
2018-04-25 10:32:46 +00:00
Liam Young
68114544bd Add the ability to wait for bespoke statuses (#38)
* 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
2018-04-25 09:48:31 +01:00
Liam Young
9ad502c58c Merge pull request #35 from thedac/issue/34
Use short model names
2018-04-21 07:32:01 +01:00
David Ames
bc89acd838 Merge pull request #24 from gnuoy/feature/optionally-pass-bundle-to-runner
Add option to allow bundle name to be passed to runner
2018-04-20 14:54:38 -07:00
David Ames
b4d55caf19 Use uuid.uuid4 to generate model name
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.
2018-04-20 11:25:24 -07:00
David Ames
8464efab7e Use short model names
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
2018-04-20 10:44:31 -07:00
Frode Nordahl
a87da7afd1 Merge pull request #30 from thedac/feature/dragent
Neutron dynamic routing testing
2018-04-20 19:40:34 +02:00
David Ames
aa6d170a6c Use tenacity for binary back off
Use the tenacity module to handle retry and binary back off of test
BGP test assertions.
2018-04-20 10:22:22 -07:00
Frode Nordahl
42561c71bc Merge pull request #37 from gnuoy/bug/fix-leader-action
Vault charm action needs to be run on leader
2018-04-20 15:57:53 +02:00