For the NDR data plane testing case those checks cannot be performed
from the node that runs Zaza and instead need to be performed from a
unit that receives dynamic routes from the BGP speaker.
In order to allow for that case an additional argument is introduced.
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.
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
* Add keystone-openidc setup code.
The keystone-openidc charm requires 2 configuration steps:
1) Configure the oidc-client-id, oidc-client-secret and
oidc-provider-metadata-url, this information is tightly related to
the Identity Provider configured, which for testing purposes this is
the openidc-test-fixture charm, the setup function
zaza.openstack.charm_tests.openidc.setup.configure_keystone_openidc
takes care of setting these values once the fixture charm is ready
for service.
2) Create the OpenStack objects to correctly configure the federation,
this is made by the setup function
zaza.openstack.charm_tests.openidc.setup.keystone_federation_setup_site1
which will create and configure the following resources:
- Create a domain named 'federated_domain'.
- Create a group named 'federated_users'.
- Grant the 'Member' role to users in the 'federated_users' group.
- Create an identity provider named 'openid'.
- Create a mapping named 'openid_mapping'.
- Create a federation protocol named 'openid' that relates the mapping
and the identity provider.
* Add support for v3oidcpassword auth plugin.
get_keystone_session() uses the v3.OidcPassword class when the
OS_AUTH_TYPE is set to v3oidcpassword, this class expects the following
extra configuration options:
- OS_IDENTITY_PROVIDER
- OS_PROTOCOL
- OS_CLIENT_ID
- OS_CLIENT_SECRET
- OS_ACCESS_TOKEN_ENDPOINT (optional)
- OS_DISCOVERY_ENDPOINT (optional)
* Add test for keystone-openidc
This patch introduces a new testing class named CharmKeystoneOpenIDCTest
which interacts with keystone using users provided by
openidc-test-fixture via OpenID Connect.
* Add keystone_session argument to launch instances.
Adding the option to pass a keystone session allows callers to use
credentials different from the ones provided by
get_overcloud_keystone_session(), this is helpful when testing non
default keystone configurations (e.g. Federation).
* Add zaza.openstack.charm_tests.openidc.tests.TestLaunchInstance
This testing class configures a private network in the user's project defined by the mapping
rules during the setUpClass stage. Specifically this test performs the following steps:
- Create keypair named 'zaza' in the user's project
- Create a router for the project
- Attach the router to the external network
- Create a network
- Create a subnet attached to the previously create network
- Connect the subnet to the project's router
The testing method launches an instance using a keystone session
associated with a user backed by OpenID Connect.
Update CPU topology flavor advice.
The example currently listed would create a two socket CPU with
only one NUMA node, which is a invalid configuration which leads
to undefined results.
Instead list two examples one with a single socket for simpler
end to end tests and a two socket two numa node example for more
advanced low level tests.
The test will prepare hypervisor units in virtual machines by
enabling hugepages configuration and rebooting them and
subsequent required runtime changes. If the hypervisor units
are physical machines the test assumes they already have
received the appropriate configuration from the bare metal
provisioning system.
Launch nested instance using flavor that enables hugepages and
attach it directly to the external network and perform
connectivity tests.
After a successful test the hypervisor units are brought back
to their original state to not influence subsequent tests.
Allow launching an instance and attaching it directly to the
external provider network. This is useful in its own right and
is also a requirement in order to successfully test some
configurations.
* Make run_package_change_test more robust
The run_package_change_test disables auto restarts and then
simulates a packages update. It then checks the service has been
marked as in need of restarting. However bug #1955498 shows that
if a new service is introduced that restarts a disabled service
then this is not picked up by the tests.
This change queries the last active time of a service proir to
the package being updated. If this changes after the package
reconfiguration then the service has incorrectly been restarted.
Depends-On: https://github.com/openstack-charmers/zaza/pull/478
* Log success too
If there are multiple charms of a given application then a hook
like leader-settings-changed can trigger a deferred hook. So a
race can occur where the deferred hooks of unit1 are cleared
then in the process of clearing unit2 a deferred hook is
triggerred in unit1. To fix this do not block on the wl status
message after the hook test completes.
Also, make sure that an action failure is fatal to surface any
issues.
* Add ovn-chassis test
* Yet another refactor to reduce the amount that implementations need to override.
* Add ovn dedicated chassis support
* Fix race with checking wlm
* Updates to concurrent series upgrade
Updates to make it run more in parallel and spend less time waiting on
the whole model when updating machines.
* Make the concurrent series upgrade tests work
This is a number of changes to get the concurrent (here called
'parallel' historically) series upgrade tests to work. A number of
changes were required which included limiting the number of concurrent
async co-routines (futures) that could be run as with large models it
hits the limits of the Py3 runtime.
* Fix the tests and change pause order in maybe_pause_things
Due to an additional model helper call, an additional model AsyncMock is
required. Also the pause order had changed, and this is restored to
ensure the original design is retained (for pause order).
Clean up some commented out code and sort out a few PEP8 errors.
* Update comment to reflect code (3 -> 4)
* Fix tests that fail on bionic but pass on focal
Essentially, asyncio.gather has different behaviour on bionic that
focal. Although this doesn't affect testing, it does affect the unit
tests. These changes are simply to normalise the behaviour of unit
tests on focal and bionic.
- 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)
Fix z-o-t so that tests that specify an application name can
be run irrespective of whether the charm_name has been set in
tests.yaml. Closes issue #442
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
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.
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.
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.
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.
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.