Add a runner for contrail-test Juniper tests
- add steps in tcp_tests/templates/opencontrail to prepare tests
- add a fixture and a test runner 'test_opencontrail' that gets
the two variables from environment to pass them to test runner:
export OPENCONTRAIL_TAGS=smoke
export OPENCONTRAIL_FEATURES=neutron
- fix docstrings for fixtures
- add print of the environment variables that can be used in tests
and current defaults (taking into account the exported variables)
diff --git a/tcp_tests/fixtures/common_services_fixtures.py b/tcp_tests/fixtures/common_services_fixtures.py
index 4a4ee1d..ed00574 100644
--- a/tcp_tests/fixtures/common_services_fixtures.py
+++ b/tcp_tests/fixtures/common_services_fixtures.py
@@ -27,13 +27,11 @@
@pytest.fixture(scope='function')
def common_services_actions(config, underlay):
- """Fixture that provides various actions for K8S
+ """Fixture that provides various actions for CommonServices
:param config: fixture provides oslo.config
:param underlay: fixture provides underlay manager
- :rtype: K8SManager
-
- For use in tests or fixtures to deploy a custom K8S
+ :rtype: CommonServicesManager
"""
return common_services_manager.CommonServicesManager(config, underlay)
@@ -42,27 +40,32 @@
def common_services_deployed(revert_snapshot, request, config,
hardware, underlay, salt_deployed,
common_services_actions):
- """Fixture to get or install TCP on environment
+ """Fixture to get or install common services on the environment
+ :param revert_snapshot: fixture that reverts snapshot that is specified
+ in test with @pytest.mark.revert_snapshot(<name>)
:param request: fixture provides pytest data
:param config: fixture provides oslo.config
:param hardware: fixture provides enviromnet manager
:param underlay: fixture provides underlay manager
- :param tcp_actions: fixture provides TCPManager instance
- :rtype: TCPManager
+ :param common_services_actions: fixture provides CommonServicesManager
+ instance
+ :rtype: CommonServicesManager
- If config.tcp.tcp_host is not set, this fixture assumes that
- the tcp cluster was not deployed, and do the following:
- - deploy tcp cluster
- - make snapshot with name 'tcp_deployed'
- - return TCPCluster instance
+ If config.common_services.common_services_installed is not set, this
+ fixture assumes that the common services were not installed
+ , and do the following:
+ - install common services
+ - make snapshot with name 'common_services_deployed'
+ - return CommonServicesManager
- If config.tcp.tcp_host was set, this fixture assumes that the tcp
- cluster was already deployed, and do the following:
- - return TCPCluster instance
+ If config.common_services.common_services_installed was set, this fixture
+ assumes that the common services were already installed, and do
+ the following:
+ - return CommonServicesManager instance
- If you want to revert 'tcp_deployed' snapshot, please use mark:
- @pytest.mark.revert_snapshot("tcp_deployed")
+ If you want to revert 'common_services_deployed' snapshot, please use mark:
+ @pytest.mark.revert_snapshot("common_services_deployed")
"""
# If no snapshot was reverted, then try to revert the snapshot
# that belongs to the fixture.
@@ -74,7 +77,7 @@
hardware.revert_snapshot(ext.SNAPSHOT.common_services_deployed)
# Create Salt cluster
- if not config.common_services.installed:
+ if not config.common_services.common_services_installed:
steps_path = config.common_services_deploy.common_services_steps_path
with underlay.yaml_editor(steps_path) as commands:
common_services_actions.install(commands.content)
diff --git a/tcp_tests/fixtures/opencontrail_fixtures.py b/tcp_tests/fixtures/opencontrail_fixtures.py
new file mode 100644
index 0000000..a00acc7
--- /dev/null
+++ b/tcp_tests/fixtures/opencontrail_fixtures.py
@@ -0,0 +1,32 @@
+# Copyright 2016 Mirantis, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+
+import pytest
+
+from tcp_tests.managers import opencontrail_manager
+
+
+@pytest.fixture(scope='function')
+def opencontrail(config, underlay, openstack_deployed):
+ """Fixture that provides various actions for OpenContrail
+
+ :param config: fixture provides oslo.config
+ :param underlay: fixture provides underlay manager
+ :rtype: OpenContrailManager
+
+ """
+ return opencontrail_manager.OpenContrailManager(config, underlay,
+ openstack_deployed)
+
diff --git a/tcp_tests/fixtures/openstack_fixtures.py b/tcp_tests/fixtures/openstack_fixtures.py
index 48e9125..c7e648e 100644
--- a/tcp_tests/fixtures/openstack_fixtures.py
+++ b/tcp_tests/fixtures/openstack_fixtures.py
@@ -42,27 +42,29 @@
def openstack_deployed(revert_snapshot, request, config,
hardware, underlay, common_services_deployed,
openstack_actions):
- """Fixture to get or install TCP on environment
+ """Fixture to get or install OpenStack services on environment
+ :param revert_snapshot: fixture that reverts snapshot that is specified
+ in test with @pytest.mark.revert_snapshot(<name>)
:param request: fixture provides pytest data
:param config: fixture provides oslo.config
:param hardware: fixture provides enviromnet manager
:param underlay: fixture provides underlay manager
- :param tcp_actions: fixture provides TCPManager instance
- :rtype: TCPManager
+ :param tcp_actions: fixture provides OpenstackManager instance
+ :rtype: OpenstackManager
- If config.tcp.tcp_host is not set, this fixture assumes that
- the tcp cluster was not deployed, and do the following:
- - deploy tcp cluster
- - make snapshot with name 'tcp_deployed'
- - return TCPCluster instance
+ If config.openstack.openstack_installed is not set, this fixture assumes
+ that the openstack services were not installed, and do the following:
+ - install openstack services
+ - make snapshot with name 'openstack_deployed'
+ - return OpenstackManager instance
- If config.tcp.tcp_host was set, this fixture assumes that the tcp
- cluster was already deployed, and do the following:
- - return TCPCluster instance
+ If config.openstack.openstack_installed was set, this fixture assumes that
+ the openstack services were already installed, and do the following:
+ - return OpenstackManager instance
- If you want to revert 'tcp_deployed' snapshot, please use mark:
- @pytest.mark.revert_snapshot("tcp_deployed")
+ If you want to revert 'openstack_deployed' snapshot, please use mark:
+ @pytest.mark.revert_snapshot("openstack_deployed")
"""
# If no snapshot was reverted, then try to revert the snapshot
# that belongs to the fixture.
@@ -73,7 +75,7 @@
hardware.revert_snapshot(ext.SNAPSHOT.openstack_deployed)
# Create Salt cluster
- if not config.openstack.installed:
+ if not config.openstack.openstack_installed:
steps_path = config.openstack_deploy.openstack_steps_path
with underlay.yaml_editor(steps_path) as commands:
openstack_actions.install(commands.content)
diff --git a/tcp_tests/fixtures/salt_fixtures.py b/tcp_tests/fixtures/salt_fixtures.py
index e22b16f..047f106 100644
--- a/tcp_tests/fixtures/salt_fixtures.py
+++ b/tcp_tests/fixtures/salt_fixtures.py
@@ -27,13 +27,11 @@
@pytest.fixture(scope='function')
def salt_actions(config, underlay):
- """Fixture that provides various actions for K8S
+ """Fixture that provides various actions for salt
:param config: fixture provides oslo.config
:param underlay: fixture provides underlay manager
- :rtype: K8SManager
-
- For use in tests or fixtures to deploy a custom K8S
+ :rtype: SaltManager
"""
return saltmanager.SaltManager(config, underlay)
@@ -41,27 +39,29 @@
@pytest.fixture(scope='function')
def salt_deployed(revert_snapshot, request, config,
hardware, underlay, salt_actions):
- """Fixture to get or install TCP on environment
+ """Fixture to get or install salt service on environment
+ :param revert_snapshot: fixture that reverts snapshot that is specified
+ in test with @pytest.mark.revert_snapshot(<name>)
:param request: fixture provides pytest data
:param config: fixture provides oslo.config
:param hardware: fixture provides enviromnet manager
:param underlay: fixture provides underlay manager
- :param tcp_actions: fixture provides TCPManager instance
- :rtype: TCPManager
+ :param salt_actions: fixture provides SaltManager instance
+ :rtype: SaltManager
- If config.tcp.tcp_host is not set, this fixture assumes that
- the tcp cluster was not deployed, and do the following:
- - deploy tcp cluster
- - make snapshot with name 'tcp_deployed'
- - return TCPCluster instance
+ If config.salt.salt_master_host is not set, this fixture assumes that
+ the salt was not installed, and do the following:
+ - install salt master and salt minions
+ - make snapshot with name 'salt_deployed'
+ - return SaltManager
- If config.tcp.tcp_host was set, this fixture assumes that the tcp
- cluster was already deployed, and do the following:
- - return TCPCluster instance
+ If config.salt.salt_master_host was set, this fixture assumes that the
+ salt was already deployed, and do the following:
+ - return SaltManager instance
- If you want to revert 'tcp_deployed' snapshot, please use mark:
- @pytest.mark.revert_snapshot("tcp_deployed")
+ If you want to revert 'salt_deployed' snapshot, please use mark:
+ @pytest.mark.revert_snapshot("salt_deployed")
"""
# If no snapshot was reverted, then try to revert the snapshot
# that belongs to the fixture.
diff --git a/tcp_tests/helpers/oslo_cfg_types.py b/tcp_tests/helpers/oslo_cfg_types.py
index 7465ad0..962f2d3 100644
--- a/tcp_tests/helpers/oslo_cfg_types.py
+++ b/tcp_tests/helpers/oslo_cfg_types.py
@@ -101,6 +101,13 @@
"""Wrapper for cfg.Opt class that reads default form evironment variables.
"""
def __init__(self, *args, **kwargs):
+
+ env_var_name = args[0].upper()
+ if 'default' in kwargs:
+ kwargs['default'] = os.environ.get(env_var_name, kwargs.get('default', None))
super(Cfg, self).__init__(*args, **kwargs)
- env_var_name = self.name.upper()
- self.default = os.environ.get(env_var_name, self.default)
+
+ # Print info about default environment variables to console
+ print ('{}={} # {}'.format(env_var_name,
+ kwargs.get('default', ''),
+ kwargs.get('help', '')))
diff --git a/tcp_tests/managers/common_services_manager.py b/tcp_tests/managers/common_services_manager.py
index 7735f9a..a91eb46 100644
--- a/tcp_tests/managers/common_services_manager.py
+++ b/tcp_tests/managers/common_services_manager.py
@@ -26,4 +26,4 @@
def install(self, commands):
self.__underlay.execute_commands(commands,
label='Install common services')
- self.__config.common_services.installed = True
+ self.__config.common_services.common_services_installed = True
diff --git a/tcp_tests/managers/opencontrail_manager.py b/tcp_tests/managers/opencontrail_manager.py
new file mode 100644
index 0000000..3c6621c
--- /dev/null
+++ b/tcp_tests/managers/opencontrail_manager.py
@@ -0,0 +1,49 @@
+# Copyright 2016 Mirantis, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class OpenContrailManager(object):
+ """docstring for OpenstackManager"""
+
+ __config = None
+ __underlay = None
+ __openstack_actions = None
+
+ def __init__(self, config, underlay, openstack_deployed):
+ self.__config = config
+ self.__underlay = underlay
+ self.__openstack_actions = openstack_deployed
+ super(OpenContrailManager, self).__init__()
+
+ def prepare_tests(commands):
+ self.__underlay.execute_commands(commands=commands,
+ label="Prepare Juniper contrail-test")
+
+ def run_tests(tags='', features=''):
+ cmd = "salt 'ctl01*' grains.get fqdn|tail -n1"
+ result = self.__underlay.check_call(
+ cmd, host=self.__config.salt.salt_master_host)
+
+ ctl01_name = result['stdout'].strip()
+
+
+ cmd = '. /etc/contrail/openstackrc; cd /opt/contrail-test; ./run_tests.sh'
+ if tags != '':
+ cmd += ' --tags ' + tags
+
+ if features != '':
+ cmd += ' --features ' + features
+
+ self.__underlay.check_call(
+ cmd,
+ node_name=ctl01_name)
diff --git a/tcp_tests/managers/openstack_manager.py b/tcp_tests/managers/openstack_manager.py
index 785f100..b8725bd 100644
--- a/tcp_tests/managers/openstack_manager.py
+++ b/tcp_tests/managers/openstack_manager.py
@@ -26,4 +26,4 @@
def install(self, commands):
self.__underlay.execute_commands(commands=commands,
label="Install OpenStack services")
- self.__config.openstack.installed = True
+ self.__config.openstack.openstack_installed = True
diff --git a/tcp_tests/settings_oslo.py b/tcp_tests/settings_oslo.py
index 88633a0..8190720 100644
--- a/tcp_tests/settings_oslo.py
+++ b/tcp_tests/settings_oslo.py
@@ -22,6 +22,8 @@
from tcp_tests.helpers import oslo_cfg_types as ct
from tcp_tests import settings
+print ("\n" + "-" * 10 + " Initialize oslo.config variables with defaults"
+ " from environment" + "-" * 10)
_default_conf = pkg_resources.resource_filename(
__name__, 'templates/underlay/{0}.yaml'.format(settings.LAB_CONFIG_NAME))
@@ -35,6 +37,9 @@
_default_openstack_steps = pkg_resources.resource_filename(
__name__, 'templates/openstack/{0}-openstack.yaml'.format(
settings.LAB_CONFIG_NAME))
+_default_opencontrail_prepare_tests_steps_path = pkg_resources.resource_filename(
+ __name__, 'templates/opencontrail/{0}-opencontrail.yaml'.format(
+ settings.LAB_CONFIG_NAME))
hardware_opts = [
@@ -92,7 +97,7 @@
]
common_services_opts = [
- ct.Cfg('installed', ct.Boolean(),
+ ct.Cfg('common_services_installed', ct.Boolean(),
help="", default=False),
]
@@ -102,12 +107,21 @@
default=_default_openstack_steps),
]
openstack_opts = [
- ct.Cfg('installed', ct.Boolean(),
+ ct.Cfg('openstack_installed', ct.Boolean(),
help="", default=False),
- ct.Cfg('keystone_endpoint', ct.String(),
+ ct.Cfg('openstack_keystone_endpoint', ct.String(),
help="", default=''),
]
+opencontrail_opts = [
+ ct.Cfg('opencontrail_tags', ct.String(),
+ help="", default=''),
+ ct.Cfg('opencontrail_features', ct.String(),
+ help="", default=''),
+ ct.Cfg('opencontrail_prepare_tests_steps_path', ct.String(),
+ help="Path to YAML with steps to prepare contrail-tests",
+ default=_default_opencontrail_prepare_tests_steps_path),
+]
_group_opts = [
('hardware', hardware_opts),
@@ -118,6 +132,7 @@
('common_services', common_services_opts),
('openstack_deploy', openstack_deploy_opts),
('openstack', openstack_opts),
+ ('opencontrail', opencontrail_opts),
]
@@ -158,6 +173,10 @@
title="Openstack deploy config and credentials",
help=""))
config.register_opts(group='openstack_deploy', opts=openstack_deploy_opts)
+
+ config.register_group(cfg.OptGroup(name='opencontrail',
+ title="Options for Juniper contrail-tests", help=""))
+ config.register_opts(group='opencontrail', opts=opencontrail_opts)
return config
diff --git a/tcp_tests/templates/opencontrail/mk22-lab-advanced-opencontrail.yaml b/tcp_tests/templates/opencontrail/mk22-lab-advanced-opencontrail.yaml
new file mode 100644
index 0000000..a9b0b59
--- /dev/null
+++ b/tcp_tests/templates/opencontrail/mk22-lab-advanced-opencontrail.yaml
@@ -0,0 +1,15 @@
+# Prepare Juniper contrail-test
+
+- description: Allow password authentication for SSH on compute nodes
+ cmd: salt 'cmp*' cmd.run "sed -i -e 's/^PasswordAuthentication./PasswordAuthentication yes/' /etc/ssh/sshd_config ; service ssh restart"
+ node_name: cfg01.mk22-lab-basic.local
+
+- description: Install contrail-test on ctl01
+ cmd: wget https://raw.githubusercontent.com/Juniper/contrail-test-ci/master/install.sh;
+ chmod +x ./install.sh;
+ ./install.sh install contrail-test --ci-ref R3.0.2.x --fab-ref R3.0.2.x --test-ref R3.0.2.x;
+ node_name: ctl01.mk22-lab-basic.local
+
+- description: Install OpenJDK-7 for contrail tests
+ cmd: apt-get -y install openjdk-7-jdk
+ node_name: ctl01.mk22-lab-basic.local
diff --git a/tcp_tests/templates/opencontrail/mk22-lab-basic-opencontrail.yaml b/tcp_tests/templates/opencontrail/mk22-lab-basic-opencontrail.yaml
new file mode 100644
index 0000000..7838d18
--- /dev/null
+++ b/tcp_tests/templates/opencontrail/mk22-lab-basic-opencontrail.yaml
@@ -0,0 +1,110 @@
+# Prepare Juniper contrail-test
+
+- description: Allow password authentication for SSH on compute nodes
+ cmd: salt 'cmp*' cmd.run "sed -i -e 's/^PasswordAuthentication./PasswordAuthentication yes/' /etc/ssh/sshd_config ; service ssh restart"
+ node_name: cfg01.mk22-lab-basic.local
+
+- description: Install contrail-test on ctl01
+ cmd: wget https://raw.githubusercontent.com/Juniper/contrail-test-ci/master/install.sh;
+ chmod +x ./install.sh;
+ ./install.sh install contrail-test --ci-ref R3.0.2.x --fab-ref R3.0.2.x --test-ref R3.0.2.x;
+ node_name: ctl01.mk22-lab-basic.local
+
+- description: Install OpenJDK-7 for contrail tests
+ cmd: apt-get -y install openjdk-7-jdk
+ node_name: ctl01.mk22-lab-basic.local
+
+- description: Create testbed.py with lab parameters
+ cmd: |
+ cat << EOF >> /opt/contrail/utils/fabfile/testbeds/testbed.py
+ from fabric.api import env
+
+ #Management ip addresses of hosts in the cluster
+ os_ctrl_1 = 'root@172.16.10.101'
+ os_ctrl_2 = 'root@172.16.10.102'
+ os_ctrl_3 = 'root@172.16.10.103'
+ c_ctrl_1 = 'root@172.16.10.101'
+ c_ctrl_2 = 'root@172.16.10.102'
+ c_ctrl_3 = 'root@172.16.10.103'
+ c_compute_1 = 'root@172.16.10.105'
+ #c_compute_2 = 'root@10.84.30.51'
+ vip_ctrl = 'root@172.16.10.254'
+
+ ext_routers = [
+ ('gateway1','192.168.10.1'),
+ #('gateway2','10.110.1.1'),
+ ]
+
+ #Autonomous system number
+ router_asn = 64512
+
+ #Host from which the fab commands are triggered to install and provision
+ deploy_node = 'root@172.16.10.101'
+
+ #Role definition of the hosts.
+ env.roledefs = {
+ 'all': [os_ctrl_1,c_ctrl_1,c_ctrl_2,c_ctrl_3,os_ctrl_2,os_ctrl_3,c_compute_1],
+ 'cfgm': [c_ctrl_1,c_ctrl_2,c_ctrl_3],
+ 'openstack': [os_ctrl_1,os_ctrl_2,os_ctrl_3],
+ 'control': [c_ctrl_1,c_ctrl_2,c_ctrl_3],
+ 'compute': [c_compute_1],
+ 'collector': [c_ctrl_1,c_ctrl_2,c_ctrl_3],
+ #'webui': [c_ctrl_1,c_ctrl_2,c_ctrl_3],
+ 'webui': [vip_ctrl],
+ 'database': [c_compute_1],
+ 'build': [deploy_node],
+ }
+ #Openstack admin password
+ env.openstack_admin_password = 'admin'
+ env.password = 'r00tme'
+ #Passwords of each host
+ env.passwords = {
+ os_ctrl_1: 'r00tme',
+ c_ctrl_1: 'r00tme',
+ c_ctrl_2: 'r00tme',
+ c_ctrl_3: 'r00tme',
+ os_ctrl_2: 'r00tme',
+ os_ctrl_3: 'r00tme',
+ c_compute_1: 'r00tme',
+ deploy_node: 'r00tme',
+ }
+
+ env.ha = {
+ 'internal_vip' : '172.16.10.254',
+ #'external_vip' : '10.84.30.65',
+ 'contrail_internal_vip' : '172.16.10.254',
+ #'contrail_external_vip' : '192.168.200.254',
+ }
+
+ multi_tenancy = True
+ env.keystone = {
+ 'admin_user' : 'admin',
+ 'admin_password' : 'workshop',
+ 'service_tenant': 'admin',
+ 'admin_tenant' : 'admin',
+ 'keystone_ip' : '172.16.10.254',
+ }
+
+ os_username = 'admin'
+ os_password = 'workshop'
+ os_tenant_name = 'admin'
+
+
+ control_data = {
+ os_ctrl_1 : { 'ip': '172.16.10.101/24', 'gw' : '172.16.10.1', 'device':'eth1' },
+ os_ctrl_2 : { 'ip': '172.16.10.102/24', 'gw' : '172.16.10.1', 'device':'eth1' },
+ os_ctrl_3 : { 'ip': '172.16.10.103/24', 'gw' : '172.16.10.1', 'device':'eth1' },
+ c_ctrl_1 : { 'ip': '172.16.10.101/24', 'gw' : '172.16.10.1', 'device':'eth1' },
+ c_ctrl_2 : { 'ip': '172.16.10.102/24', 'gw' : '172.16.10.1', 'device':'eth1' },
+ c_ctrl_3 : { 'ip': '172.16.10.103/24', 'gw' : '172.16.10.1', 'device':'eth1' },
+ c_compute_1 : { 'ip': '172.16.10.105/24', 'gw' : '172.16.10.1', 'device':'eth1' },
+ }
+
+ env.test = {
+ 'mail_to': 'user@test.mlx',
+ 'mail_server': '10.204.x.x',
+ 'mail_sender': 'mailer@juniper.net'
+ }
+ EOF
+
+ node_name: ctl01.mk22-lab-basic.local
diff --git a/tcp_tests/tests/system/conftest.py b/tcp_tests/tests/system/conftest.py
index afee802..90f0fd4 100644
--- a/tcp_tests/tests/system/conftest.py
+++ b/tcp_tests/tests/system/conftest.py
@@ -20,6 +20,7 @@
from tcp_tests.fixtures.salt_fixtures import *
from tcp_tests.fixtures.common_services_fixtures import *
from tcp_tests.fixtures.openstack_fixtures import *
+from tcp_tests.fixtures.opencontrail_fixtures import *
__all__ = sorted([ # sort for documentation
# common_fixtures
@@ -42,4 +43,6 @@
# openstack_fixtures
'openstack_actions',
'openstack_deployed',
+ # component fixtures
+ 'opencontrail',
])
diff --git a/tcp_tests/tests/system/test_opencontrail.py b/tcp_tests/tests/system/test_opencontrail.py
new file mode 100644
index 0000000..3746a3b
--- /dev/null
+++ b/tcp_tests/tests/system/test_opencontrail.py
@@ -0,0 +1,49 @@
+# Copyright 2016 Mirantis, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+import copy
+import time
+
+import pytest
+
+from tcp_tests import settings
+from tcp_tests.helpers import ext
+from tcp_tests import logger
+
+LOG = logger.logger
+
+
+@pytest.mark.deploy
+class TestOpenContrail(object):
+ """Test class for testing OpenContrail on a TCP lab"""
+
+ @pytest.mark.revert_snapshot(ext.SNAPSHOT.openstack_deployed)
+ # @pytest.mark.snapshot_needed
+ # @pytest.mark.fail_snapshot
+ def test_opencontrail(self, config, openstack_deployed,
+ show_step, opencontrail):
+ """Runner for Juniper contrail-tests
+
+ Scenario:
+ 1. Prepare salt on hosts
+ 2. Setup controller nodes
+ 3. Setup compute nodes
+ 4. Prepare contrail-tests on ctl01 node
+ 5. Run contrail-tests
+ """
+ opencontrail.prepare_tests(
+ config.opencontrail.opencontrail_prepare_tests_steps_path)
+
+ opencontrail.run_tests(
+ tags=config.opencontrail.opencontrail_tags,
+ features=config.opencontrail.opencontrail_features)