Commit Graph

119 Commits

Author SHA1 Message Date
Liam Young
d90da772d2 Expose resource_reaches_status' retry options (#206)
* 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
2019-03-27 13:02:47 +01:00
David Ames
02180fb178 Unit tests 2019-03-14 08:55:26 -07:00
Liam Young
5339ea9217 Add rtype info to docstrings 2019-03-07 16:31:35 +00:00
Liam Young
e9c7690af4 Enable masakari instance monitor tests
Add helpers and a test to test a guest dying and being resurrected
by masakari instance monitor.
2019-03-07 16:03:42 +00:00
Liam Young
3118f122b4 Misc methods to support vm migration tests
Misc methods to support vm migration tests.
2019-03-05 19:30:57 +00:00
Chris MacNaughton
774a49faef Support globstar for recursion 2019-01-29 14:49:03 +01:00
Chris MacNaughton
cd6ad8485f Allow file assertions to include globs 2019-01-29 14:03:47 +01:00
David Ames
9e62dae2ef Merge pull request #163 from fnordahl/add-ovs-and-octavia-tests
Add Octavia tests
2018-11-30 08:22:45 -08:00
David Ames
33b74f2da8 Use yaml.safe_load
We should be using yaml.safe_load and not yaml.load in all of our code.
2018-11-29 09:26:21 -08:00
Frode Nordahl
3fd0e7a326 cert: Fix encoding of password 2018-11-29 06:29:06 +01: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
Alex Kavanagh
1e4733bd90 Merge pull request #150 from thedac/render-vips
Allow OSCI environment variables
2018-11-06 08:40:13 +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
f6fe86e282 Allow OSCI environment variables
Zaza explicitly limits which environment variables are allowed for
template rendering. Allow the variables that OSCI actually uses. Without
this OSCI fails to render vips.

This enables zaza tests with HA in OSCI.
2018-11-05 15:28:04 -08: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
Liam Young
4f4cccb80f Merge pull request #147 from ChrisMacNaughton/file-ownership
WIP: Add support for testing file ownership
2018-10-17 09:06:02 +01:00
Chris MacNaughton
11133ccd1f fix up local template rendering 2018-10-17 09:32:49 +02:00
Liam Young
69698ea57d Merge pull request #142 from ChrisMacNaughton/bundle-flattener
Add support for removing machine placement in a bundle
2018-10-12 12:34:19 +01:00
Chris MacNaughton
69c44551ff add unit testing and fix typo 2018-10-10 12:14:15 +02:00
Nicolas Pochet
b3996949b8 Add ceph osd tests (#93)
Create functional tests replacing the Amulet tests that are currently used for testing.
2018-10-10 09:09:06 +02:00
David Ames
58af3438dd Fix completed machines unit tests 2018-10-09 09:09:25 -07:00
Chris MacNaughton
89527526f5 Add support for removing machine placement in a bundle 2018-10-09 17:37:40 +02:00
Frode Nordahl
a697a01214 functest-prepare: auto-generate model name when not provided
Fixes #137
2018-10-03 11:46:45 +02:00
Alex Kavanagh
4bf09fc45a Change the image download to download to tmpdir as a default
This is to prevent (as far as possible) putting the image into the
module under test.
2018-09-19 14:24:51 +02:00
David Ames
f6b368db44 Update the juju models cache on model add
Python-libjuju does not update the local cache of juju models on model
create. If no juju switch command or juju models command is run juju
will report model not found.

Issue is being tracked by
https://github.com/juju/python-libjuju/issues/267

Add a juju models command to update the local cache and make the new
model available to the juju binary.
2018-09-19 13:44:23 +02:00
David Ames
0b94bef0d7 Set APT to non-interactive on series upgrade
A number of packages were requiring interaction on upgrade even with
do-release-upgrade -f DistUpgradeViewNonInteractive. By setting DPkg
options in apt.conf upgraded packages do the right thing.

Set 'DPkg::options { "--force-confdef"; };' on hosts being upgraded.
2018-09-19 07:34:24 +00:00
David Ames
a1d152e737 Fix get_project_id 2018-09-18 08:38:02 +00: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
c4182197d4 Use block_until_unit_wl_status for upgrade timing
Remove all calls to time.sleep and use block_until_unit_wl_status to
manage the timing of the upgrade steps.

Also use run_via_ssh to execute commands while the juju agents are down
during a series upgrade.
2018-09-12 08:20:45 -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
David Ames
77c57df9c6 Must use the snap version of agents when using edge version of juju 2018-09-12 08:20:45 -07:00
David Ames
c80f057eb6 Parameterize workarounds 2018-09-12 08:20:45 -07:00
David Ames
4eb3c2e744 Set model on subprocess juju cmds 2018-09-12 08:20:45 -07:00
David Ames
30082c2311 Series Upgrade
Utilities for performing series upgrades.
Place holder for future stand alone series upgrade zaza test.
Small change to overlay template to allow stand alone zaza tests.
2018-09-12 08:20:45 -07:00
Liam Young
b2a33a451a Fixes related to guest creation tests.
* 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
2018-09-12 06:32:21 +00:00
David Ames
89e1660be3 Undercloud keystone scope
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.
2018-08-31 15:20:35 -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
Nicolas Pochet
d6fa8799d3 Add logging level configuration for all functest-*
Fixes #117
2018-08-20 11:05:38 +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
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
Nicolas Pochet
d8f07e66ab Make exception more generic 2018-08-08 23:21:07 +02:00
Nicolas Pochet
f0e0cdd3c2 Add get_machine_series 2018-08-08 18:46:00 +02:00
Nicolas Pochet
077f2af87c Make get_current_os_release_pair variable
It is possible to use `get_current_os_release_pair` with an argument or
to use the default one (`keystone`)
2018-08-08 18:44:09 +02:00