diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_bgpvpn.py b/tungsten_tempest_plugin/tests/api/contrail/test_bgpvpn.py
new file mode 100644
index 0000000..2034b27
--- /dev/null
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_bgpvpn.py
@@ -0,0 +1,101 @@
+"""Tempest Suite for Contrail BGP_VPN."""
+# Copyright 2018 AT&T Intellectual Property.
+# All other rights reserved.
+#
+#    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.
+
+from patrole_tempest_plugin import rbac_rule_validation
+from tempest import config
+from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
+
+from tungsten_tempest_plugin.tests.api.contrail import rbac_base
+
+CONF = config.CONF
+
+
+class BgpvpnTest(rbac_base.BaseContrailTest):
+    """Test suite for validating RBAC functionality of 'bgpvpn' API."""
+
+    @classmethod
+    def skip_checks(cls):
+        super(BgpvpnTest, cls).skip_checks()
+        if float(CONF.sdn.contrail_version) < 4:
+            msg = "bgpvpn requires Contrail >= 4"
+            raise cls.skipException(msg)
+
+    @classmethod
+    def resource_setup(cls):
+        """Create Bgpvpn to use across the Suite."""
+        super(BgpvpnTest, cls).resource_setup()
+        cls.bgpvpn_uuid = cls._create_bgpvpn()
+
+    @classmethod
+    def _create_bgpvpn(cls):
+        """Create Bgpvpn."""
+        bgpvpn_name = data_utils.rand_name('test-bgpvpn')
+        bgpvpn_fq_name = ['default-domain', cls.tenant_name, bgpvpn_name]
+        resp_body = cls.contrail_client.create_bgpvpn(
+            parent_type='project',
+            fq_name=bgpvpn_fq_name)
+        bgpvpn_uuid = resp_body['bgpvpn']['uuid']
+        cls.addClassResourceCleanup(
+            cls._try_delete_resource,
+            cls.contrail_client.delete_bgpvpn,
+            bgpvpn_uuid)
+        return bgpvpn_uuid
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["list_bgpvpns"])
+    @decorators.idempotent_id('65afb5d5-52cb-484c-9e8e-42509be7dd77')
+    def test_list_bgpvpns(self):
+        """Test whether current role can list of bgpvpns."""
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.list_bgpvpns()
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["create_bgpvpns"])
+    @decorators.idempotent_id('c3a7510c-c8d6-4736-9962-5c1aa032bf79')
+    def test_create_bgpvpns(self):
+        """Test whether current role can create bgpvpn."""
+        with self.rbac_utils.override_role(self):
+            self._create_bgpvpn()
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["show_bgpvpn"])
+    @decorators.idempotent_id('2fd05ca2-97d8-477c-aead-a881a2ba5e7e')
+    def test_show_bgpvpn(self):
+        """Test whether current role can get bgpvpn details."""
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.show_bgpvpn(
+                self.bgpvpn_uuid)
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["delete_bgpvpn"])
+    @decorators.idempotent_id('919aa2bb-1556-4dcf-bbef-0a31f9c6464b')
+    def test_delete_bgpvpn(self):
+        """Test whether current role can delete bgpvpn details."""
+        new_bgpvpn_uuid = self._create_bgpvpn()
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.delete_bgpvpn(
+                new_bgpvpn_uuid)
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["update_bgpvpn"])
+    @decorators.idempotent_id('ae734791-eaeb-4ca9-908a-59d0eac1a3c0')
+    def test_update_bgpvpn(self):
+        """Test whether current role can update bgpvpn."""
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.update_bgpvpn(
+                self.bgpvpn_uuid,
+                display_name=data_utils.rand_name('test-bgpvpn'))
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_policy_management.py b/tungsten_tempest_plugin/tests/api/contrail/test_policy_management.py
new file mode 100644
index 0000000..b8faad9
--- /dev/null
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_policy_management.py
@@ -0,0 +1,121 @@
+"""Tempest Suite for Policy Management of Contrail."""
+# Copyright 2018 AT&T Corp
+# All Rights Reserved.
+#
+#    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.
+
+from patrole_tempest_plugin import rbac_rule_validation
+from tempest import config
+from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
+
+from tungsten_tempest_plugin.tests.api.contrail import rbac_base
+
+CONF = config.CONF
+
+
+class PolicyManagementTest(rbac_base.BaseContrailTest):
+    """Class to test the Policy Management of  Contrail."""
+
+    @classmethod
+    def skip_checks(cls):
+        """Skip the Suite if the Contrail version is less than five."""
+        super(PolicyManagementTest, cls).skip_checks()
+        if float(CONF.sdn.contrail_version) < 5:
+            msg = "policy_management requires Contrail >= 5"
+            raise cls.skipException(msg)
+
+    @classmethod
+    def resource_setup(cls):
+        """Create Policy Management to use across the Suite."""
+        super(PolicyManagementTest, cls).resource_setup()
+        cls.policy_management_uuid = cls._create_policy_management()
+
+    @classmethod
+    def _create_policy_management(cls):
+        """Create a Policy Management."""
+        fq_name = data_utils.rand_name('policy-management')
+        post_body = {
+            'parent_type': 'project',
+            'fq_name': ["default-domain", cls.tenant_name, fq_name]
+        }
+        resp_body = cls.contrail_client.create_policy_management(
+            **post_body)
+        policy_management_uuid = resp_body['policy-management']['uuid']
+        cls.addClassResourceCleanup(
+            cls._try_delete_resource,
+            cls.contrail_client.delete_policy_management,
+            policy_management_uuid)
+        return policy_management_uuid
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["create_policy_management"])
+    @decorators.idempotent_id('8fc56caa-fe8c-487f-8da6-579ae56dc831')
+    def test_create_policy_management(self):
+        """Create policy_management.
+
+        RBAC test for the Contrail create_policy_management policy
+        """
+        with self.rbac_utils.override_role(self):
+            self._create_policy_management()
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["list_policy_management"])
+    @decorators.idempotent_id('5bfb007b-70d3-48f2-91ce-dc2ff471fe34')
+    def test_list_policy_managements(self):
+        """List policy_managements.
+
+        RBAC test for the Contrail list_policy_managements policy
+        """
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.list_policy_managements()
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["show_policy_management"])
+    @decorators.idempotent_id('a62737ec-dae9-4c26-8474-c4352c578607')
+    def test_show_policy_management(self):
+        """Show policy_management.
+
+        RBAC test for the Contrail show_policy_management policy
+        """
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.\
+                show_policy_management(self.policy_management_uuid)
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["delete_policy_management"])
+    @decorators.idempotent_id('1a3515ce-ce89-42e0-a4aa-a6c80eed4a7e')
+    def test_delete_policy_management(self):
+        """Delete policy_management.
+
+        RBAC test for the Contrail delete_policy_management policy
+        """
+        obj_uuid = self._create_policy_management()
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.\
+                delete_policy_management(obj_uuid)
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["update_policy_management"])
+    @decorators.idempotent_id('833de029-cd09-4929-a40e-ddf521381474')
+    def test_update_policy_management(self):
+        """Update policy_management.
+
+        RBAC test for the Contrail update_policy_management policy
+        """
+        put_body = {
+            'display_name': data_utils.rand_name(
+                'update_policy_management')}
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.update_policy_management(
+                self.policy_management_uuid, **put_body)
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_service_object.py b/tungsten_tempest_plugin/tests/api/contrail/test_service_object.py
new file mode 100644
index 0000000..23412fb
--- /dev/null
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_service_object.py
@@ -0,0 +1,116 @@
+"""Tempest Suite for Contrail Service Objects."""
+# Copyright 2018 AT&T Corp
+# All Rights Reserved.
+#
+#    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.
+
+from patrole_tempest_plugin import rbac_rule_validation
+from tempest import config
+from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
+
+from tungsten_tempest_plugin.tests.api.contrail import rbac_base
+
+CONF = config.CONF
+
+
+class ServiceObjectContrailTest(rbac_base.BaseContrailTest):
+    """Class to test the Service objects of Contrail."""
+
+    @classmethod
+    def skip_checks(cls):
+        """Skip the suite if the Contrail version is less than 4.1."""
+        super(ServiceObjectContrailTest, cls).skip_checks()
+        if float(CONF.sdn.contrail_version) < 4.1:
+            msg = "service_object requires Contrail >= 4.1"
+            raise cls.skipException(msg)
+
+    @classmethod
+    def resource_setup(cls):
+        """Create Service object to use it across the suite."""
+        super(ServiceObjectContrailTest, cls).resource_setup()
+        cls.service_object_uuid = cls._create_service_object()
+
+    @classmethod
+    def _create_service_object(cls):
+        """Create service object."""
+        display_name = data_utils.rand_name('service_object')
+        post_body = {'display_name': display_name}
+        post_body['fq_name'] = [display_name]
+        resp_body = cls.contrail_client.create_service_object(**post_body)
+        service_object_uuid = resp_body['service-object']['uuid']
+        cls.addClassResourceCleanup(
+            cls._try_delete_resource,
+            cls.contrail_client.delete_service_object,
+            service_object_uuid)
+        return service_object_uuid
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["list_service_objects"])
+    @decorators.idempotent_id('05458fa1-ba09-4772-91aa-ca06243b5f5e')
+    def test_list_service_objects(self):
+        """List service_objects.
+
+        RBAC test for the Contrail list_service_objects policy
+        """
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.list_service_objects()
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["create_service_object"])
+    @decorators.idempotent_id('8be0e381-3abb-4256-858d-5930db4ceafb')
+    def test_create_service_object(self):
+        """Create service_object.
+
+        RBAC test for the Contrail create_service_object policy
+        """
+        with self.rbac_utils.override_role(self):
+            self._create_service_object()
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["show_service_object"])
+    @decorators.idempotent_id('bb570ddd-c5fa-4691-899e-00a64568f736')
+    def test_show_service_object(self):
+        """Show service_object.
+
+        RBAC test for the Contrail show_service_object policy
+        """
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.show_service_object(self.service_object_uuid)
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["delete_service_object"])
+    @decorators.idempotent_id('15a4d6dc-f16b-11e8-8e54-080027758b73')
+    def test_delete_service_object(self):
+        """Delete service_object.
+
+        RBAC test for the Contrail delete_service_object policy
+        """
+        obj_uuid = self._create_service_object()
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.delete_service_object(obj_uuid)
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["update_service_object"])
+    @decorators.idempotent_id('a6eaee65-9ead-4df5-9aa0-5329ee9a26f2')
+    def test_update_service_object(self):
+        """Update service_object.
+
+        RBAC test for the Contrail update_service_object policy
+        """
+        put_body = {
+            'display_name': data_utils.rand_name(
+                'update_service_object')}
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.update_service_object(
+                self.service_object_uuid, **put_body)
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_tag_type.py b/tungsten_tempest_plugin/tests/api/contrail/test_tag_type.py
new file mode 100644
index 0000000..9755ce2
--- /dev/null
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_tag_type.py
@@ -0,0 +1,115 @@
+"""Tempest Suite for Tag Type of Contrail."""
+# Copyright 2018 AT&T Corp
+# All Rights Reserved.
+#
+#    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.
+
+from patrole_tempest_plugin import rbac_rule_validation
+from tempest import config
+from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
+
+from tungsten_tempest_plugin.tests.api.contrail import rbac_base
+
+CONF = config.CONF
+
+
+class ContrailTagTypeTest(rbac_base.BaseContrailTest):
+    """Test suite for validating RBAC functionality of 'tag-type' API."""
+
+    @classmethod
+    def skip_checks(cls):
+        """Skip the checks if contrail Version is less than 4.1."""
+        super(ContrailTagTypeTest, cls).skip_checks()
+        if float(CONF.sdn.contrail_version) < 4.1:
+            msg = "tag-type requires Contrail >= 4.1"
+            raise cls.skipException(msg)
+
+    @classmethod
+    def resource_setup(cls):
+        """Create Tag type to use it across the Suite."""
+        super(ContrailTagTypeTest, cls).resource_setup()
+        cls.tag_type_uuid = cls._create_tag_type()
+
+    @classmethod
+    def _create_tag_type(cls):
+        """Create Tag type."""
+        tag_type_name = data_utils.rand_name('tag-type')
+        fq_name = [tag_type_name]
+        post_data = {'fq_name': fq_name}
+        new_tag_type = cls.contrail_client.create_tag_type(
+            **post_data)['tag-type']
+        tag_type_uuid = new_tag_type['uuid']
+        cls.addClassResourceCleanup(
+            cls._try_delete_resource,
+            cls.contrail_client.delete_tag_type,
+            tag_type_uuid)
+        return tag_type_uuid
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["list_tag_types"])
+    @decorators.idempotent_id('53c34f3a-f426-11e8-8eb2-f2801f1b9fd1')
+    def test_list_tag_types(self):
+        """List tag-type.
+
+        RBAC test for contrail list tag_type policy
+        """
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.list_tag_types()
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["show_tag_type"])
+    @decorators.idempotent_id('64cf8892-f427-11e8-8eb2-f2801f1b9fd1')
+    def test_show_tag_type(self):
+        """Show tag-type.
+
+        RBAC test for contrail show tag_type policy
+        """
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.show_tag_type(self.tag_type_uuid)
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["create_tag_types"])
+    @decorators.idempotent_id('7e602032-f427-11e8-8eb2-f2801f1b9fd1')
+    def test_create_tag_types(self):
+        """Create tag-type.
+
+        RBAC test for contrail create tag_type policy
+        """
+        with self.rbac_utils.override_role(self):
+            self._create_tag_type()
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["update_tag_type"])
+    @decorators.idempotent_id('98f6beba-f427-11e8-8eb2-f2801f1b9fd1')
+    def test_update_tag_type(self):
+        """Update tag-type.
+
+        RBAC test for contrail update tag_type policy
+        """
+        update_name = data_utils.rand_name('new_name')
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.update_tag_type(
+                self.tag_type_uuid, name=update_name)
+
+    @rbac_rule_validation.action(service="Contrail",
+                                 rules=["delete_tag_type"])
+    @decorators.idempotent_id('b0f81fae-f427-11e8-8eb2-f2801f1b9fd1')
+    def test_delete_tag_type(self):
+        """Delete tag-type.
+
+        RBAC test for contrail delete tag_type policy
+        """
+        new_tag_type_uuid = self._create_tag_type()
+        with self.rbac_utils.override_role(self):
+            self.contrail_client.delete_tag_type(new_tag_type_uuid)
