Commit Graph

80 Commits

Author SHA1 Message Date
Liam Young c8ae64dc47 Ensure workload statuses and messages are reset for each app 2018-11-13 18:00:43 +00:00
Liam Young 12204594f9 Change check_unit_workload_status state to states to make it clearer 2018-11-13 17:32:35 +00:00
Liam Young 82e9f1b625 Accept bespoke workload statuses and default
When checking the readyness of an application check both the
bespoke status as defined in the tests.yaml and the default.
Closes issue 158.
2018-11-13 17:11:45 +00:00
David Ames 3791cd9ffd Update the upgrade-series command
Since https://github.com/juju/juju/pull/9395 the ordering of the
upgrade-series command has changed.

Update to match current juju.
2018-11-05 15:46:50 -08:00
David Ames 1fb704507b Use model.applications as a dict 2018-10-31 08:24:47 -07:00
David Ames 1d709bbddd Review requests
Pep8 fixes.
2018-10-31 07:39:38 -07:00
David Ames 348e7211cd Explicit Model Timeout Exception
When we timeout waiting for the model to be idle and have specific
workload statuses make that explicit.
2018-10-29 11:32:43 -07:00
David Ames 3338fe89ba More generic non leader first series upgrade
Make the series_upgrade_mongodb less specific to mongodb. We may
eventually use this to series upgrade vault.

Fix bug in the generalized series_upgrade_non_leaders_first.

Fix change in switch --agree to --yes.
2018-10-29 10:03:28 -07:00
Chris MacNaughton cc893ae851 Add tests derived from tests.yaml in the target directory 2018-10-17 09:20:23 +02:00
David Ames c5fe6ce723 Move upgrade series functions to zaza.model
Moving the upgrade series functions to zaza.model. Once the feature
stabilizes we can add functionality to libjuju and remove the
subprocess calls.
2018-09-12 08:22:09 -07:00
David Ames 8874fc7961 Fix docstrings 2018-09-12 08:22:09 -07:00
David Ames fb67806fc6 Use status output for block_until_unit_wl_status
unit.workload_status was actually reporting the application workload
status. Using the full status output from model.get_status() gives us
unit by unit workload status.

Updated block_until_unit_wl_status to use the full status output to
correctly block per unit.
2018-09-12 08:20:45 -07:00
Frode Nordahl 9eda316756 Merge pull request #119 from fnordahl/pause-lead-unit-in-key-rotation-test
Pause lead unit in key rotation test
2018-08-20 11:35:21 +02:00
Frode Nordahl f4f25716a2 Add get_lead_unit_name function 2018-08-20 09:49:55 +02:00
Frode Nordahl 6c5e06ed86 Merge pull request #109 from n-pochet/unit-from-name
Make `get_unit_from_name` use `model_name`
2018-08-17 09:01:48 +02:00
Nicolas Pochet 7b1441d953 Make get_unit_from_name use model_name 2018-08-17 08:58:16 +02:00
Frode Nordahl 2c39eb2c7a Merge pull request #110 from n-pochet/add-exception
Add `CommandRunFailed` exception
2018-08-17 08:44:50 +02:00
Nicolas Pochet fb39813bb1 Add CommandRunFailed exception
Add exception to make the exception's message building easier.
2018-08-17 08:23:39 +02:00
Frode Nordahl 4726db35af Fix race in test_utils.config_change()
When changing config we have a race that make the idle/ready
check run *before* the `config-changed` hook has started executing
on units.  Subsequently tests are sometimes executed before or while
configuration change is in progress, leading to intermittent false
negative test failures.

Fixes #113
2018-08-16 14:48:20 +02:00
Nicolas Pochet b84b24b72a Fix parameters passed to async_run_on_unit
Fixes #111
2018-08-14 11:02:33 +02:00
Nicolas Pochet 90491103ce Handle unit or app not found
Fixes #104
2018-08-09 16:42:21 +02:00
Nicolas Pochet 193e2657ff Add copyright header everywhere.
Also make flake8 happy in setup.py by adding docstrings.
2018-08-09 11:55:13 +02:00
Frode Nordahl 8dbe371d62 Make it possible to call run_action() without passing action_params
Fixes #94
2018-08-08 11:34:18 +02:00
Frode Nordahl e408be6719 Fix ordering of arguments in call to async_run_on_unit
Fixes #91
2018-08-08 10:56:25 +02:00
Frode Nordahl 200ba35d57 Add functions: run command on leader, get leader settings 2018-08-01 15:31:24 +02:00
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
Frode Nordahl cd29cee799 Merge pull request #79 from gnuoy/fix-stale-model-name
Update model name cache when switching models
2018-07-10 09:08:19 +02:00
Liam Young 3b738f279e Update model name cache when switching models
The model name cache needs to be updated when switching models
otherwise calls to get_juju_model get a stale results. Closes
2018-07-10 08:00:07 +01:00
Liam Young 294d8f5fd0 Cope with Workload status unknown messages
Some charms never implemented the workload status messages, these
charms have a wl status of unknown and wls message of ''. This fix
allows a wls of '' to be specified.
2018-07-09 15:17:07 +00:00
Chris MacNaughton 57ee4a3662 syntax fix and add unit test 2018-06-20 17:09:34 +02:00
Chris MacNaughton 063aadd4df add MODEL_NAME variable to determine model 2018-06-20 17:04:11 +02:00
Liam Young a5c15f9b7a Rebase 2018-06-15 10:49:39 +01:00
Liam Young 398c057007 Docstring tidy of zaza.model 2018-06-15 10:44:53 +01:00
Liam Young f0d91ae31b Fix caching of model name and remove debug lines 2018-06-14 06:23:26 +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 7b10df57d8 Merge pull request #61 from gnuoy/remove-timeout-workaround
Remove workaround for libjuju timeout bug
2018-06-13 15:18:15 -07: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 0353d300e1 Fix typos 2018-06-07 09:25:07 +01:00
Liam Young 0568fd17b7 Fix lint 2018-06-07 09:06:13 +01:00
Liam Young 0b6f6d88dc Documentation fixes 2018-06-06 15:54:06 +01: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 01bd9b88c9 Remove workaround for libjuju timeout bug
The timeout bug for libjuju run has been resolved:

https://github.com/juju/python-libjuju/commit/462989bbd919f209ebb7454305f53e4b94714487

so remove workaround.
2018-06-06 09:53:16 +01: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
Frode Nordahl 64b2d3de8b Infer ASn from deployment for BGP speaker test configuration 2018-05-15 21:59:19 +02: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 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