Commit Graph

76 Commits

Author SHA1 Message Date
Liam Young bd8d7e8b29 Gate quorum queue tests on whether the charm supports them 2023-09-06 09:01:49 +00:00
Liam Young 53a1ef7b21 Add Quorum Queue rabbit tests
Add tests for the rabbitmq charm managing quorum queues.
2023-07-10 15:01:17 +00:00
Liam Young 6ee5fff038 Add tests for rabbit on k8s 2023-07-07 12:42:17 +00:00
Alex Kavanagh 6516a34045 Update rabbitmq rotate password test to be more robust/correct
Fix a bug where the wrong paramter from the /etc/cinder/cinder.conf
file is being used ('transport' -> 'transport_url').

Fix issue around using json instead of yaml for loading the usernames
from the action data from the list_service_usernames action, which uses
single quotes to quote the data, which isn't compatible with json.

Make the testing for the password change in the cinder.conf more robust
by retrying, as juju is essentially async and it's difficult to
determine exactly when the hook will get fired on cinder.
2023-05-08 11:23:24 +01:00
Alex Kavanagh 6bfbab2578 Use json.loads() for password rotation usernames result 2023-05-08 11:23:24 +01:00
Alex Kavanagh 17c0de8810 Fix handling of usernames in rabbitmq password rotation test
The usernames were not handled correctly.  The return value from looking
up the action value is a string, and so it needs to be split on ','.
2023-05-08 11:23:24 +01:00
Alex Kavanagh d964696f48 Add additional wait_for_agent_status() check
This is to ensure that the model really is settled after the password
rotate action.
2023-05-08 11:23:24 +01:00
Alex Kavanagh b29c11720e Add test to rotate rabbitmq-server service user password
This new test verifies that cinder can have its password rotated and
then still operate afterwards. It verifies that the on-disk password is
changed in the cinder application and that the user list can be
performed.
2023-05-08 11:23:24 +01:00
Alex Kavanagh 9ad7e55a5f Fix race in test 408 for rabbitmq
There is a race in the 408 test for rabbitmq where the config-change to
enable ssl causes a leader-settings-changed hook in the non-leader units
which results in a rabbitmq service restart.  This can happen at exactly
the same time as the test attempts to establish a connection with the
that unit. This patch retries the connection attempt.

Note that this may only be a partial fix as it's possible that a restart
will happen just after the connection is made, which would then result
in a test failure.

Related-Bug: LP#2002156
2023-01-06 20:12:08 +00:00
Felipe Reyes 5a125a4f9e Don't test nrpe bits on rabbitmq-server. (#793)
When the nrpe application is not deployed in the model skip the test
that checks for the correct configuration of the nagios checks, this is
because at the moment nrpe has no support for jammy, hence is not being
deployed in the jammy-yoga bundles.

Jammy support for nrpe is tracked at http://pad.lv/1968008
2022-06-27 16:07:24 +01:00
Alex Kavanagh d3ab250984 Revert "Func-test for declarative policies in RabbitMQ. (#692)" (#697)
This reverts commit 24d7270ace.
2022-01-26 15:54:19 +00:00
Gabriel Angelo Sgarbi Cocenza 24d7270ace Func-test for declarative policies in RabbitMQ. (#692)
Compare cluster policies with the juju config.
2022-01-22 09:20:22 +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
Liam Young e83591033b Remove tenacity around message search 2021-12-14 11:53:06 +00:00
Liam Young ce18b4a2a0 Fix reraising for RmqNoMessageException 2021-12-14 11:09:41 +00:00
Liam Young 87c72a510e Fix bug when no message is present 2021-12-14 09:02:16 +00:00
Liam Young 908f0b4a3b Search for message in rabbit tests
The current rabbit tests post a message on one unit and then
consumes the first message on another unit. If the two do not match
then the test fails. This means that a single pre-existing message
can break all these tests as the consumer always gets the wrong
message. This change updates the tests to search for the target
message rather than assuming that the first message is the target
message.

Messages that are not the target message are not reposted so any
pre-existing messages are consumed and in effect thrown away but
given these are all test messages in a test queue and the tests do
not run in parallel this should be fine.
2021-12-14 08:06:58 +00:00
Alex Kavanagh d4d415c859 Ensure that series upgrades ignore percona at focal
When doing a series upgrade from bionic to focal, the percona-cluster
charm needs to be avoided.  This filters the applications for percona if
the target is focal.  Note if percona is placed on the same unit as
something else that needs to be upgraded (bad idea) then it may still
get 'upgraded' and the operation will fail.
2021-11-30 18:50:14 +00:00
James Page f877ae0a36 Support new style RMQ conf files
The rabbitmq-server charm now uses INI style .conf files for
releases that support the new style of configuration.

Update SSL checks to look for this file first and then fallback
to the older .config filename if not found
2021-11-15 10:57:35 +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 77cb2d0bd8 Fix doc string and lint 2021-03-24 13:52:34 +00:00
Liam Young 085d5a1513 Add RabbitMQDeferredRestartTest + fixes 2021-03-23 15:57:21 +00:00
Aurelien Lourot 4eef19197d Add missing blank 2020-09-09 09:49:15 +02:00
Aurelien Lourot 38317c3bc2 Make RmqTests.test_910_pause_and_resume more robust 2020-09-08 12:24:26 +02:00
Dmitrii Shcherbakov 51bce56f9e Skip test_921_remove_and_add_unit
Due to test stability issues we need to skip it and work on it after
release.
2020-05-20 10:26:48 +03:00
Aurelien Lourot 0dad4aca14 Minor improvements to RmqTests.test_913_list_unconsumed_queues 2020-05-18 23:36:27 +03:00
Dmitrii Shcherbakov dfc6235362 Add cleanup to the unit removal case
For some reason test cases are sometimes executed out of order and so
test_921_remove_unit is sometimes run before the pause_and_resume test
case which results in an error.

While the root cause for it must be found it would also be good to avoid
side-effects in individual test cases and return the environment back to
its original state.

There is no 'start' hook implementation for charm-rabbitmq-server,
however, changes that close to the 20.05 release are discouraged so this
change uses an upgrade-charm event simulation to re-trigger the addition
of a unit (which was previously removed) to the cluster.

NOTE: after an execution of hooks/upgrade-charm finishes, the charm will
stay in the waiting state with the following status until the next
update-status event: 'Unit has peers, but RabbitMQ not clustered'

Related-Bug: #1730709
2020-05-18 23:36:27 +03:00
David Ames 37297aff8f Reduce the number of permutations of msg checks
Reduce the number of checks by 30%.
Remove duplicate test 410.
Use logging.info to get output.
2020-05-10 00:51:54 +00:00
Chris MacNaughton 27e5f7d8bc We must have async functions for the before/after callables 2020-04-10 16:51:41 +02:00
Chris MacNaughton 2a98274d67 Add a few more function hooks to the series upgrade process
By including pre and pos-application functions, charm
series upgrades can be handled in a more generic way,
even when they require running additional actions
before a unit is upgraded, or after the whole application
is upgraded.
2020-04-10 10:50:43 +02:00
Alex Kavanagh 7076053627 Update rabbitmq tests for version 3.8.2 on focal
Ubuntu focal ships with rabbitmq server 3.8.2 which has changed the text
output format for the cli commands that the tests rely on.  Fortunately,
3.8.2 also adds a --formatter=json option.  This patch takes advantage
of that.
2020-03-23 17:49:22 +00:00
Edin Sarajlic d2e12abb91 Remove condition: check client series will always be true.
All CI test runners are >= xenial. The condition will always be true.
2019-10-14 10:45:59 +11:00
Edin Sarajlic 1ea0be0440 Don't time.sleep when checking Rmq ports after toggling mgmt plugin. 2019-10-14 10:45:59 +11:00
Edin Sarajlic 060f7392d9 Don't sleep while waiting for cluster status to update. Use tenacity 2019-10-14 10:45:59 +11:00
Edin Sarajlic 215b3c87e3 Don't time.sleep waiting for Nagios. Port to tenacity. 2019-10-14 10:45:59 +11:00
Edin Sarajlic d780f76797 Port validating Rmq SSL off from time.sleep to Tenacity 2019-10-14 10:45:59 +11:00
Edin Sarajlic e8068a8356 Port validating Rmq SSL on from time.sleep to Tenacity 2019-10-14 10:45:59 +11:00
Edin Sarajlic 814ff7ddee Don't sleep before attempting get AMQP msg. Retry w/ tenacity 2019-10-14 10:45:59 +11:00
Edin Sarajlic 5e170cd1ba Make get_series/get_client_series available as public util functions 2019-10-14 10:45:59 +11:00
Edin Sarajlic 4eb068ab23 Provide a message if assert fails 2019-10-14 10:45:59 +11:00
Edin Sarajlic a0769e5dcb Remove TODO (behaviour confirmed not to be a bug) 2019-10-14 10:45:59 +11:00
Edin Sarajlic 1a9449766a Remove superfluous newlines at the end of debug messages 2019-10-14 10:45:59 +11:00
Edin Sarajlic 60e84e4c27 Port Rmq charm func test removing a unit from a Rmq cluster
This function was previously called test_901_remove_unit, but had to
be renamed (moved to the end of the func tests); The way in which unit
removal is now performed (by running the "stop" hook) puts the the
removed unit in a "waiting" state -- which consequently causes
wait_for_cluster() (e.g. used in 910) to fail (timeout).
2019-10-14 10:45:59 +11:00
Edin Sarajlic b5f60126bc Remove duplicate call to function 2019-10-14 10:45:59 +11:00
Edin Sarajlic 18726c341a Fix lint errors found in docstrings 2019-10-14 10:45:59 +11:00
Edin Sarajlic 4792a527c9 PROTOCOL_TLS is not available until Py3.6, use alternative 2019-10-14 10:45:59 +11:00
Edin Sarajlic 0e16359330 Check client+unit OS versions before running Rmq tests with SSL enabled 2019-10-14 10:45:59 +11:00
Edin Sarajlic 1835d957a1 Test: msgs can be sent/retrieved to/from Rmq cluster with SSL+alt port
Same message as my previous commit: As per the code: is there a
function to determine unit's release?  Otherwise, I'll just implement
a generic function that run_on_unit lsb_release -cs
2019-10-14 10:45:59 +11:00