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
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
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.
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.
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).