Commit Graph

41 Commits

Author SHA1 Message Date
Liam Young ea7336a67e Allow model constraints to be passed via env vars
Allow model constraints to be applied to models that zaza
creates.
2018-07-13 12:36:14 +00:00
Liam Young 08aacfd0ec Allow model settings to be added or overridden 2018-07-12 12:03:12 +01:00
Liam Young 9b26376a19 A few fixes 2018-06-14 06:20:05 +01:00
Liam Young 9d06bb890f Move call to get_juju_model() down to run_in_model
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.
2018-06-14 06:19:26 +01:00
David Ames eaab059c62 Merge pull request #67 from gnuoy/more-docstring-tidy
More docstring tidy
2018-06-13 15:17:38 -07:00
Liam Young c2b8992b2e More docstring tidyup 2018-06-13 13:35:32 +01:00
Liam Young 0aa7c61719 Remove duplicate functions for add/remove model
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.
2018-06-13 09:49:33 +01:00
Frode Nordahl a0e9064f2b Merge pull request #62 from gnuoy/remove-model-subprocesses
Use libjuju for adding and removing models
2018-06-07 10:33:07 +02:00
Liam Young b21767ce52 Use libjuju for adding and removing models
libjuju supports adding and removing models so replace calls out
to subprocess with libjuju calls
2018-06-06 12:28:08 +01:00
Liam Young 0a8ac0faa4 Fix truly awful spelling mistakes 2018-06-06 10:22:14 +01:00
Liam Young 056d2f41c2 Split up docs and reformat
* Move contents of ./zaza/charm_lifecycle/README.md into docs
* Split up api docs into seperate pages
* Fix prepare command help string
2018-06-06 09:38:13 +01:00
Frode Nordahl d28784ce9c Add command line argument to set loglevel 2018-05-17 00:29:09 +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 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
Chris MacNaughton 5e8dd1654d Ensure we use default model constraints
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
2018-04-20 08:25:04 +02:00
David Ames 4278e5822d Neutron dynamic routing testing
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.
2018-04-18 16:14:23 -07:00
James Page be4e9732fe Merge pull request #25 from gnuoy/feature/generate-local-charm-overlay
Render local charm overlay from string
2018-04-18 10:31:43 +01:00
Liam Young 56b0f556a6 Add the missing t 2018-04-18 08:57:38 +00:00
Liam Young 924c76ca84 Fix lint 2018-04-18 07:40:25 +00:00
Liam Young 2e522f2ab4 Render local charm overlay from string
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.
2018-04-18 07:35:55 +00:00
Liam Young 1bbb092aa6 Add option to allow bundle name to be passed to runner 2018-04-17 16:00:14 +00:00
Liam Young 05e02a94cd Add zaza to generated model name 2018-04-17 13:21:49 +00:00
Liam Young ed98e8f02d Stop missing overlay templates from being fatal
Not all deployments will use overlays so a missing template should
not be fatal
2018-04-17 12:00:17 +00:00
Liam Young e21dc50fdd Update readme 2018-04-16 14:21:35 +00:00
Liam Young 51fb79c24f More env var refinement 2018-04-16 14:17:57 +00:00
Liam Young 7f09add0d0 Switch to OS_ as the prefix for environment variables that can be used in overlay template rendering 2018-04-16 14:13:23 +00:00
Liam Young e22fa7bbf5 Add support for model specific bundle overlays
This change adds support for model specific overlays from
templates which are rendered at deploy time.

The overlay template directory will be searched for a corresponding
template (<bundle_name>.j2). If one is found then the overlay will
be rendered using environment variables matching AMULET* or
ZAZA_TEMPLATE* as a context. The rendered overlay will be used on
top of the specified bundle at deploy time.

A default overlay is always applied "local-charm-overlay.yaml". This
overlay is only used to move the location of the charm being deployed
to a relative path so the bundle can use "charm: <charm name>" rather
than "charm: ../../../<charm name>"
2018-04-16 13:26:33 +00:00
Liam Young 67984a231b Fix juju wait to work against correct model
juju_wait assumes it is working against the current model so
explicitly set the JUJU_MODEL env variable before calling it
to ensure it monitors the correct environment
2018-04-12 15:31:55 +00:00
Liam Young a78f76e576 Fix tox target names in example 2018-04-12 13:45:22 +00:00
Liam Young f99af2f14c Add support for running smoke tests
Add --smoke switch to functest-run-suite to allow just the smoke
tests for a charm to be run. This requires that the smoke test
bundles are listed in the charms tests/tests.yaml
2018-04-12 12:43:07 +00:00
Liam Young a096956350 Preserve osci's keep the last model behaviour 2018-04-11 14:52:17 +00:00
Liam Young 3b90ed1a50 Add option to functest-run-suite to skip model deletion 2018-04-11 14:23:41 +00:00
Liam Young 9bdd4763cc Close event loop in func_test_runner.main 2018-03-28 12:00:53 +00:00
Liam Young cb5d9caf66 Misc fixes to functional testing code
* Add calls to asyncio.get_event_loop().close() to close loop. libjuju does
  not do this for you and needs to be done just before exiting.
* Require model to be explicitly set when running command line tools. This is
  part of the drive to ensure that eventually multiple runs can be performed
  concurrently.
* Add set_juju_model/get_juju_model functions to manage which model is in
  focus
2018-03-28 11:48:53 +00:00
Liam Young 3d190f68f3 Fix generate_model_name 2018-03-27 12:45:59 +00:00
Liam Young 353559528b s/charm_testing/charm_lifecycle/ and unit tests 2018-03-27 12:35:38 +00:00