openstack-charmers / zaza-openstack-tests

OpenStack Charms Functional Test Library for Zaza
Apache License 2.0
7 stars 77 forks source link

octavia_tempest_plugin shouldn't run when the test bundle doesn't contain octavia #603

Open lourot opened 3 years ago

lourot commented 3 years ago

zaza.openstack.charm_tests.tempest.setup.render_tempest_config_keystone_v3's logic for detecting the presence of Octavia or not in the bundle is correct and properly produces a tempest.conf containing this when Octavia is absent:

[service_available]
octavia = false

However this seems not to be enough and running zaza.openstack.charm_tests.tempest.tests.TempestTest against such a bundle (with no Octavia) still attempts to run octavia_tempest_plugin.tests.scenario.v2.test_traffic_ops.TrafficOperationsScenarioTest.setUpClass, which then fails as follows:

setUpClass (octavia_tempest_plugin.tests.scenario.v2.test_traffic_ops.TrafficOperationsScenarioTest)
----------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/tempest/test.py", line 181, in setUpClass
    raise value.with_traceback(trace)

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/tempest/test.py", line 166, in setUpClass
    cls.setup_credentials()

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/octavia_tempest_plugin/tests/test_base.py", line 103, in setup_credentials
    super(LoadBalancerBaseTest, cls).setup_credentials()

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/tempest/test.py", line 422, in setup_credentials
    manager = cls.get_client_manager(roles=credentials_type[1:],

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/tempest/test.py", line 700, in get_client_manager
    creds = cred_provider.get_creds_by_roles(**params)

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/tempest/lib/common/dynamic_creds.py", line 495, in get_creds_by_roles
    return self.get_credentials(roles, scope=scope)

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/tempest/lib/common/dynamic_creds.py", line 395, in get_credentials
    credentials = self._create_creds(

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/tempest/lib/common/dynamic_creds.py", line 251, in _create_creds
    self.creds_client.assign_user_role(user, project, role)

      File "/home/ubuntu/Documents/git/charmed-openstack-tester/.tox/charm-upgrade-focal-ussuri/lib/python3.8/site-packages/tempest/lib/common/cred_client.py", line 78, in assign_user_role
    raise lib_exc.NotFound(msg)

    tempest.lib.exceptions.NotFound: Object not found
Details: No "load-balancer_member" role found
lourot commented 3 years ago

Can be reproduced with https://github.com/openstack-charmers/charmed-openstack-tester/pull/45