Forced isolation for the nova quota test

Several test cases like quota related tests should not be done without
creating a new tenant in all cases.

This change enforces the isolated code path for the nova quota tests.
These tests requires admin rights anyway, so probably no one want to
try to run them without admin permissions.

Change-Id: Ib7550bc68f493ce9c6acbd57fc2d901e14ec2fef
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 757dfc0..ea4daaa 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -25,6 +25,7 @@
 
 class QuotasAdminTestJSON(base.BaseComputeAdminTest):
     _interface = 'json'
+    force_tenant_isolation = True
 
     @classmethod
     def setUpClass(cls):
@@ -39,12 +40,8 @@
 
         # NOTE(afazekas): these test cases should always create and use a new
         # tenant most of them should be skipped if we can't do that
-        if cls.config.compute.allow_tenant_isolation:
-            cls.demo_tenant_id = cls.isolated_creds.get_primary_user().get(
-                'tenantId')
-        else:
-            cls.demo_tenant_id = [tnt['id'] for tnt in tenants if tnt['name']
-                                  == cls.config.identity.tenant_name][0]
+        cls.demo_tenant_id = cls.isolated_creds.get_primary_user().get(
+            'tenantId')
 
         cls.default_quota_set = set(('injected_file_content_bytes',
                                      'metadata_items', 'injected_files',
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 885adcf..f7681cc 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -34,6 +34,7 @@
     """Base test case class for all Compute API tests."""
 
     conclusion = compute.generic_setup_package()
+    force_tenant_isolation = False
 
     @classmethod
     def setUpClass(cls):
@@ -43,7 +44,8 @@
             raise cls.skipException(skip_msg)
         cls.isolated_creds = isolated_creds.IsolatedCreds(cls.__name__)
 
-        if cls.config.compute.allow_tenant_isolation:
+        if (cls.config.compute.allow_tenant_isolation or
+            cls.force_tenant_isolation is True):
             creds = cls.isolated_creds.get_primary_creds()
             username, tenant_name, password = creds
             os = clients.Manager(username=username,
@@ -208,7 +210,8 @@
             msg = ("Missing Compute Admin API credentials "
                    "in configuration.")
             raise cls.skipException(msg)
-        if cls.config.compute.allow_tenant_isolation:
+        if (cls.config.compute.allow_tenant_isolation or
+            cls.force_tenant_isolation is True):
             creds = cls.isolated_creds.get_admin_creds()
             admin_username, admin_tenant_name, admin_password = creds
             cls.os_adm = clients.Manager(username=admin_username,