Updated OpenContrail tests to support version 4
In OpenContrail 4 changed the way to collect status from Controller and
Analytic nodes.
Change-Id: I4c171671c0c9a2ec77fb6d11c1e3bb02ef035087
diff --git a/cvp_checks/fixtures/base.py b/cvp_checks/fixtures/base.py
index 96abad9..2407a63 100644
--- a/cvp_checks/fixtures/base.py
+++ b/cvp_checks/fixtures/base.py
@@ -12,3 +12,22 @@
@pytest.fixture(scope='session', params=nodes.values(), ids=nodes.keys())
def nodes_in_group(request):
return request.param
+
+
+def pytest_namespace():
+ return {'contrail': None}
+
+
+@pytest.fixture(scope='module')
+def contrail(local_salt_client):
+ probe = local_salt_client.cmd(
+ 'opencontrail:control',
+ 'pillar.get',
+ 'opencontrail:control:version',
+ expr_form='pillar')
+ if not probe:
+ pytest.skip("Contrail is not found on this environment")
+ versions = set(probe.values())
+ if len(versions) != 1:
+ pytest.fail('Contrail versions are not the same: {}'.format(probe))
+ pytest.contrail = str(versions.pop())[:1]