Commit Graph

49 Commits

Author SHA1 Message Date
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
James Page 018f1eac96 Merge pull request #398 from openstack-charmers/ceph-bluestore-compression
Ceph bluestore compression
2020-09-24 11:30:50 +01:00
Frode Nordahl c5a3f832d0 test_utils/config_change: Wait for agent to start executing
Avoid returning prior to the config change has even started.

Fixes: #419
2020-09-16 12:06:26 +02:00
Frode Nordahl 89ea43d0d5 Log resource cleanup failure and carry on
Fixes #417
2020-09-15 20:29:48 +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
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 29356f6419 Move cleanup of launched instances to common class
Use the nomenclature for resource cleanup as defined in the
`BaseCharmTest`.
2020-07-03 08:56:01 +02:00
Frode Nordahl 0df72bf47c Make shared resource cleanup method class instance method
At present the shared resource cleanup method is a class method.
This will prohibit descendents of the class to influence whether
cleanup should be run.

Remove the @classmethod decorator so that it will make its
descisions based on class instance variables set by the
descendent.
2020-07-03 08:55:57 +02:00
Frode Nordahl 0f3d9bf7c4 Move useful helpers from Neutron tests to OpenStackBaseTest
The dual-instance launch and retrieve is a common pattern in tests.

Let's share them.
2020-07-02 17:59:31 +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
Liam Young 6694caf281 Improve docstring and allo section override 2020-04-21 07:45:42 +00:00
Liam Young d652eff6d9 Add a helper for testing restart on changed
Most api charms test restart on changed by flipping the value of
debug. This has led to the same test being copied around. To reduce
the boiler plate code this change adds a new test helper which can
be used instead.
2020-04-21 07:16:58 +00:00
Aurelien Lourot 8b8155347e Fix typos 2020-04-19 16:58:24 +02:00
Aurelien Lourot ac227eab08 Fix copy-paste mistakes and typos and remove dead code 2020-04-16 15:10:03 +02:00
Liam Young cf2b0f21b9 Merge pull request #222 from openstack-charmers/issue/221
octavia: tear down resources created during LBaasV2 test
2020-04-08 07:34:41 +01:00
Frode Nordahl f35da80f27 Unpin flake8, fix lint
Add Python 3.8 env in Travis CI test matrix.

At present the pinning of flake8 disallows running of lint on
Python 3.8 systems.

Update flake8 ignore-list to ignore W504 instead of W503, the PEP
guidance is that either is ok, but there must be local consistency.

There are more occurences of binary operator before line-break
than after in this repository, and we have also chosen to ignore
W504 in most of our other repositories.
2020-04-07 11:14:49 +02:00
Liam Young be8889e581 Move new methods out of test class
The new methods assertActionRanOK & assertRemoteRunOK are useful in
setup as well as tests so it makes sense to move them out of the
test class.
2020-04-01 10:18:30 +00:00
Liam Young a3f1230aea Remove prints 2020-04-01 09:08:10 +00:00
Liam Young 588d38d4d7 Add custom assertions
Add custom assertions to check that remote actions and commands
run ok.
2020-04-01 08:58:36 +00:00
Liam Young 9cb7876e19 Add BaseCharmTest class without OpenStack setup.
The ceph-iscsi charm is a non-openstack api charm that also needs
config changed and pause/resume tests.
2020-03-31 16:22:03 +00:00
Frode Nordahl 1ece576981 radosgw: Pass local CA cert to client when relevant 2020-03-23 10:58:23 +01:00
Aurelien Lourot 707b36c0f8 Add a ceilometer test case and fix existing ones for trusty/mitaka
https://bugs.launchpad.net/charm-ceilometer/+bug/1828424
2020-03-05 11:11:49 +01:00
Adam Dyess b7890be342 _stringified config value of --> '' 2020-01-27 13:15:59 -06:00
Adam Dyess abfa96042f also don't cast config keys to str 2020-01-27 12:30:08 -06:00
Adam Dyess 056b2552fd resolve pep8 issues 2020-01-27 11:48:58 -06:00
Adam Dyess b080f5ff59 config_current doesn't need to flatten values to , but applying config to zaza.model does required all values are strings 2020-01-27 11:46:23 -06:00
Adam Dyess 0614ff5ad6 integrate comments from @thedac to improve waiting for stable, and some documentation issues 2020-01-24 12:59:58 -06:00
Adam Dyess 7063056844 use ':' style argument definitions rather than '@' 2020-01-24 11:23:09 -06:00
Adam Dyess e294034018 improve docstrings for config_current 2020-01-22 13:14:12 -06:00
Adam Dyess b75aaa79c5 Resolve pep8 violations 2020-01-22 09:33:58 -06:00
Adam Dyess b4f1201da2 Integrate suggestions from ajkavanagh 2020-01-22 09:30:48 -06:00
Chris MacNaughton 5a65e05c37 Merge pull request #136 from gnuoy/make-OpenStackBaseTest-multimodel-friendly
Make OpenStackBaseTest model_alias aware
2019-11-29 12:30:34 +01:00
Liam Young e63fb86df2 Make OpenStackBaseTest model_alias aware 2019-11-29 11:04:53 +00:00
Liam Young 5e9440dd97 Define run_resource_cleanup in OpenStackBaseTest so all sub-classes inherit it 2019-11-28 15:17:32 +00:00
Liam Young b6c649c00b Guard against run_resource_cleanup being unset
A test may not call the base class setup so may be missing
run_resource_cleanup in which case teardown will fail. Guard against
that and default to False.
2019-11-28 14:59:46 +00:00
Liam Young e839a19321 Flip default for cleanup to False 2019-11-27 10:29:06 +00:00
Liam Young 39cb8ea0cc Add support for tests defining resource_cleanup
Add support for tests having a resource_cleanup method. Whether this
is run or not is dictated by the class variable
'run_resource_cleanup'. By default this will be True but any test
can switch it to False so that resources created by the tests are
preserved. Helpful for debugging failures.

FWIW future work might include automatically disabling resource
cleanup if a test fail is detected.
2019-11-27 09:05:01 +00:00
Frode Nordahl 8d676bf9fa Make non-existent tests/tests.yaml non-fatal where possible
Not all test environments or runners are equal, don't crash on
non-existent test config.
2019-11-05 16:38:06 +01:00
Chris MacNaughton 2888e62e3a Add ceph pg tuning test 2019-09-05 14:30:49 +02:00
David Ames 138bd11207 Zaza tests for percona-cluster
Port over amulet tests to zaza for percona-cluster.
Add testing of new feature actions for cold start tests: bootstrap-pxc
and notify-bootstrapped.
2019-07-15 07:51:54 -07:00
Liam Young cb6df2f689 Allow test to override application name
Allow tests to override the default application name as it may not
match what is in the tests.yaml, particularly in the case of CMR
tests.
2019-07-03 06:49:54 +01:00
Frode Nordahl b6eadf243b Fix lint
Also re-enable unit tests for the resident utilities etc.
2019-06-27 11:33:52 +02:00
Chris MacNaughton 83e4ca7247 Ensure we use pgrep >= bionic-stein 2019-06-26 10:24:07 +02:00
Liam Young 648ac9262b Expose resource_removeds retry options (#11)
resource_removed is used in many places to monitor removal of
different kinds of OpenStack resource. It is reasonable to expect a
flavor to be removed in a few seconds where as an image based instance
may take minutes to be removed. With that in mind this change
exposes the retry options used by tenacity allowing the caller to
set reasonable expectations for the resource removal.
2019-05-23 11:16:03 +02:00
Liam Young 9721fe5d42 Fix restart_on_changed helper (#6)
The restart_on_changed helper was moved to use the config_change
context manager but the code that checks that the config file is
correctly reverted at the end of the test was accidently left within
the context.
2019-05-17 15:08:58 +02:00
Chris MacNaughton dd434e281e Add zaza namespacing, starting with openstack 2019-04-25 17:46:03 +02:00