Commit Graph

29 Commits

Author SHA1 Message Date
Felipe Reyes a67e1e0ec7 Refactor Hacluster.
Moving the attributes from HaclusterScaleBackAndForthTest to
HaclusterBaseTest allows HaclusterTest to access them and identify the
hacluster application correctly.
2023-05-26 10:13:48 -04:00
Corey Bryant 95fcad2a0a Change skipVersion decorator to a function
The skipVersion decorator was proving to be tricky to use because
it took an application name which we didn't want to hard-code,
since it is in hacluster/tests.py. One alternative was to pass a
charm name instead of application name, but if there were mutiple
hacluster applications in the model (e.g. keystone-hacluster and
nova-hacluster) we would have to pick just one to test the package
version on. After further discussion we decided to change the
decorator to a function so that we could use existing class
variables to generate the desired hacluster application name.
2023-04-19 18:28:22 +00:00
Felipe Reyes a81376183f Skip test_930_scaleback on crmsh-4.4.0-1ubuntu1
The crmsh package available in kinetic fails to put a cluster node in
maintenance mode, this is part of the scaleback process, more details on
the failure available at the related bug.

This change introduces a new decorator skipVersion() that allows to
provide a list of package versions with an operation flag on how dpkg
should compare the version(s).

The test HaclusterTest.test_930_scaleback() is disabled when running
crmsh-4.4.0-1ubuntu1, at the moment this would be kinetic, although if
any new package gets released this test will be re-enabled automatically
allowing us catch early if the test got fixed or not.

Related-Bug: http://pad.lv/1972730
2023-02-27 15:36:04 -03:00
Aurelien Lourot b428b6cf15 Remove obsolete HaclusterScalebackTest
It has been superseded by HaclusterScaleBackAndForthTest
and was used in the following charm gates:
hacluster and mysql-router.
2021-03-19 15:37:03 +01:00
Aurelien Lourot aafdc4070f Workaround for lp:1874719 2021-03-05 18:08:54 +01:00
Aurelien Lourot 93a48133b3 Add assertions to HaclusterScaleBackAndForthTest 2021-03-05 12:50:50 +01:00
Aurelien Lourot 0931ebb456 Fix docstring 2021-03-03 10:56:15 +01:00
Aurelien Lourot c80f5fdef8 Make HaclusterScaleBackAndForthTest less stressful
Removing and re-adding two units out of a cluster of three
so fast seems to be too stressful for corosync/pacemaker,
which makes the test fail in rare cases.  Removing and
re-adding one unit only is enough in order to validate the
functionality.  This also makes the test execution time
much shorter.
2021-03-03 10:50:53 +01:00
Aurelien Lourot 20bd5dfb59 Remove obsolete comment
The automatic corosync cleanup on Juju >= 2.8 turned out
not to work and has been removed from charm-hacluster.
The 'update-ring' action is now always needed.
2021-02-25 13:05:30 +01:00
Aurelien Lourot 8c819814fb Don't wait for principle to get back to active 2021-02-19 16:58:32 +01:00
Aurelien Lourot c00aa18ffb Assert that corosync considers all nodes to be online 2021-02-18 16:56:08 +01:00
Aurelien Lourot f598eb93c2 Improve comments 2021-02-18 10:38:45 +01:00
Aurelien Lourot 1c4d2e05af Let test_930_scaleback remove 2 units instead of 1 2021-02-18 09:51:00 +01:00
Aurelien Lourot 2c9459bf1f Merge branch 'master' into hacluster-scaleback 2021-02-08 15:20:53 +01:00
Aurelien Lourot 2b715da7e4 Make HaclusterScalebackTest more robust (#482)
Note that this test will be superseded by #369 in the future.
2021-01-14 10:15:34 +01:00
Aurelien Lourot a3248185f1 Fix copy-paste mistake 2020-11-27 13:52:44 +01:00
Aurelien Lourot 69b61c63f4 Add HaclusterScaleBackAndForthTest 2020-11-27 12:04:43 +01:00
Aurelien Lourot 11f3060f6b Fix unit-name -> app-name conversion 2020-09-09 10:08:37 +02:00
Aurelien Lourot 14f7e3848c Remove hacluster test option hacluster_app_name 2020-09-08 12:51:53 +02:00
Aurelien Lourot 93a3d23162 Merge branch 'master' into hacluster-scaleback 2020-09-08 12:40:12 +02:00
Aurelien Lourot e6300dba20 Add HaclusterScalebackTest (#399)
Co-authored-by: Alvaro Uria <alvaro.uria@canonical.com>
2020-09-08 12:11:05 +02:00
Aurelien Lourot b72855ca96 Make HaclusterScalebackTest runnable against any charm 2020-08-28 13:15:31 +02:00
Aurelien Lourot e48da475a2 No need to resume hacluster unit before scaling down 2020-08-27 13:33:46 +02:00
Aurelien Lourot 573acf9d1c Move new scaleback test to new test class 2020-08-27 13:33:46 +02:00
Alvaro Uria 5579f2f110 HaclusterTest: support scaleback test on bionic 2020-07-21 19:57:37 +02:00
Liam Young a6b2a9799d Fix hacluster tests
Tidy up hacluster tests. In the process this fixes the error:

```
UnboundLocalError: local variable 'primary_status' referenced before assignment
```

This was caused by libjuju now returning an empty dict rather than
None when listing a subordinates units.
2020-06-04 12:32:54 +00:00
Alex Kavanagh 329d4fb8c5 Fix hacluster tests for focal with mysql8
The hacluster tests assume that all the subordinates are hacluster.
However, with mysql8 there is a mysql-router subordinate as well, and it
doesn't support the clean-up action.  This change ensures that the tests
checks that the subordinate IS hacluter prior to applying the
action/test.
2020-04-20 12:51:27 +01:00
Liam Young fa1d77c15a Fix hacluster pause/resume tests
The hacluster tests used to pause the hacluster subordinate but
then rely on the unintended side-effect of the prinicple going
into a blocked state to confirm the action was complete. This is
not what the old amulet tests used to do. Also, more importantly,
the side-effect has been fixed so the tests no longer worrk.
2020-01-30 12:47:06 +00:00
Xiyue Wang 574531aaa9 Port hacluster tests from Amulet to Zaza
Signed-off-by: Xiyue Wang <celia.wang@canonical.com>
2019-12-19 23:06:31 +00:00