Merge "Remove BaseComputeTest and _api_version"
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index 1b36ff2..5b02761 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -17,11 +17,10 @@
 from tempest import test
 
 
-class AZAdminV2TestJSON(base.BaseComputeAdminTest):
+class AZAdminV2TestJSON(base.BaseV2ComputeAdminTest):
     """
     Tests Availability Zone API List
     """
-    _api_version = 2
 
     @classmethod
     def setup_clients(cls):
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index 1da3f6e..c4aa81b 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -20,8 +20,7 @@
 CONF = config.CONF
 
 
-class NetworksTest(base.BaseComputeAdminTest):
-    _api_version = 2
+class NetworksTest(base.BaseV2ComputeAdminTest):
 
     """
     Tests Nova Networks API that usually requires admin privileges.
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index b3f69c1..1ee8f04 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -22,7 +22,6 @@
 from tempest.common.utils import data_utils
 from tempest.common import waiters
 from tempest import config
-from tempest import exceptions
 import tempest.test
 
 CONF = config.CONF
@@ -30,10 +29,9 @@
 LOG = logging.getLogger(__name__)
 
 
-class BaseComputeTest(tempest.test.BaseTestCase):
+class BaseV2ComputeTest(tempest.test.BaseTestCase):
     """Base test case class for all Compute API tests."""
 
-    _api_version = 2
     force_tenant_isolation = False
 
     # TODO(andreaf) We should care also for the alt_manager here
@@ -42,22 +40,18 @@
 
     @classmethod
     def skip_checks(cls):
-        super(BaseComputeTest, cls).skip_checks()
+        super(BaseV2ComputeTest, cls).skip_checks()
         if not CONF.service_available.nova:
             raise cls.skipException("Nova is not available")
-        if cls._api_version != 2:
-            msg = ("Unexpected API version is specified (%s)" %
-                   cls._api_version)
-            raise exceptions.InvalidConfiguration(message=msg)
 
     @classmethod
     def setup_credentials(cls):
         cls.set_network_resources()
-        super(BaseComputeTest, cls).setup_credentials()
+        super(BaseV2ComputeTest, cls).setup_credentials()
 
     @classmethod
     def setup_clients(cls):
-        super(BaseComputeTest, cls).setup_clients()
+        super(BaseV2ComputeTest, cls).setup_clients()
         cls.servers_client = cls.os.servers_client
         cls.server_groups_client = cls.os.server_groups_client
         cls.flavors_client = cls.os.flavors_client
@@ -96,7 +90,7 @@
 
     @classmethod
     def resource_setup(cls):
-        super(BaseComputeTest, cls).resource_setup()
+        super(BaseV2ComputeTest, cls).resource_setup()
         cls.build_interval = CONF.compute.build_interval
         cls.build_timeout = CONF.compute.build_timeout
         cls.ssh_user = CONF.compute.ssh_user
@@ -117,7 +111,7 @@
         cls.clear_servers()
         cls.clear_security_groups()
         cls.clear_server_groups()
-        super(BaseComputeTest, cls).resource_cleanup()
+        super(BaseV2ComputeTest, cls).resource_cleanup()
 
     @classmethod
     def clear_servers(cls):
@@ -356,22 +350,13 @@
         return ip_or_server
 
 
-class BaseV2ComputeTest(BaseComputeTest):
-    _api_version = 2
-
-
-class BaseComputeAdminTest(BaseComputeTest):
+class BaseV2ComputeAdminTest(BaseV2ComputeTest):
     """Base test case class for Compute Admin API tests."""
 
     credentials = ['primary', 'admin']
 
     @classmethod
     def setup_clients(cls):
-        super(BaseComputeAdminTest, cls).setup_clients()
+        super(BaseV2ComputeAdminTest, cls).setup_clients()
         cls.availability_zone_admin_client = (
             cls.os_adm.availability_zone_client)
-
-
-class BaseV2ComputeAdminTest(BaseComputeAdminTest):
-    """Base test case class for Compute Admin V2 API tests."""
-    _api_version = 2
diff --git a/tempest/api/compute/certificates/test_certificates.py b/tempest/api/compute/certificates/test_certificates.py
index 0096fc2..d5c7302 100644
--- a/tempest/api/compute/certificates/test_certificates.py
+++ b/tempest/api/compute/certificates/test_certificates.py
@@ -20,9 +20,7 @@
 CONF = config.CONF
 
 
-class CertificatesV2TestJSON(base.BaseComputeTest):
-
-    _api_version = 2
+class CertificatesV2TestJSON(base.BaseV2ComputeTest):
 
     @classmethod
     def skip_checks(cls):
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index e114c80..7e01296 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -17,9 +17,7 @@
 from tempest import test
 
 
-class FlavorsV2TestJSON(base.BaseComputeTest):
-
-    _api_version = 2
+class FlavorsV2TestJSON(base.BaseV2ComputeTest):
     _min_disk = 'minDisk'
     _min_ram = 'minRam'
 
diff --git a/tempest/api/compute/keypairs/base.py b/tempest/api/compute/keypairs/base.py
index 76e5573..15f231b 100644
--- a/tempest/api/compute/keypairs/base.py
+++ b/tempest/api/compute/keypairs/base.py
@@ -16,11 +16,9 @@
 from tempest.api.compute import base
 
 
-class BaseKeypairTest(base.BaseComputeTest):
+class BaseKeypairTest(base.BaseV2ComputeTest):
     """Base test case class for all keypair API tests."""
 
-    _api_version = 2
-
     @classmethod
     def setup_clients(cls):
         super(BaseKeypairTest, cls).setup_clients()
diff --git a/tempest/api/compute/servers/test_availability_zone.py b/tempest/api/compute/servers/test_availability_zone.py
index 080441a..8f1f360 100644
--- a/tempest/api/compute/servers/test_availability_zone.py
+++ b/tempest/api/compute/servers/test_availability_zone.py
@@ -17,11 +17,10 @@
 from tempest import test
 
 
-class AZV2TestJSON(base.BaseComputeTest):
+class AZV2TestJSON(base.BaseV2ComputeTest):
     """
     Tests Availability Zone API List
     """
-    _api_version = 2
 
     @classmethod
     def setup_clients(cls):
diff --git a/tempest/api/compute/test_versions.py b/tempest/api/compute/test_versions.py
index f94cee6..8b84a21 100644
--- a/tempest/api/compute/test_versions.py
+++ b/tempest/api/compute/test_versions.py
@@ -16,7 +16,7 @@
 from tempest import test
 
 
-class TestVersions(base.BaseComputeTest):
+class TestVersions(base.BaseV2ComputeTest):
 
     @test.idempotent_id('6c0a0990-43b6-4529-9b61-5fd8daf7c55c')
     def test_list_api_versions(self):