Fix failed Contrail RBAC Tempest testcases (#5)

This commit fixes issues found for US441924.
The fixes are against Contrail 5.0.1.

Change-Id: I94bc166ad9038087eb4839881f44c6f6d00b6c99
diff --git a/tungsten_tempest_plugin/config.py b/tungsten_tempest_plugin/config.py
index b82299e..4fd1bb7 100644
--- a/tungsten_tempest_plugin/config.py
+++ b/tungsten_tempest_plugin/config.py
@@ -35,6 +35,9 @@
     cfg.StrOpt('catalog_type',
                default='sdn-l-config',
                help="Catalog type of the SDN service"),
+    cfg.StrOpt('contrail_version',
+               default='5.0',
+               help="Version of SDN service"),
 ]
 
 tungsten_log_group = cfg.OptGroup(
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_alarm.py b/tungsten_tempest_plugin/tests/api/contrail/test_alarm.py
index fa76dd4..d293f4d 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_alarm.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_alarm.py
@@ -32,42 +32,29 @@
 class AlarmContrailTest(rbac_base.BaseContrailTest):
     """Test class to test Alarm objects using RBAC roles"""
 
-    def _create_global_system_config(self):
-        config_name = data_utils.rand_name('test-config')
-        parent_type = 'config-root'
-        config_fq_name = [config_name]
-        new_config = \
-            self.config_client.create_global_system_configs(
-                parent_type=parent_type,
-                display_name=config_name,
-                fq_name=config_fq_name)['global-system-config']
-        self.addCleanup(self._try_delete_resource,
-                        (self.config_client.
-                         delete_global_system_config),
-                        new_config['uuid'])
-        return new_config
-
-    def _create_alarm(self, global_system_config):
+    def _create_alarm(self):
         post_body = {
-            'fq_name': [global_system_config,
+            'fq_name': ['default-domain',
+                        self.tenant_name,
                         data_utils.rand_name('alarm')],
             'alarm_severity': 1,
-            'parent_type': 'global-system-config',
+            'parent_type': 'project',
             'uve_keys': {
-                'uve_key': ['analytics_node']
+                'uve_key': ['virtual-network']
             },
             'alarm_rules': {
                 'or_list': [{
                     'and_list': [{
                         'operation': '!=',
-                        'operand1': 'NodeStatus.process_info.process_state',
+                        'operand1': data_utils.rand_name('tempest-alarm'),
                         'operand2': {
-                            'json_value': '"PROCESS_STATE_RUNNING"'
+                            'uve_attribute': 'name'
                         }
                     }]
                 }]
             }
         }
+
         resp_body = self.alarm_client.create_alarms(
             **post_body)
         alarm_uuid = resp_body['alarm']['uuid']
@@ -95,19 +82,15 @@
     @decorators.idempotent_id('7fe55d0c-e54a-4bb7-95a6-9c53f9e9c4bf')
     def test_create_alarms(self):
         """test method for create alarms"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         with self.rbac_utils.override_role(self):
-            self._create_alarm(global_system_config)
+            self._create_alarm()
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["show_alarm"])
     @decorators.idempotent_id('ab0ccbe4-7bfe-4176-890a-d438ee04290d')
     def test_show_alarm(self):
         """test method for show alarms"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        alarm_uuid = self._create_alarm(global_system_config)
+        alarm_uuid = self._create_alarm()
         with self.rbac_utils.override_role(self):
             self.alarm_client.show_alarm(alarm_uuid)
 
@@ -116,9 +99,7 @@
     @decorators.idempotent_id('ab331cca-ee53-4106-9b30-7319bfb1bea7')
     def test_update_alarm(self):
         """test method for update alarms"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        alarm_uuid = self._create_alarm(global_system_config)
+        alarm_uuid = self._create_alarm()
         with self.rbac_utils.override_role(self):
             self._update_alarm(alarm_uuid)
 
@@ -128,7 +109,6 @@
     def test_delete_alarm(self):
         """test method for delete alarms"""
         # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        alarm_uuid = self._create_alarm(global_system_config)
+        alarm_uuid = self._create_alarm()
         with self.rbac_utils.override_role(self):
             self.alarm_client.delete_alarm(alarm_uuid)
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_analytics_node.py b/tungsten_tempest_plugin/tests/api/contrail/test_analytics_node.py
index 85dedeb..9a15ab4 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_analytics_node.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_analytics_node.py
@@ -32,25 +32,10 @@
 class ContrailAnalyticsNodeTest(rbac_base.BaseContrailTest):
     """Test class to test analytics node objects using RBAC roles"""
 
-    def _create_global_system_config(self):
-        config_name = data_utils.rand_name('test-config')
-        parent_type = 'config-root'
-        config_fq_name = [config_name]
-        new_config = \
-            self.config_client.create_global_system_configs(
-                parent_type=parent_type,
-                display_name=config_name,
-                fq_name=config_fq_name)['global-system-config']
-        self.addCleanup(self._try_delete_resource,
-                        (self.config_client.
-                         delete_global_system_config),
-                        new_config['uuid'])
-        return new_config
-
-    def _create_analytics_node(self, global_system_config):
+    def _create_analytics_node(self):
         node_name = data_utils.rand_name('analytics-node')
         post_data = {
-            'fq_name': [global_system_config, node_name],
+            'fq_name': ['default-global-system-config', node_name],
             'parent_type': 'global-system-config'
         }
         new_node = self.analytics_node_client.create_analytics_nodes(
@@ -73,9 +58,7 @@
     @decorators.idempotent_id('b51043fd-77ba-4312-b96f-569ed5153338')
     def test_show_analytics_node(self):
         """test method for show analytics nodes"""
-        # create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_node = self._create_analytics_node(global_system_config)
+        new_node = self._create_analytics_node()
         with self.rbac_utils.override_role(self):
             self.analytics_node_client.show_analytics_node(new_node['uuid'])
 
@@ -84,19 +67,15 @@
     @decorators.idempotent_id('c57482c9-fcb4-4f41-95b0-7f0ffeee3dc3')
     def test_create_analytics_nodes(self):
         """test method for create analytics nodes"""
-        # create global system config
-        global_system_config = self._create_global_system_config()['name']
         with self.rbac_utils.override_role(self):
-            self._create_analytics_node(global_system_config)
+            self._create_analytics_node()
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["update_analytics_node"])
     @decorators.idempotent_id('ff50a2df-6283-409e-ab03-c13b63acc8a0')
     def test_update_analytics_node(self):
         """test method for update analytics nodes"""
-        # create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_node = self._create_analytics_node(global_system_config)
+        new_node = self._create_analytics_node()
         update_name = data_utils.rand_name('updated_node')
         with self.rbac_utils.override_role(self):
             self.analytics_node_client.update_analytics_node(
@@ -107,8 +86,6 @@
     @decorators.idempotent_id('972f997a-c89f-4227-8ae9-5a2335ec0b0a')
     def test_delete_analytics_node(self):
         """test method for delete analytics nodes"""
-        # create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_node = self._create_analytics_node(global_system_config)
+        new_node = self._create_analytics_node()
         with self.rbac_utils.override_role(self):
             self.analytics_node_client.delete_analytics_node(new_node['uuid'])
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_config_client.py b/tungsten_tempest_plugin/tests/api/contrail/test_config_client.py
index 98ee4e9..213bd47 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_config_client.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_config_client.py
@@ -17,7 +17,9 @@
 Tempest test-case to test config objects using RBAC roles
 """
 
+import json
 import random
+import testtools
 
 from oslo_log import log as logging
 from patrole_tempest_plugin import rbac_rule_validation
@@ -43,7 +45,10 @@
     def _create_config_node(self):
         config_node_ip_address = self._random_ip_generator()
         display_name = data_utils.rand_name('config_node')
-        fq_name = [display_name]
+        if float(CONF.sdn.contrail_version) < 5:
+            fq_name = [display_name]
+        else:
+            fq_name = ['default-global-system-config', display_name]
         config_node = self.config_client.create_config_nodes(
             config_node_ip_address=config_node_ip_address,
             display_name=display_name, fq_name=fq_name)
@@ -195,10 +200,12 @@
         with self.rbac_utils.override_role(self):
             self.config_client.list_global_system_configs()
 
+    @testtools.skipUnless(float(CONF.sdn.contrail_version) < 5,
+                          'Not supported in OpenContrail versions >= 5')
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["create_global_system_configs"])
     @decorators.idempotent_id('e0ba6a20-3e28-47ac-bf95-9a848fcee49a')
-    def test_create_global_sys_configs(self):
+    def test_create_global_system_configs(self):
         """test method for create global system config service objects"""
         with self.rbac_utils.override_role(self):
             self._create_global_system_config()
@@ -207,16 +214,34 @@
                                  rules=["show_global_system_config"])
     @decorators.idempotent_id('4b9f9131-cb34-4b7d-9d06-c6aca85cce3a')
     def test_show_global_system_config(self):
-        """test method for show global system config service objects"""
-        new_config = self._create_global_system_config()
-        with self.rbac_utils.override_role(self):
-            self.config_client.show_global_system_config(
-                new_config['uuid'])
+        if float(CONF.sdn.contrail_version) < 5:
+            new_config = self._create_global_system_config()
+            with self.rbac_utils.override_role(self):
+                self.config_client.show_global_system_config(
+                    new_config['uuid'])
+        else:
+            resp, resp_body = self.config_client.list_global_system_configs()
+            # There must exist just one global system config in Contrail
+            # verion > 4.x. There may be more than one in other versions
+            # which is bug fixed in later releases.
+            body = json.loads(resp_body)['global-system-configs']
+            self.assertGreater(len(body), 0,
+                               msg="No global system config exists. "
+                                   "There must exists "
+                                   "default-global-sytem-config "
+                                   "at least by default")
+            for gsc in body:
+                if gsc['fq_name'][0] == 'default-global-system-config':
+                    with self.rbac_utils.override_role(self):
+                        self.config_client.show_global_system_config(
+                            gsc['uuid'])
 
+    @testtools.skipUnless(float(CONF.sdn.contrail_version) < 5,
+                          'Not supported in OpenContrail versions >= 5')
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["update_global_system_config"])
     @decorators.idempotent_id('4f90dc83-da59-45a4-8ab6-b387bd6c2df4')
-    def test_update_global_sys_config(self):
+    def test_update_global_system_config(self):
         """test method for update global system config service objects"""
         new_config = self._create_global_system_config()
         update_name = data_utils.rand_name('test')
@@ -225,12 +250,13 @@
                 new_config['uuid'],
                 display_name=update_name)
 
+    @testtools.skipUnless(float(CONF.sdn.contrail_version) < 5,
+                          'Not supported in OpenContrail versions >= 5')
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["delete_global_system_config"])
     @decorators.idempotent_id('fce1653c-e657-4a1e-8ced-7e02d297d6c9')
-    def test_delete_global_sys_config(self):
+    def test_delete_global_system_config(self):
         """test method for delete global system config service objects"""
         new_config = self._create_global_system_config()
         with self.rbac_utils.override_role(self):
-            self.config_client.delete_global_system_config(
-                new_config['uuid'])
+            self.config_client.delete_global_system_config(new_config['uuid'])
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_database.py b/tungsten_tempest_plugin/tests/api/contrail/test_database.py
index d6c7d96..7caa76e 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_database.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_database.py
@@ -32,27 +32,12 @@
 class ContrailDatabaseTest(rbac_base.BaseContrailTest):
     """Test class to test database objects using RBAC roles"""
 
-    def _create_global_system_config(self):
-        config_name = data_utils.rand_name('test-config')
-        parent_type = 'config-root'
-        config_fq_name = [config_name]
-        new_config = \
-            self.config_client.create_global_system_configs(
-                parent_type=parent_type,
-                display_name=config_name,
-                fq_name=config_fq_name)['global-system-config']
-        self.addCleanup(self._try_delete_resource,
-                        (self.config_client.
-                         delete_global_system_config),
-                        new_config['uuid'])
-        return new_config
-
     def _delete_database_node(self, db_node_id):
         return self.db_client.delete_database_node(db_node_id)
 
-    def _create_database_node(self, global_system_config):
+    def _create_database_node(self):
         name = data_utils.rand_name('database')
-        fq_name = [global_system_config, name]
+        fq_name = ['default-global-system-config', name]
         database_node_ip_address = '1.1.1.1'
         parent_type = 'global-system-config'
         db_node = self.db_client.create_databse_nodes(
@@ -71,9 +56,7 @@
     @decorators.idempotent_id('5ae6f965-6161-443f-b19e-dfa7b364c533')
     def test_list_database_nodes(self):
         """test method for list database objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        self._create_database_node(global_system_config)
+        self._create_database_node()
         with self.rbac_utils.override_role(self):
             self.db_client.list_database_nodes()
 
@@ -82,31 +65,24 @@
     @decorators.idempotent_id('4a07d9a8-7b99-43bd-b628-06c023993aab')
     def test_show_database_node(self):
         """test method for show database objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        db_node = self._create_database_node(global_system_config)
-        db_node_id = db_node['uuid']
+        db_node = self._create_database_node()
         with self.rbac_utils.override_role(self):
-            self.db_client.show_database_node(db_node_id)
+            self.db_client.show_database_node(db_node['uuid'])
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["create_database_nodes"])
     @decorators.idempotent_id('b9aa9c6b-9381-44f0-94fb-e4523bf2a87e')
     def test_create_database_nodes(self):
         """test method for update database objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         with self.rbac_utils.override_role(self):
-            self._create_database_node(global_system_config)
+            self._create_database_node()
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["update_database_node"])
     @decorators.idempotent_id('6e59f393-0e55-4327-871e-7f0ad53f2e17')
     def test_update_database_node(self):
         """test method for update database objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        db_node = self._create_database_node(global_system_config)
+        db_node = self._create_database_node()
         db_node_id = db_node['uuid']
         display_name = data_utils.rand_name('DatabaseNew')
         with self.rbac_utils.override_role(self):
@@ -119,9 +95,7 @@
     @decorators.idempotent_id('0cbc5a52-d7e7-4a1c-a85d-6bf44012d99b')
     def test_delete_database_node(self):
         """test method for delete database objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        db_node = self._create_database_node(global_system_config)
+        db_node = self._create_database_node()
         db_node_id = db_node['uuid']
         with self.rbac_utils.override_role(self):
             self._delete_database_node(db_node_id)
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_forwarding_class.py b/tungsten_tempest_plugin/tests/api/contrail/test_forwarding_class.py
index c79d630..edf8733 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_forwarding_class.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_forwarding_class.py
@@ -32,25 +32,10 @@
 class ContrailForwardingClassTest(rbac_base.BaseContrailTest):
     """Test class to test Forwarding class objects using RBAC roles"""
 
-    def _create_global_system_config(self):
-        config_name = data_utils.rand_name('test-config')
-        parent_type = 'config-root'
-        config_fq_name = [config_name]
-        new_config = \
-            self.config_client.create_global_system_configs(
-                parent_type=parent_type,
-                display_name=config_name,
-                fq_name=config_fq_name)['global-system-config']
-        self.addCleanup(self._try_delete_resource,
-                        (self.config_client.
-                         delete_global_system_config),
-                        new_config['uuid'])
-        return new_config
-
-    def _create_qos_global_configs(self, global_system_config):
+    def _create_qos_global_configs(self):
         name = data_utils.rand_name('test-rbac-qos-global-config')
         parent_type = 'global-system-config'
-        fq_name = [global_system_config, name]
+        fq_name = ['default-global-system-config', name]
         qos_global_config = self.qos_client.create_global_qos_configs(
             fq_name=fq_name,
             parent_type=parent_type)['global-qos-config']
@@ -61,11 +46,10 @@
         return qos_global_config
 
     def _create_forwarding_class(self,
-                                 global_system_config,
                                  global_qos_config):
         display_name = data_utils.rand_name('forwarding-class')
         parent_type = 'global-qos-config'
-        fq_name = [global_system_config, global_qos_config, "1"]
+        fq_name = ['default-global-system-config', global_qos_config, "1"]
         forwarding_class_id = data_utils.rand_int_id(1, 200)
         post_data = {
             'fq_name': fq_name,
@@ -93,13 +77,10 @@
     @decorators.idempotent_id('8ef21f71-72a4-4de9-af93-6e759aa463c0')
     def test_show_forwarding_class(self):
         """test method for show forwarding classes objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         # Create a global qos config
-        global_qos_config = \
-            self._create_qos_global_configs(global_system_config)['name']
-        new_fclass = self._create_forwarding_class(global_system_config,
-                                                   global_qos_config)
+        self.global_qos_config = \
+            self._create_qos_global_configs()['name']
+        new_fclass = self._create_forwarding_class(self.global_qos_config)
         with self.rbac_utils.override_role(self):
             self.forwarding_class_client.show_forwarding_class(
                 new_fclass['uuid'])
@@ -107,29 +88,23 @@
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["create_forwarding_classs"])
     @decorators.idempotent_id('d098859c-ad36-4385-8fb0-c00934a99b6f')
-    def test_create_forwarding_classs(self):
+    def test_create_forwarding_class(self):
         """test method for create forwarding classes objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         # Create a global qos config
-        global_qos_config = \
-            self._create_qos_global_configs(global_system_config)['name']
+        self.global_qos_config = \
+            self._create_qos_global_configs()['name']
         with self.rbac_utils.override_role(self):
-            self._create_forwarding_class(global_system_config,
-                                          global_qos_config)
+            self._create_forwarding_class(self.global_qos_config)
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["update_forwarding_class"])
     @decorators.idempotent_id('589dc03d-a25d-48be-9d9c-d3f92ff2cfc6')
     def test_update_forwarding_class(self):
         """test method for update forwarding classes objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         # Create a global qos config
-        global_qos_config = \
-            self._create_qos_global_configs(global_system_config)['name']
-        new_fclass = self._create_forwarding_class(global_system_config,
-                                                   global_qos_config)
+        self.global_qos_config = \
+            self._create_qos_global_configs()['name']
+        new_fclass = self._create_forwarding_class(self.global_qos_config)
         update_name = data_utils.rand_name('updated_fclass')
         with self.rbac_utils.override_role(self):
             self.forwarding_class_client.update_forwarding_class(
@@ -140,13 +115,10 @@
     @decorators.idempotent_id('a0348ffc-68c5-4d94-ba03-d08483503ced')
     def test_delete_forwarding_class(self):
         """test method for delete forwarding classes objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         # Create a global qos config
-        global_qos_config = \
-            self._create_qos_global_configs(global_system_config)['name']
-        new_fclass = self._create_forwarding_class(global_system_config,
-                                                   global_qos_config)
+        self.global_qos_config = \
+            self._create_qos_global_configs()['name']
+        new_fclass = self._create_forwarding_class(self.global_qos_config)
         with self.rbac_utils.override_role(self):
             self.forwarding_class_client.delete_forwarding_class(
                 new_fclass['uuid'])
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_interfaces.py b/tungsten_tempest_plugin/tests/api/contrail/test_interfaces.py
index 697a210..450c158 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_interfaces.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_interfaces.py
@@ -36,26 +36,10 @@
     physical_if_name = data_utils.rand_name('rbac-physical-interface')
     logical_if_name = data_utils.rand_name('rbac-logical-interface')
 
-    def _create_global_system_config(self):
-        config_name = data_utils.rand_name('test-config')
-        parent_type = 'config-root'
-        config_fq_name = [config_name]
-        new_config = \
-            self.config_client.create_global_system_configs(
-                parent_type=parent_type,
-                display_name=config_name,
-                fq_name=config_fq_name)['global-system-config']
-        self.addCleanup(self._try_delete_resource,
-                        (self.config_client.
-                         delete_global_system_config),
-                        new_config['uuid'])
-        return new_config
-
     def _create_physical_router(self):
-        self.global_system_config = self._create_global_system_config()['name']
-
-        fq_name = [self.global_system_config, self.router_name]
-        post_body = {'parent_type': 'global-system-config', 'fq_name': fq_name}
+        fq_name = ['default-global-system-config', self.router_name]
+        post_body = {'parent_type': 'global-system-config'}
+        post_body['fq_name'] = fq_name
 
         router = self.router_client.create_physical_routers(
             **post_body)['physical-router']
@@ -65,9 +49,10 @@
         return router
 
     def _create_physical_interface(self):
-        fq_name = [self.global_system_config, self.router_name,
+        fq_name = ['default-global-system-config', self.router_name,
                    self.physical_if_name]
-        post_body = {'parent_type': 'physical-router', 'fq_name': fq_name}
+        post_body = {'parent_type': 'physical-router'}
+        post_body['fq_name'] = fq_name
 
         physical_if = self.interface_client.create_physical_interfaces(
             **post_body)['physical-interface']
@@ -77,9 +62,10 @@
         return physical_if
 
     def _create_logical_interface(self):
-        fq_name = [self.global_system_config, self.router_name,
+        fq_name = ['default-global-system-config', self.router_name,
                    self.physical_if_name, self.logical_if_name]
-        post_body = {'parent_type': 'physical-interface', 'fq_name': fq_name}
+        post_body = {'parent_type': 'physical-interface'}
+        post_body['fq_name'] = fq_name
 
         logical_if = self.interface_client.create_logical_interfaces(
             **post_body)['logical-interface']
@@ -101,7 +87,6 @@
     @decorators.idempotent_id('066f53d8-3d2a-4ad6-983f-243de7c12962')
     def test_create_physical_interfaces(self):
         """test method for create physical interfaces objects"""
-
         self._create_physical_router()
         with self.rbac_utils.override_role(self):
             self._create_physical_interface()
@@ -131,7 +116,6 @@
         """test method for delete physical interfaces objects"""
         self._create_physical_router()
         uuid = self._create_physical_interface()['uuid']
-
         with self.rbac_utils.override_role(self):
             self.interface_client.delete_physical_interface(uuid)
 
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_load_balancer.py b/tungsten_tempest_plugin/tests/api/contrail/test_load_balancer.py
index c8f136d..d7e25c4 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_load_balancer.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_load_balancer.py
@@ -22,6 +22,7 @@
 from tempest import config
 from tempest.lib.common.utils import data_utils
 from tempest.lib import decorators
+from tempest import test
 
 from tungsten_tempest_plugin.tests.api.contrail import rbac_base
 
@@ -32,6 +33,13 @@
 class BaseLoadBalancerTest(rbac_base.BaseContrailTest):
     """Base class to test load balancer objects using RBAC roles"""
 
+    @classmethod
+    def skip_checks(cls):
+        super(BaseLoadBalancerTest, cls).skip_checks()
+        if not test.is_extension_enabled('lbaas', 'network'):
+            raise cls.skipException(
+                '%s skipped - lbaas extension not enabled' % cls.__name__)
+
     def _create_load_balancer(self):
         fq_name = data_utils.rand_name('load-balancer')
         post_body = {
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_qos_global_config.py b/tungsten_tempest_plugin/tests/api/contrail/test_qos_global_config.py
index 6b5a3ec..77a4a28 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_qos_global_config.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_qos_global_config.py
@@ -36,28 +36,13 @@
     def resource_setup(cls):
         super(QosContrailTest, cls).resource_setup()
 
-    def _create_global_system_config(self):
-        config_name = data_utils.rand_name('test-config')
-        parent_type = 'config-root'
-        config_fq_name = [config_name]
-        new_config = \
-            self.config_client.create_global_system_configs(
-                parent_type=parent_type,
-                display_name=config_name,
-                fq_name=config_fq_name)['global-system-config']
-        self.addCleanup(self._try_delete_resource,
-                        (self.config_client.
-                         delete_global_system_config),
-                        new_config['uuid'])
-        return new_config
-
     def _delete_qos_global_config(self, instance_id):
         return self.qos_client.delete_global_qos_config(instance_id)
 
-    def _create_qos_global_configs(self, global_system_config):
+    def _create_qos_global_configs(self):
         name = data_utils.rand_name('test-rbac-qos-global-config')
         parent_type = 'global-system-config'
-        fq_name = [global_system_config, name]
+        fq_name = ['default-global-system-config', name]
         qos_global_config = self.qos_client.create_global_qos_configs(
             fq_name=fq_name,
             parent_type=parent_type)['global-qos-config']
@@ -72,9 +57,7 @@
     @decorators.idempotent_id('74e5a7b7-f538-4be3-90a5-6862b07fb118')
     def test_list_global_qos_configs(self):
         """test method for list global QoS objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        self._create_qos_global_configs(global_system_config)
+        self._create_qos_global_configs()
         with self.rbac_utils.override_role(self):
             self.qos_client.list_global_qos_configs()
 
@@ -83,19 +66,15 @@
     @decorators.idempotent_id('d7da1ca0-7bf7-4d1b-982c-820cd37fe9fa')
     def test_create_global_qos_configs(self):
         """test method for create global QoS objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         with self.rbac_utils.override_role(self):
-            self._create_qos_global_configs(global_system_config)
+            self._create_qos_global_configs()
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["show_global_qos_config"])
     @decorators.idempotent_id('e3bd44e0-19a9-46e7-83d3-268dcc537ad9')
     def test_show_global_qos_config(self):
         """test method for show global QoS objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        test = self._create_qos_global_configs(global_system_config)
+        test = self._create_qos_global_configs()
         with self.rbac_utils.override_role(self):
             self.qos_client.show_global_qos_config(instance_id=test['uuid'])
 
@@ -104,9 +83,7 @@
     @decorators.idempotent_id('f834c4d7-bc81-4c59-bada-c4d752219a6e')
     def test_update_global_qos_config(self):
         """test method for update global QoS objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        qos = self._create_qos_global_configs(global_system_config)
+        qos = self._create_qos_global_configs()
         display_name = data_utils.rand_name('qos_globale_config')
         with self.rbac_utils.override_role(self):
             self.qos_client.update_global_qos_config(
@@ -118,9 +95,6 @@
     @decorators.idempotent_id('78b9a3da-4eb1-4f4b-8a23-a8a2e733b515')
     def test_delete_global_qos_config(self):
         """test method for delete global QoS objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        qos_global_config = self._create_qos_global_configs(
-            global_system_config)
+        qos_global_config = self._create_qos_global_configs()
         with self.rbac_utils.override_role(self):
             self.qos_client.delete_global_qos_config(qos_global_config['uuid'])
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_qos_queue.py b/tungsten_tempest_plugin/tests/api/contrail/test_qos_queue.py
index b223ea9..8d6f77c 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_qos_queue.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_qos_queue.py
@@ -37,7 +37,11 @@
 
     def _create_qos_queues(self):
         name = data_utils.rand_name('test-rbac-qos-queue')
-        fq_name = [name]
+        if float(CONF.sdn.contrail_version) < 5:
+            fq_name = [name]
+        else:
+            fq_name = ['default-global-system-config',
+                       "default-global-qos-config", name]
         qos_queue = self.qos_client.create_qos_queues(
             fq_name=fq_name)['qos-queue']
         self.addCleanup(self._try_delete_resource,
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_routers.py b/tungsten_tempest_plugin/tests/api/contrail/test_routers.py
index 6f829c5..8a0cdfc 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_routers.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_routers.py
@@ -47,26 +47,11 @@
                                  cls.network['uuid'])
         super(BaseRouterTest, cls).resource_cleanup()
 
-    def _create_global_system_config(self):
-        config_name = data_utils.rand_name('test-config')
-        parent_type = 'config-root'
-        config_fq_name = [config_name]
-        new_config = \
-            self.config_client.create_global_system_configs(
-                parent_type=parent_type,
-                display_name=config_name,
-                fq_name=config_fq_name)['global-system-config']
-        self.addCleanup(self._try_delete_resource,
-                        (self.config_client.
-                         delete_global_system_config),
-                        new_config['uuid'])
-        return new_config
-
-    def _create_physical_router(self, global_system_config):
+    def _create_physical_router(self):
         fq_name = data_utils.rand_name('physical-router-template')
         post_body = {
             'parent_type': 'global-system-config',
-            'fq_name': [global_system_config, fq_name]}
+            'fq_name': ['default-global-system-config', fq_name]}
         router = self.router_client.create_physical_routers(
             **post_body)['physical-router']
         self.addCleanup(self._try_delete_resource,
@@ -100,11 +85,11 @@
                         router['uuid'])
         return router
 
-    def _create_global_vrouter_config(self, global_system_config):
+    def _create_global_vrouter_config(self):
         fq_name = data_utils.rand_name('global-vrouter-config-template')
         post_body = {
             'parent_type': 'global-system-config',
-            'fq_name': [global_system_config, fq_name]}
+            'fq_name': ['default-global-system-config', fq_name]}
         router = self.router_client.create_global_vrouter_configs(
             **post_body)['global-vrouter-config']
         self.addCleanup(self._try_delete_resource,
@@ -124,11 +109,11 @@
                         router['uuid'])
         return router
 
-    def _create_virtual_router(self, global_system_config):
+    def _create_virtual_router(self):
         fq_name = data_utils.rand_name('virtual-router-template')
         post_body = {
             'parent_type': 'global-system-config',
-            'fq_name': [global_system_config, fq_name]}
+            'fq_name': ['default-global-system-config', fq_name]}
         router = self.router_client.create_virtual_routers(
             **post_body)['virtual-router']
         self.addCleanup(self._try_delete_resource,
@@ -149,20 +134,15 @@
     @decorators.idempotent_id('d0b7449e-9037-4f9f-8c7e-9f364c95f18a')
     def test_create_physical_routers(self):
         """test method for create physical router objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         with self.rbac_utils.override_role(self):
-            self._create_physical_router(global_system_config)
+            self._create_physical_router()
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["show_physical_router"])
     @decorators.idempotent_id('6dfc53f4-a884-46d5-b303-22ba59c116f4')
     def test_show_physical_router(self):
         """test method for show physical router objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        physical_router_uuid = self._create_physical_router(
-            global_system_config)['uuid']
+        physical_router_uuid = self._create_physical_router()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.show_physical_router(physical_router_uuid)
 
@@ -171,11 +151,8 @@
     @decorators.idempotent_id('c270f369-8cd7-4ee3-8ab1-4580c3138a5c')
     def test_update_physical_router(self):
         """test method for update physical router objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         updated_fq_name = data_utils.rand_name('rbac-physical-router-new-name')
-        physical_router_uuid = self._create_physical_router(
-            global_system_config)['uuid']
+        physical_router_uuid = self._create_physical_router()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.update_physical_router(
                 physical_router_uuid,
@@ -186,10 +163,7 @@
     @decorators.idempotent_id('eeded742-6a8d-4e88-bfa8-fe32db463c53')
     def test_delete_physical_router(self):
         """test method for delete physical router objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        physical_router_uuid = self._create_physical_router(
-            global_system_config)['uuid']
+        physical_router_uuid = self._create_physical_router()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.delete_physical_router(physical_router_uuid)
 
@@ -250,59 +224,84 @@
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["list_global_vrouter_configs"])
     @decorators.idempotent_id('4af768d1-3cbe-4aff-bcbc-0e045cac3277')
-    def test_list_global_vrouter(self):
+    def test_list_global_vrouter_configs(self):
         """test method for list global vrouter config objects"""
         with self.rbac_utils.override_role(self):
             self.router_client.list_global_vrouter_configs()
 
+    @decorators.skip_because(bug="1792446")
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["create_global_vrouter_configs"])
     @decorators.idempotent_id('e13d800f-9304-4a06-9bf1-ad08345a13a8')
-    def test_create_global_vrouter(self):
+    def test_create_global_vrouter_configs(self):
         """test method for create global vrouter config objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
+        # This test may make your environment unstable
+        # Juniper JTAC 2018-0912-0503
+        #
+        # Creating a global-vrouter-config object with parent as
+        # default-gloabl-system-config in a deployed environment makes vrouter
+        # linklocal metadata to go missing.
+        # vrouter-agent will stuck in Init state with "No configuration for
+        # self" error.
         with self.rbac_utils.override_role(self):
-            self._create_global_vrouter_config(global_system_config)
+            self._create_global_vrouter_config()
 
+    @decorators.skip_because(bug="1792446")
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["show_global_vrouter_config"])
     @decorators.idempotent_id('3bb6f4e1-fd3f-4338-8392-f7f80974a80e')
     def test_show_global_vrouter_config(self):
         """test method for show global vrouter config objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        global_vrouter_config_uuid = self._create_global_vrouter_config(
-            global_system_config)['uuid']
+        # This test may make your environment unstable
+        # Juniper JTAC 2018-0912-0503
+        #
+        # Creating a global-vrouter-config object with parent as
+        # default-gloabl-system-config in a deployed environment makes vrouter
+        # linklocal metadata to go missing.
+        # vrouter-agent will stuck in Init state with "No configuration for
+        # self" error.
+        global_vrouter_config_uuid = \
+            self._create_global_vrouter_config()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.show_global_vrouter_config(
                 global_vrouter_config_uuid)
 
+    @decorators.skip_because(bug="1792446")
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["update_global_vrouter_config"])
     @decorators.idempotent_id('36fcdd51-c42b-4e67-8c26-73d4cde47507')
-    def test_update_global_vrouter(self):
+    def test_update_global_vrouter_config(self):
         """test method for update global vrouter config objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
+        # This test may make your environment unstable
+        # Juniper JTAC 2018-0912-0503
+        #
+        # Creating a global-vrouter-config object with parent as
+        # default-gloabl-system-config in a deployed environment makes vrouter
+        # linklocal metadata to go missing.
+        # vrouter-agent will stuck in Init state with "No configuration for
+        # self" error.
         updated_fq_name = data_utils.rand_name(
             'rbac-global-vrouter-config-new-name')
-        global_vrouter_config_uuid = self._create_global_vrouter_config(
-            global_system_config)['uuid']
+        global_vrouter_config_uuid = \
+            self._create_global_vrouter_config()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.update_global_vrouter_config(
                 global_vrouter_config_uuid,
                 display_name=updated_fq_name)
 
+    @decorators.skip_because(bug="1792446")
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["delete_global_vrouter_config"])
     @decorators.idempotent_id('4f3d59e8-3dac-4346-9d13-5ebe5ad8f6cf')
-    def test_delete_global_vrouter(self):
+    def test_delete_global_vrouter_config(self):
         """test method for delete global vrouter config objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        global_vrouter_config_uuid = self._create_global_vrouter_config(
-            global_system_config)['uuid']
+        if CONF.sdn.test_vrouter_global_config:
+            raise self.skipException('Vrouter global config tests are '
+                                     'disabled. Enabling may make your '
+                                     'environment unstable.')
+
+        global_vrouter_config_uuid = \
+            self._create_global_vrouter_config()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.delete_global_vrouter_config(
                 global_vrouter_config_uuid)
@@ -366,20 +365,15 @@
     @decorators.idempotent_id('114beb14-45c0-4714-a407-d160bb102022')
     def test_create_virtual_routers(self):
         """test method for create virtual router objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         with self.rbac_utils.override_role(self):
-            self._create_virtual_router(global_system_config)
+            self._create_virtual_router()
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["show_virtual_router"])
     @decorators.idempotent_id('258fe4e0-3e39-460f-aafa-e3b53c96e534')
     def test_show_virtual_router(self):
         """test method for show virtual router objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        virtual_router_uuid = self._create_virtual_router(
-            global_system_config)['uuid']
+        virtual_router_uuid = self._create_virtual_router()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.show_virtual_router(virtual_router_uuid)
 
@@ -388,11 +382,8 @@
     @decorators.idempotent_id('d1c72191-2068-4552-a78f-038cdd4c9c1d')
     def test_update_virtual_router(self):
         """test method for update virtual router objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         updated_fq_name = data_utils.rand_name('rbac-virtual-router-new-name')
-        virtual_router_uuid = self._create_virtual_router(
-            global_system_config)['uuid']
+        virtual_router_uuid = self._create_virtual_router()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.update_virtual_router(
                 virtual_router_uuid,
@@ -403,9 +394,6 @@
     @decorators.idempotent_id('efbe25d6-8763-42d4-baf6-9f342e710144')
     def test_delete_virtual_router(self):
         """test method for delete virtual router objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        virtual_router_uuid = self._create_virtual_router(
-            global_system_config)['uuid']
+        virtual_router_uuid = self._create_virtual_router()['uuid']
         with self.rbac_utils.override_role(self):
             self.router_client.delete_virtual_router(virtual_router_uuid)
diff --git a/tungsten_tempest_plugin/tests/api/contrail/test_service_appliances.py b/tungsten_tempest_plugin/tests/api/contrail/test_service_appliances.py
index 258d4ea..e16eab4 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/test_service_appliances.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/test_service_appliances.py
@@ -30,24 +30,9 @@
 class ServiceAppliancesTest(rbac_base.BaseContrailTest):
     """Test class to test service appliances objects using RBAC roles"""
 
-    def _create_global_system_config(self):
-        config_name = data_utils.rand_name('test-config')
-        parent_type = 'config-root'
-        config_fq_name = [config_name]
-        new_config = \
-            self.config_client.create_global_system_configs(
-                parent_type=parent_type,
-                display_name=config_name,
-                fq_name=config_fq_name)['global-system-config']
-        self.addCleanup(self._try_delete_resource,
-                        (self.config_client.
-                         delete_global_system_config),
-                        new_config['uuid'])
-        return new_config
-
-    def _create_service_appliance_sets(self, global_system_config):
+    def _create_service_appliance_sets(self):
         set_name = data_utils.rand_name('test-set')
-        set_fq_name = [global_system_config, set_name]
+        set_fq_name = ['default-global-system-config', set_name]
         new_set = self.service_appliances_client.create_service_appliance_sets(
             parent_type='global-system-config',
             fq_name=set_fq_name)['service-appliance-set']
@@ -84,10 +69,7 @@
     @decorators.idempotent_id('0563c0c8-b986-466e-8540-aa8ad7a10367')
     def test_create_service_appliances(self):
         """test method for create service appliance objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_set = \
-            self._create_service_appliance_sets(global_system_config)
+        new_set = self._create_service_appliance_sets()
         with self.rbac_utils.override_role(self):
             self._create_service_appliances(new_set)
 
@@ -96,11 +78,7 @@
     @decorators.idempotent_id('ea30dcfe-8657-4a7d-9cf1-3176d334bf27')
     def test_show_service_appliance(self):
         """test method for show service appliance objects"""
-        # Create global system config
-        global_system_config = \
-            self._create_global_system_config()['name']
-        new_set = \
-            self._create_service_appliance_sets(global_system_config)
+        new_set = self._create_service_appliance_sets()
         new_appliance = self._create_service_appliances(new_set)
         with self.rbac_utils.override_role(self):
             self.service_appliances_client.show_service_appliance(
@@ -111,10 +89,7 @@
     @decorators.idempotent_id('a54ca33a-8590-4844-96d7-b96882b59e86')
     def test_update_service_appliance(self):
         """test method for update service appliance objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_set = \
-            self._create_service_appliance_sets(global_system_config)
+        new_set = self._create_service_appliance_sets()
         new_appliance = self._create_service_appliances(new_set)
         update_name = data_utils.rand_name('test')
         with self.rbac_utils.override_role(self):
@@ -127,10 +102,7 @@
     @decorators.idempotent_id('362deff5-7b72-4929-ba81-972cfcfa1309')
     def test_delete_service_appliance(self):
         """test method for delete service appliance objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_set = \
-            self._create_service_appliance_sets(global_system_config)
+        new_set = self._create_service_appliance_sets()
         new_appliance = self._create_service_appliances(new_set)
         with self.rbac_utils.override_role(self):
             self.service_appliances_client.delete_service_appliance(
@@ -149,20 +121,15 @@
     @decorators.idempotent_id('eb00d6cf-590f-41bf-8ee4-5be625d9cb93')
     def test_create_service_appl_sets(self):
         """test method for create service appliance sets objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
         with self.rbac_utils.override_role(self):
-            self._create_service_appliance_sets(global_system_config)
+            self._create_service_appliance_sets()
 
     @rbac_rule_validation.action(service="Contrail",
                                  rules=["show_service_appliance_set"])
     @decorators.idempotent_id('dd35dd04-e7d9-46bb-8f36-26835f122572')
     def test_show_service_appl_set(self):
         """test method for show service appliance sets objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_set = self._create_service_appliance_sets(
-            global_system_config)
+        new_set = self._create_service_appliance_sets()
         with self.rbac_utils.override_role(self):
             self.service_appliances_client.show_service_appliance_set(
                 new_set['uuid'])
@@ -172,10 +139,7 @@
     @decorators.idempotent_id('952f063b-bc71-4f62-83b1-719bce5ad4ed')
     def test_update_service_appl_set(self):
         """test method for update service appliance sets objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_set = self._create_service_appliance_sets(
-            global_system_config)
+        new_set = self._create_service_appliance_sets()
         update_name = data_utils.rand_name('test')
         with self.rbac_utils.override_role(self):
             self.service_appliances_client.update_service_appliance_set(
@@ -187,10 +151,7 @@
     @decorators.idempotent_id('7b56ce24-da1d-4565-bd22-c58dc57d7045')
     def test_delete_service_appl_set(self):
         """test method for delete service appliance sets objects"""
-        # Create global system config
-        global_system_config = self._create_global_system_config()['name']
-        new_set = self._create_service_appliance_sets(
-            global_system_config)
+        new_set = self._create_service_appliance_sets()
         with self.rbac_utils.override_role(self):
             self.service_appliances_client.delete_service_appliance_set(
                 new_set['uuid'])