Skip HA router tests when not meant for OVN driver
Change is needed to check "l3-ha" extension with OVN router flavors.
This change allows to check if OVN backend or not, and add test skips
accordingly.
The tests used to run only against OVS driver, a subset of them was
found useful also with OVN, for instance this bug noticed by altered
tests:
https://bugzilla.redhat.com/show_bug.cgi?id=2263225
Fixes-Bug: PRODX-42818
Change-Id: I7c2c2f23417b3b43a2788b3c4bca2f8b532b7974
diff --git a/neutron_tempest_plugin/api/base.py b/neutron_tempest_plugin/api/base.py
index 33a403f..f5bb911 100644
--- a/neutron_tempest_plugin/api/base.py
+++ b/neutron_tempest_plugin/api/base.py
@@ -68,6 +68,21 @@
external_network_id = CONF.network.public_network_id
+ __is_driver_ovn = None
+
+ @classmethod
+ def _is_driver_ovn(cls):
+ ovn_agents = cls.os_admin.network_client.list_agents(
+ binary='ovn-controller')['agents']
+ return len(ovn_agents) > 0
+
+ @property
+ def is_driver_ovn(self):
+ if self.__is_driver_ovn is None:
+ if hasattr(self, 'os_admin'):
+ self.__is_driver_ovn = self._is_driver_ovn()
+ return self.__is_driver_ovn
+
@classmethod
def get_client_manager(cls, credential_type=None, roles=None,
force_new=None):