Commit Graph

30 Commits

Author SHA1 Message Date
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
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 87c72a510e Fix bug when no message is present 2021-12-14 09:02:16 +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
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 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 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 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 1acbfd8741 Add a function for retrieving a message to an Rmq unit 2019-10-14 10:45:59 +11:00
Edin Sarajlic 20aad97033 Add a function for publishing a message to an Rmq unit 2019-10-14 10:45:59 +11:00
Edin Sarajlic e09660f7c1 Add a function for disabling SSL on Rmq units 2019-10-14 10:45:59 +11:00
Edin Sarajlic 79d70e4f8d Add a function for enabling SSL on Rmq units 2019-10-14 10:45:59 +11:00
Edin Sarajlic 97cc2b8e60 Add function validating is SSL is disabled on Rmq units 2019-10-14 10:45:59 +11:00
Edin Sarajlic c917c5b370 Add function validating if SSL is enabled on Rmq units 2019-10-14 10:45:59 +11:00
Edin Sarajlic 79a9f179df Add function for determing if SSL is enabled in unit's Rmq config 2019-10-14 10:45:59 +11:00
Edin Sarajlic 6d3714aa06 Add a function for deleting a user from a Rmq cluster 2019-10-14 10:45:59 +11:00
Edin Sarajlic 3a64bec97a Add function for adding a user to an Rmq cluster 2019-10-14 10:45:59 +11:00
Edin Sarajlic 313f07bd0c Add test confirming that all Rmq units are part of cluster 2019-10-14 10:45:59 +11:00
Edin Sarajlic 6749ff763e Add a function for creating connection to Rmq instance on unit 2019-10-14 10:45:59 +11:00
Edin Sarajlic fa68f09e72 Add a function providing all units/nodes Rmq cluster_status in JSON 2019-10-14 10:45:59 +11:00
Edin Sarajlic 47657d6113 Add a function for getting Rmq cluster_status info from a unit 2019-10-14 10:45:59 +11:00
Edin Sarajlic 2fb7dcbdfc Add function that waits until Rmq units are clustered and ready 2019-10-14 10:45:59 +11:00
Edin Sarajlic cf91a9dab9 Create rabbitmq_server.utils file (add a license as a starter) 2019-10-14 10:45:59 +11:00