Commit Graph

12 Commits

Author SHA1 Message Date
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
Felipe Reyes
2cd18b484d Replace assertEquals with assertEqual.
DeprecationWarning: Please use assertEqual instead.
2023-02-14 14:45:20 -03:00
Rodrigo Barbieri
7404b0cb9b Update Keystone LDAP tests
- Reversed ldap-config-flags vs charm configs precedence
  for https://review.opendev.org/748364
- Added new functional test to validate the precedence
- Added zaza helper function to assist handling charm configs
  that do not accept "" (like booleans and ints), and reverting
  to unset values through config_change()
- Fixed zaza reset helper function that apparently never
  worked ({}.keys() returns dict_keys which is not a sequence)
2020-11-23 12:33:32 -03:00
Frode Nordahl
18e8df8eac Do not attempt to restore configuration when equal
The fix for the config_change helpers short cut on config restore
in c5a3f832d0 introduced a
regression for consumers that use the helper to set but not
restore config.

Re-introduce the shortcut when the caller passes in equal settings
for default and alternate configuration.

Fixes #427
2020-09-25 08:20:04 +02:00
Frode Nordahl
8a8178738d Add support for resetting back to charm default on config_change
Due to python-libjuju's requirement for coercing every config
value into strings, some configuration type/values are not
possible to specify the default for.

Allow the config_change helper to optionally use reset back to
charm default instead of specifying default config values in a
dictionary.
2020-09-15 15:31:28 +02:00
Frode Nordahl
5b2a2fee9c unit_tests: Replace patch decorators with BaseTestCase helpers 2020-09-15 15:31:25 +02:00
David Ames
23b24a5501 Merge pull request #365 from openstack-charmers/ovn-charm
Add OVS to OVN migration tests
2020-09-11 08:48:20 -07:00
Chris MacNaughton
c75f2fcb6d Ensure that zaza-openstack-tests can talk to an IPv6 Keystone
When configuring the address to use to talk to Keystone,
the format_addr helper should be used to ensure that an
IPv4 or IPv6 address can be correctly handled.
2020-09-08 11:11:13 +02:00
Frode Nordahl
fe329c1824 Add helper to retrieve tests_options for specific test
This is done by building a prefix for options key from dot-notated
absolute path to calling method or function.
2020-09-07 10:35:18 +02:00
Frode Nordahl
2e6a2ef534 Add helper to format IP addresses appropriately
The ``format_addr`` helper will allow you to write IP version
agnostic code by encapsulating IPv6 addresses in brackets ('[]').
2020-06-06 14:38:38 +02:00
Dmitrii Shcherbakov
740bc2060f Pass arguments BaseCharmTest.setUpClass
Not doing so triggers an incorrect behavior leading to functional test
failures as the application name is not set correctly.

https://github.com/openstack-charmers/zaza-openstack-tests/issues/256
https://review.opendev.org/#/c/712980/1
2020-05-04 20:45:55 +03:00