Commit Graph

220 Commits

Author SHA1 Message Date
Chris MacNaughton 69c44551ff add unit testing and fix typo 2018-10-10 12:14:15 +02:00
Chris MacNaughton 362ce7bac5 rename flatten-bundle to remove-placement 2018-10-10 11:34:31 +02:00
Chris MacNaughton 89527526f5 Add support for removing machine placement in a bundle 2018-10-09 17:37:40 +02:00
Frode Nordahl d60699ca6c Merge pull request #140 from thedac/series-upgrade-ordering
Handle set origin
2018-10-05 16:54:31 +02:00
David Ames 0fba8b8568 Handle set origin
After the series upgrade a config changed hook will fire with openstack
origin or source still set to ubuntu series n-1 which will Traceback.

It is necessary to pause all primary charms which will then allow the
setting of openstack-origin or source to distro after the first unit is
in progress with the series upgrade.
2018-10-05 07:31:19 -07:00
Liam Young 7746c2261f Ensure new model is disconnected from
When Controller.add_model is called it returns a model, this model
should be disconnected from otherwise stack-traces like the one
reported in issue #135 occur.
2018-10-03 12:16:57 +01:00
Frode Nordahl a697a01214 functest-prepare: auto-generate model name when not provided
Fixes #137
2018-10-03 11:46:45 +02:00
David Ames 54718d9ab1 Track which machines have been upgraded
For machines that have multiple application charms running, upgrade
only once. Keep track of which machines have been upgraded.
2018-09-26 15:53:00 -07:00
David Ames c7e8b047a4 Allow for variations on series upgrade tests.
It is useful to be able to test deployments which are not full OpenStack
deployments with all the required services to launch a VM.

This change creates variations that allow both the full stack tests and
ones that do not assume what has been deployed.
2018-09-20 13:24:14 +00:00
Liam Young 6b2eaca5f0 Merge pull request #132 from fnordahl/feature/add_functional_test
Add self-hosted functional test of Zaza
2018-09-20 14:55:33 +02:00
Alex Kavanagh a2aeba613d Add model name to bundle log message
This simply adds the model name to the log message that the bundle
is being deployed to so the user can see which model got which bundle.
2018-09-20 10:45:33 +02:00
Frode Nordahl aa115b7546 Add self-hosted functional test of Zaza 2018-09-20 02:29:27 +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 86188d2843 Fix typo 2018-09-19 13:47:10 +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 b1320cefee Workaround script and files no longer necessary
By setting the DPkg options for non-interactive the workaround script
and files are no longer necessary for the test automation.
2018-09-19 08:55:29 +00: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 6ecbad1a86 Fix LTSGuestCreateTest.setUpClass 2018-09-18 12:59:30 +00:00
David Ames 50da3de319 Enable LTS launch instance on series upgrade test 2018-09-18 08:56:07 +00:00
David Ames a1d152e737 Fix get_project_id 2018-09-18 08:38:02 +00:00
David Ames e33af35103 Allow different workaround files per series 2018-09-13 17:05:07 -07:00
David Ames a093a17bb3 Classes for different upgrade scenarios 2018-09-13 14:34:26 -07: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 9e24be435e Fix launch_small_instance in charm_tests 2018-09-12 08:21:51 -07:00
David Ames e893cc4b40 Do not wait for idleness after pre-series-upgrade
The pre-series-upgrade hook stops the juju agent. This can cause the
juju wait for idleness to wait forever. Wait for the expected workload
status instead.
2018-09-12 08:20:45 -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 a83c3c4d2a Pass upgrade workaround files for standalone test 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 35f3f547e0 Revert LOCAL_OVERLAY_TEMPLATE removal 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
David Ames be4eee176e Place holder for future standalone series upgrade
Pure standalone tests are not quite ready yet. But this is a place
holder for the series upgrade tests.
2018-09-12 08:20:45 -07:00
David Ames 056047d93c Allow non-charm standalone tests 2018-09-12 08:20:45 -07:00
Liam Young 0c82de5d83 Make image name configurable in glance. 2018-09-12 08:12:42 +00: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 0418cb4d26 Pause lead unit during key rotation test
Related LP: #1787719
2018-08-20 09:51:16 +02:00
Frode Nordahl 81153b7516 Use lead unit instead of first unit 2018-08-20 09:50:56 +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 76d2576046 Check already applied config before attempting to set
Fixes #115
2018-08-17 07:35:46 +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