Allow LBaas integration tests to dynamically skip
lbaas v1 and v2 are mutually exclusive and cannot be enabled at the
same time within devstack. The current integation test goes after the
existing lbaas v1 resources with a devstack setup with the
q-lbaas service. This patch allow the test itself to
be smart enough to skip itself when the required lbaas version
is not available.
The current infra gate job template is hardcoded to only enable
lbaas v1 (q-lbaas), so the v1 test will continue to work properly
and the new v2 test (wip) will be dynamically skipped.
A follow up patch will modify the infra gate job template,
{pipeline}-heat-dsvm-functional-{engine}-{datastore}{branch-designator},
to also include an lbaas version. Then the job can setup either
a lbaas v1 or v2 devstack so both tests can be run.
Another follow up patch will flush out the lbaas v2 integration test
once the new resources have been merged.
blueprint: lbaasv2-suport
Change-Id: I0e4c83f1b078451607a30e8b665e309ea5e170d1
diff --git a/common/test.py b/common/test.py
index 8d8fa15..31efc01 100644
--- a/common/test.py
+++ b/common/test.py
@@ -18,6 +18,7 @@
import fixtures
from heatclient import exc as heat_exceptions
+from neutronclient.common import exceptions as network_exceptions
from oslo_log import log as logging
from oslo_utils import timeutils
import six
@@ -175,6 +176,13 @@
if net['name'] == net_name:
return net
+ def is_network_extension_supported(self, extension_alias):
+ try:
+ self.network_client.show_extension(extension_alias)
+ except network_exceptions.NeutronClientException:
+ return False
+ return True
+
@staticmethod
def _stack_output(stack, output_key, validate_errors=True):
"""Return a stack output value for a given key."""