Commit Graph

76 Commits

Author SHA1 Message Date
Felipe Reyes ea36acd3cc Merge pull request #37 from gnuoy/use-correct-mysql-pwd-key
Stop using legacy root-password key
2023-09-15 09:35:11 -03:00
Felipe Reyes 97d1b15d10 Retry when checking mysql exporter endpoint 2023-08-08 10:29:36 -04:00
Alex Kavanagh f0a6e802cc Make username list on log look normal 2023-05-19 12:36:28 +01:00
Alex Kavanagh 0fe8e9d666 Switch from json.loads to yaml.safe_load for decoded usernames
In the rotate password test, the results from the action return a list
of strings that are deliminted by single quotes.  This isn't compatible
with json.loads(), but yaml.safe_load() is able to load the string as an
array of strings.
2023-05-08 11:26:19 +01:00
Alex Kavanagh ce2b26a6e0 Use json.loads() to read results of password rotation usernames 2023-05-08 11:26:19 +01:00
Alex Kavanagh a61653d031 Add a tenacity retry to the password change checks 2023-05-08 11:26:19 +01:00
Alex Kavanagh 140805d321 Fix handling of usernames in password rotation mysql test
This patch ensures that the usernames are parsed correctly from the
action to ensure that the usernames are handled correctly.
2023-05-08 11:26:19 +01:00
Alex Kavanagh 32f2a052b1 Add wait_for_agent_status in 'settle' code
This is to guarantee that the block check didn't happen prior to the
action being started.
2023-05-08 11:26:19 +01:00
Alex Kavanagh e16406116b Add test to rotate mysql service user password
This new test verifies that keystone can have its password rotated and
then still operate afterwards.  It verifies that the on-disk password is
changed in the keystone application and that the user list can be
performed.
2023-05-08 11:26:19 +01:00
Felipe Reyes 6fec7c31a4 Use zaza.model.get_unit_public_address()
Replace the use of "unit.public_address" with
zaza.model.get_unit_public_address().

    AssertionError: {'host': '172.16.0.25', 'port': 3306, 'user': 'prom_exporter'} != {'host': None, 'port': 3306, 'user': 'prom_exporter'}
    - {'host': '172.16.0.25', 'port': 3306, 'user': 'prom_exporter'}
    ?          ^^^^^^^^^^^^^
    + {'host': None, 'port': 3306, 'user': 'prom_exporter'}

Related-Bug: openstack-charmers/zaza#472
2023-03-22 14:40:50 -03:00
jneo8 db21233890 test(zaza/openstack/charm_tests/mysql/test_prometheus_mysql_exporter.py): Add HTTP metrics query check 2022-10-26 22:13:12 +08:00
jneo8 f079b9cddb fix(zaza/openstack/charm_tests/mysql/test_prometheus_mysql_exporter.py): Fix snap naming and configure to fit new snap release 2022-10-26 22:13:12 +08:00
jneo8 f39ea121a4 style(zaza/openstack/charm_tests/mysql/test_prometheus_mysql_exporter.py): Update docstring style 2022-10-26 22:13:12 +08:00
jneo8 788fd77137 test(zaza/openstack/charm_tests/mysql/test_prometheus_mysql_exporter.py): Add tests for mysql prometheus exporter 2022-10-26 22:13:12 +08:00
Mert Kırpıcı 28a63747a8 mysql: add test for cluster restart on group replication cache size option
Signed-off-by: Mert Kırpıcı <mert.kirpici@canonical.com>
2022-06-23 11:49:41 +00:00
Liam Young 118bea9796 Fix mysql test_800_remove_leader (#708)
test_800_remove_leader is getting a reference to the mysql lead
unit, removing the unit and then attempting to retrieve the ip.
This used to work but no longer does, perhaps due to changes
in the way zaza interfacts with libjuju. This change stores
the lead ip address before removing the unit.
2022-02-21 16:32:55 +00:00
Alex Kavanagh 0af4c93d52 Switch unit.public_address to unit.get_public_address()
Due to the bug [1] on OpenStack providers, unit.public_address doesn't
actually work reliably.  The fix [2] is only for the async function
unit.get_public_address().  Sadly, zaza relied on unit.public_address
and so it needs this patch for juju 2.9 support on OpenStack providers.

This patch relies on an associated patch in zaza [3]; thus this will
fails its tests until that passes.

[1]: https://github.com/juju/python-libjuju/issues/551
[2]: https://github.com/juju/python-libjuju/pull/600
[3]: https://github.com/openstack-charmers/zaza/pull/468
2022-01-14 15:21:32 +00:00
Zhang Hua eb3b3eb97c Merge branch 'master' into hm-port 2021-10-28 21:16:43 +08:00
Aurelien Lourot c32a6d420b Fix various typos 2021-09-24 14:20:01 +02:00
Zhang Hua b44aa8823c Delete hm port on unit removal
This is Zaza functional test for lp:1915512. Add a unit and then remove a unit,
then query the list of ports to check that the port has been deleted.

Depends-On: https://review.opendev.org/c/openstack/charm-octavia/+/787700
2021-07-19 11:45:43 +08:00
Aurelien Lourot 65d9d78420 Merge branch 'master' into retry-with-tenacity
Change-Id: Ifac26ffb6d53d75b9dbd314693252ad8b3364c5d
2021-07-16 11:54:08 +02:00
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
David Ames 49929ef018 Fix typo 2021-04-19 09:05:45 -07:00
David Ames 1c15672b61 MySQL Partition Test class
Currently the new partition test_110 is breaking on master due to the
test landing before the charm PR which implemented the change [0] has
landed.

Move the partition test to its own class which can be added as a target
in the charm's tests.yaml. This will not affect master and can be
trivially updated in [0].

[0] https://review.opendev.org/c/openstack/charm-mysql-innodb-cluster/+/779427
2021-04-19 08:58:11 -07:00
Dariusz Smigiel 4df0cbee8c Moved block_until_idle immediately after force-quorum cmd 2021-04-02 11:40:07 -07:00
Dariusz Smigiel 0858f016cd Fixed TokenError 2021-04-02 11:29:44 -07:00
Dariusz Smigiel 9a5e334b44 Addressed review comments 2021-04-02 11:05:52 -07:00
Dariusz Smigiel 795272269f Fixed typo 2021-04-02 07:52:18 -07:00
Dariusz Smigiel 8b47c8a37f Change the way how I'm checking state 2021-04-02 07:40:00 -07:00
Dariusz Smigiel 51a53d4e86 Verify at the end that cluster is in operable state 2021-04-02 07:12:06 -07:00
Dariusz Smigiel 66fd299f16 Fixed typo 2021-04-01 21:30:13 -07:00
Dariusz Smigiel e8157f0df8 Addressed flake8 violations 2021-04-01 20:44:23 -07:00
Dariusz Smigiel a891ff28d5 Added 'i-really-mean-it' tick to force-quorum 2021-04-01 16:38:21 -07:00
Dariusz Smigiel fe8b78b7c6 Functional testing for mysql-innodb-cluster
This is a change with functional test for mysql-innodb-cluster
implementing `force-quorum-using-partition-of` feature.
It is addressing bug:
https://bugs.launchpad.net/charm-mysql-innodb-cluster/+bug/1917332
2021-04-01 14:08:54 -07:00
David Ames 2a6517f6fd Add restart on change test (#527)
Add the restart on change test for mysql-router.
2021-03-23 15:32:01 +00:00
David Ames adda372699 Show cluster status before removal 2021-03-02 22:44:40 +00:00
David Ames 135da1e1a3 Fix reboot-cluster-from-complete-outage race 2021-02-18 09:38:05 -08:00
David Ames af2c6243e2 Fix race condition in MySQL tests
In the MySQL test we destroy a unit and then attempt to remove it from
metadata. The metadata removal (remove_instance action) gets stuck when it is
started while the destroyed unit has not been entirely removed and is still
running MySQL.

Wait for all the units to have cluster incomplete workload status message
before attempting the remove_instance.
2021-02-12 14:23:00 -08: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
Alex Kavanagh 19c626e120 Merge pull request #203 from freyes/bug/1868326
mysql: add check for seeded file in pxc
2020-08-24 14:38:59 +01:00
David Ames 4546e821c1 Wait for resolving update-status hook errors
The cold boot restart takes too long on update-status. Make the timeout
longer.
2020-07-09 09:27:25 -07:00
David Ames 7265b79769 Fixes for MySQL testing
* Better handle workload state checking during cold start
* Switch from debug to info to see log messages
2020-07-08 10:27:01 -07:00
coreycb 754a709083 Merge pull request #291 from thedac/reboot-from-outage-fixes
Handle reboot_from_complete_outage for mysql-innodb-cluster
2020-05-21 18:31:51 -04:00
David Ames d45e1a655c Merge pull request #272 from mfmsilva/add_mysqldump_to_common
Add mysqldump test to MySqlCommonTests
2020-05-21 15:21:35 -07:00
David Ames 4802e632bd lint fix 2020-05-20 15:05:37 -07:00
David Ames e347f0cb7a Handle reboot_from_complete_outage for mysql
Test updates to re-enable reboot_from_complete_outage testing on
mysql-innodb-cluster.
2020-05-20 11:56:55 -07:00
Marco Silva 28924d2909 Move mysqldump from MySQLInnoDBClusterTests to MySQLCommonTests
Moved mysqldump function. Added check for percona-cluster application
on the function, to avoid breaking checks on non-percona applications.
2020-05-20 13:05:43 +01:00
David Ames c06cb8d625 MySQL 8 Scale-in and Scale-out tests (#275)
* MySQL 8 Scale-in and Scale-out tests

Depends-On: https://github.com/openstack-charmers/zaza/pull/353

* Review requests

* Typo
2020-05-19 09:47:55 -05:00
Marco Silva a56fa1fd74 Add mysqldump test to MySqlCommonTests
Copy function from MySQLInnoDBClusterTests to test mysqldump
as standard on mysql applications.

DocImpact
Closes-Bug: #0000000
Implements: MySQL dump test
2020-05-14 09:34:44 +01:00
Aurelien Lourot ac227eab08 Fix copy-paste mistakes and typos and remove dead code 2020-04-16 15:10:03 +02:00