Commit Graph

64 Commits

Author SHA1 Message Date
David Ames
5d533fba6a Restart blocked mysql routers (#565)
LP Bug #1918953 [0] was resolved on the mysql-innodb-cluster side using coordinated delayed action. Since then we have seen a similar issue in CI [1] after the pause and resume test. Mysql-router hangs with:
2021-04-21 20:42:05 metadata_cache WARNING [7f3f968d5700] Instance '192.168.254.18:3306' [72b4ac2c-a2dd-11eb-82a5-fa163e5a4b7e] of replicaset 'default' is unreachable. Increasing metadata cache refresh frequency.

This cannot be fixed from the cluster side. I will be looking into solutions on the mysql-rotuer side. But in the meantime, to unblock the mysql-innodb-cluster gate this change restarts blocked MySQL routers.

[0] https://bugs.launchpad.net/charm-mysql-router/+bug/1918953
[1] https://openstack-ci-reports.ubuntu.com/artifacts/test_charm_pipeline_func_full/openstack/charm-mysql-innodb-cluster/786514/3/8479/consoleText.test_charm_func_full_11494.txt
2021-04-23 17:26:52 +01:00
Liam Young
8a04739912 Fix race exposed by rabbit charm.
If there are multiple charms of a given application then a hook
like leader-settings-changed can trigger a deferred hook. So a
race can occur where the deferred hooks of unit1 are cleared
then in the process of clearing unit2 a deferred hook is
triggerred in unit1. To fix this do not block on the wl status
message after the hook test completes.

Also, make sure that an action failure is fatal to surface any
issues.
2021-04-09 20:02:27 +00:00
Liam Young
01544d22ed Deferred restart test fixes (#540)
* Add ovn-chassis test
* Yet another refactor to reduce the amount that implementations need to override.
* Add ovn dedicated chassis support
* Fix race with checking wlm
2021-04-09 10:48:52 +01:00
Liam Young
f78105a646 Allow status message to be overridden 2021-03-29 14:46:04 +00:00
Liam Young
0fdd876213 Update inline with recent charm changes 2021-03-29 10:41:46 +00:00
Liam Young
085d5a1513 Add RabbitMQDeferredRestartTest + fixes 2021-03-23 15:57:21 +00:00
Liam Young
1f47ef0bd7 Update package restart message afer ch change 2021-03-22 18:43:13 +00:00
Liam Young
d4b8fbaed0 Rerun self.trigger_deferred_restart_via_charm 2021-02-25 11:01:22 +00:00
Liam Young
2054b7c477 Add test for deferred restarts 2021-02-25 09:16:34 +00:00
Alex Kavanagh
7ced54b382 Concurrent series upgrade updates (#466)
* Updates to concurrent series upgrade

Updates to make it run more in parallel and spend less time waiting on
the whole model when updating machines.

* Make the concurrent series upgrade tests work

This is a number of changes to get the concurrent (here called
'parallel' historically) series upgrade tests to work.  A number of
changes were required which included limiting the number of concurrent
async co-routines (futures) that could be run as with large models it
hits the limits of the Py3 runtime.

* Fix the tests and change pause order in maybe_pause_things

Due to an additional model helper call, an additional model AsyncMock is
required.  Also the pause order had changed, and this is restored to
ensure the original design is retained (for pause order).

Clean up some commented out code and sort out a few PEP8 errors.

* Update comment to reflect code (3 -> 4)

* Fix tests that fail on bionic but pass on focal

Essentially, asyncio.gather has different behaviour on bionic that
focal.  Although this doesn't affect testing, it does affect the unit
tests.  These changes are simply to normalise the behaviour of unit
tests on focal and bionic.
2020-12-02 11:22:00 +01:00
Rodrigo Barbieri
7404b0cb9b Update Keystone LDAP tests
- Reversed ldap-config-flags vs charm configs precedence
  for https://review.opendev.org/748364
- Added new functional test to validate the precedence
- Added zaza helper function to assist handling charm configs
  that do not accept "" (like booleans and ints), and reverting
  to unset values through config_change()
- Fixed zaza reset helper function that apparently never
  worked ({}.keys() returns dict_keys which is not a sequence)
2020-11-23 12:33:32 -03:00
Liam Young
299fae65db Fix test runs with no charm_name
Fix z-o-t so that tests that specify an application name can
be run irrespective of whether the charm_name has been set in
tests.yaml. Closes issue #442
2020-10-12 12:05:22 +00:00
Aurelien Lourot
f27ee7c1f6 Make determination of app under test more robust 2020-10-09 16:03:59 +02:00
Aurelien Lourot
181bb98d20 Clean up newly created instances if faulty (#439) 2020-10-09 09:39:00 +02:00
Frode Nordahl
09789767f3 Enhance common launch instance helper
Move retry logic to the launch single guest method.

Add optional arguments that is passed on to the downstream launch
guest helper.
2020-09-25 11:19:32 +02:00
Frode Nordahl
18e8df8eac Do not attempt to restore configuration when equal
The fix for the config_change helpers short cut on config restore
in c5a3f832d0 introduced a
regression for consumers that use the helper to set but not
restore config.

Re-introduce the shortcut when the caller passes in equal settings
for default and alternate configuration.

Fixes #427
2020-09-25 08:20:04 +02:00
James Page
018f1eac96 Merge pull request #398 from openstack-charmers/ceph-bluestore-compression
Ceph bluestore compression
2020-09-24 11:30:50 +01:00
Frode Nordahl
c5a3f832d0 test_utils/config_change: Wait for agent to start executing
Avoid returning prior to the config change has even started.

Fixes: #419
2020-09-16 12:06:26 +02:00
Frode Nordahl
89ea43d0d5 Log resource cleanup failure and carry on
Fixes #417
2020-09-15 20:29:48 +02:00
Frode Nordahl
8a8178738d Add support for resetting back to charm default on config_change
Due to python-libjuju's requirement for coercing every config
value into strings, some configuration type/values are not
possible to specify the default for.

Allow the config_change helper to optionally use reset back to
charm default instead of specifying default config values in a
dictionary.
2020-09-15 15:31:28 +02:00
David Ames
23b24a5501 Merge pull request #365 from openstack-charmers/ovn-charm
Add OVS to OVN migration tests
2020-09-11 08:48:20 -07:00
Chris MacNaughton
c75f2fcb6d Ensure that zaza-openstack-tests can talk to an IPv6 Keystone
When configuring the address to use to talk to Keystone,
the format_addr helper should be used to ensure that an
IPv4 or IPv6 address can be correctly handled.
2020-09-08 11:11:13 +02:00
Frode Nordahl
fe329c1824 Add helper to retrieve tests_options for specific test
This is done by building a prefix for options key from dot-notated
absolute path to calling method or function.
2020-09-07 10:35:18 +02:00
Frode Nordahl
29356f6419 Move cleanup of launched instances to common class
Use the nomenclature for resource cleanup as defined in the
`BaseCharmTest`.
2020-07-03 08:56:01 +02:00
Frode Nordahl
0df72bf47c Make shared resource cleanup method class instance method
At present the shared resource cleanup method is a class method.
This will prohibit descendents of the class to influence whether
cleanup should be run.

Remove the @classmethod decorator so that it will make its
descisions based on class instance variables set by the
descendent.
2020-07-03 08:55:57 +02:00
Frode Nordahl
0f3d9bf7c4 Move useful helpers from Neutron tests to OpenStackBaseTest
The dual-instance launch and retrieve is a common pattern in tests.

Let's share them.
2020-07-02 17:59:31 +02:00
Frode Nordahl
2e6a2ef534 Add helper to format IP addresses appropriately
The ``format_addr`` helper will allow you to write IP version
agnostic code by encapsulating IPv6 addresses in brackets ('[]').
2020-06-06 14:38:38 +02:00
Dmitrii Shcherbakov
740bc2060f Pass arguments BaseCharmTest.setUpClass
Not doing so triggers an incorrect behavior leading to functional test
failures as the application name is not set correctly.

https://github.com/openstack-charmers/zaza-openstack-tests/issues/256
https://review.opendev.org/#/c/712980/1
2020-05-04 20:45:55 +03:00
Liam Young
6694caf281 Improve docstring and allo section override 2020-04-21 07:45:42 +00:00
Liam Young
d652eff6d9 Add a helper for testing restart on changed
Most api charms test restart on changed by flipping the value of
debug. This has led to the same test being copied around. To reduce
the boiler plate code this change adds a new test helper which can
be used instead.
2020-04-21 07:16:58 +00:00
Aurelien Lourot
8b8155347e Fix typos 2020-04-19 16:58:24 +02:00
Aurelien Lourot
ac227eab08 Fix copy-paste mistakes and typos and remove dead code 2020-04-16 15:10:03 +02:00
Liam Young
cf2b0f21b9 Merge pull request #222 from openstack-charmers/issue/221
octavia: tear down resources created during LBaasV2 test
2020-04-08 07:34:41 +01:00
Frode Nordahl
f35da80f27 Unpin flake8, fix lint
Add Python 3.8 env in Travis CI test matrix.

At present the pinning of flake8 disallows running of lint on
Python 3.8 systems.

Update flake8 ignore-list to ignore W504 instead of W503, the PEP
guidance is that either is ok, but there must be local consistency.

There are more occurences of binary operator before line-break
than after in this repository, and we have also chosen to ignore
W504 in most of our other repositories.
2020-04-07 11:14:49 +02:00
Liam Young
be8889e581 Move new methods out of test class
The new methods assertActionRanOK & assertRemoteRunOK are useful in
setup as well as tests so it makes sense to move them out of the
test class.
2020-04-01 10:18:30 +00:00
Liam Young
a3f1230aea Remove prints 2020-04-01 09:08:10 +00:00
Liam Young
588d38d4d7 Add custom assertions
Add custom assertions to check that remote actions and commands
run ok.
2020-04-01 08:58:36 +00:00
Liam Young
9cb7876e19 Add BaseCharmTest class without OpenStack setup.
The ceph-iscsi charm is a non-openstack api charm that also needs
config changed and pause/resume tests.
2020-03-31 16:22:03 +00:00
Frode Nordahl
1ece576981 radosgw: Pass local CA cert to client when relevant 2020-03-23 10:58:23 +01:00
Aurelien Lourot
707b36c0f8 Add a ceilometer test case and fix existing ones for trusty/mitaka
https://bugs.launchpad.net/charm-ceilometer/+bug/1828424
2020-03-05 11:11:49 +01:00
Adam Dyess
b7890be342 _stringified config value of --> '' 2020-01-27 13:15:59 -06:00
Adam Dyess
abfa96042f also don't cast config keys to str 2020-01-27 12:30:08 -06:00
Adam Dyess
056b2552fd resolve pep8 issues 2020-01-27 11:48:58 -06:00
Adam Dyess
b080f5ff59 config_current doesn't need to flatten values to , but applying config to zaza.model does required all values are strings 2020-01-27 11:46:23 -06:00
Adam Dyess
0614ff5ad6 integrate comments from @thedac to improve waiting for stable, and some documentation issues 2020-01-24 12:59:58 -06:00
Adam Dyess
7063056844 use ':' style argument definitions rather than '@' 2020-01-24 11:23:09 -06:00
Adam Dyess
e294034018 improve docstrings for config_current 2020-01-22 13:14:12 -06:00
Adam Dyess
b75aaa79c5 Resolve pep8 violations 2020-01-22 09:33:58 -06:00
Adam Dyess
b4f1201da2 Integrate suggestions from ajkavanagh 2020-01-22 09:30:48 -06:00
Chris MacNaughton
5a65e05c37 Merge pull request #136 from gnuoy/make-OpenStackBaseTest-multimodel-friendly
Make OpenStackBaseTest model_alias aware
2019-11-29 12:30:34 +01:00