Merge "Fix issue with ImagesOneServerJSON test"
diff --git a/requirements.txt b/requirements.txt
index 3b9ec44..4dea533 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,6 +19,6 @@
 testrepository>=0.0.17
 oslo.config>=1.2.0
 eventlet>=0.13.0
-six<1.4.0
+six>=1.4.1
 iso8601>=0.1.4
 fixtures>=0.3.14
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index 14ab236..e8acec5 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -22,7 +22,7 @@
 from tempest.test import attr
 
 
-class AggregatesAdminTestJSON(base.BaseComputeAdminTest):
+class AggregatesAdminTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests Aggregates API that require admin privileges
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index d1e1be6..d6488c4 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class AvailabilityZoneAdminTestJSON(base.BaseComputeAdminTest):
+class AvailabilityZoneAdminTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests Availability Zone API List that require admin privileges
diff --git a/tempest/api/compute/admin/test_fixed_ips.py b/tempest/api/compute/admin/test_fixed_ips.py
index ee262df..766589e 100644
--- a/tempest/api/compute/admin/test_fixed_ips.py
+++ b/tempest/api/compute/admin/test_fixed_ips.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class FixedIPsTestJson(base.BaseComputeAdminTest):
+class FixedIPsTestJson(base.BaseV2ComputeAdminTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index 004268e..75b8dad 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -24,7 +24,7 @@
 from tempest.test import skip_because
 
 
-class FlavorsAdminTestJSON(base.BaseComputeAdminTest):
+class FlavorsAdminTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests Flavors API Create and Delete that require admin privileges
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index 5495778..e8ae3b4 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -25,7 +25,7 @@
 from tempest.test import attr
 
 
-class FlavorsAccessTestJSON(base.BaseComputeAdminTest):
+class FlavorsAccessTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests Flavor Access API extension.
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index fb6a463..0fd4d11 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -23,7 +23,7 @@
 from tempest.test import attr
 
 
-class FlavorsExtraSpecsTestJSON(base.BaseComputeAdminTest):
+class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests Flavor Extra Spec API extension.
@@ -79,6 +79,12 @@
             self.client.get_flavor_extra_spec(self.flavor['id'])
         self.assertEqual(get_resp.status, 200)
         self.assertEqual(get_body, specs)
+        # GET a key value and verify
+        get_resp, get_body = \
+            self.client.get_flavor_extra_spec_with_key(self.flavor['id'],
+                                                       "key2")
+        self.assertEqual(get_resp.status, 200)
+        self.assertEqual(get_body, specs['key2'])
         # UNSET extra specs that were set in this test
         unset_resp, _ = \
             self.client.unset_flavor_extra_spec(self.flavor['id'], "key1")
diff --git a/tempest/api/compute/admin/test_hosts.py b/tempest/api/compute/admin/test_hosts.py
index bf09428..aa769ba 100644
--- a/tempest/api/compute/admin/test_hosts.py
+++ b/tempest/api/compute/admin/test_hosts.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class HostsAdminTestJSON(base.BaseComputeAdminTest):
+class HostsAdminTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests hosts API using admin privileges.
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index b7c3574..ef4f51f 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -19,7 +19,7 @@
 from tempest.test import attr
 
 
-class HypervisorAdminTestJSON(base.BaseComputeAdminTest):
+class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests Hypervisors API that require admin privileges
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 757dfc0..0d0073d 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -23,7 +23,7 @@
 from tempest.test import skip_because
 
 
-class QuotasAdminTestJSON(base.BaseComputeAdminTest):
+class QuotasAdminTestJSON(base.BaseV2ComputeAdminTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 97e0e69..ebc661c 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -22,7 +22,7 @@
 from tempest.test import skip_because
 
 
-class ServersAdminTestJSON(base.BaseComputeAdminTest):
+class ServersAdminTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests Servers API using admin privileges
diff --git a/tempest/api/compute/admin/test_services.py b/tempest/api/compute/admin/test_services.py
index 434ea2f..327d8b8 100644
--- a/tempest/api/compute/admin/test_services.py
+++ b/tempest/api/compute/admin/test_services.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class ServicesAdminTestJSON(base.BaseComputeAdminTest):
+class ServicesAdminTestJSON(base.BaseV2ComputeAdminTest):
 
     """
     Tests Services API. List and Enable/Disable require admin privileges.
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage.py b/tempest/api/compute/admin/test_simple_tenant_usage.py
index ce05899..3178ead 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage.py
@@ -23,7 +23,7 @@
 import time
 
 
-class TenantUsagesTestJSON(base.BaseComputeAdminTest):
+class TenantUsagesTestJSON(base.BaseV2ComputeAdminTest):
 
     _interface = 'json'
 
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 885adcf..b5c499b 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -54,37 +54,19 @@
             os = clients.Manager(interface=cls._interface)
 
         cls.os = os
-        cls.servers_client = os.servers_client
-        cls.flavors_client = os.flavors_client
-        cls.images_client = os.images_client
-        cls.extensions_client = os.extensions_client
-        cls.floating_ips_client = os.floating_ips_client
-        cls.keypairs_client = os.keypairs_client
-        cls.security_groups_client = os.security_groups_client
-        cls.quotas_client = os.quotas_client
-        cls.limits_client = os.limits_client
-        cls.volumes_extensions_client = os.volumes_extensions_client
-        cls.volumes_client = os.volumes_client
-        cls.interfaces_client = os.interfaces_client
-        cls.fixed_ips_client = os.fixed_ips_client
-        cls.availability_zone_client = os.availability_zone_client
-        cls.aggregates_client = os.aggregates_client
-        cls.services_client = os.services_client
-        cls.hypervisor_client = os.hypervisor_client
+
         cls.build_interval = cls.config.compute.build_interval
         cls.build_timeout = cls.config.compute.build_timeout
         cls.ssh_user = cls.config.compute.ssh_user
-        cls.image_ssh_user = cls.config.compute.image_ssh_user
-        cls.image_ssh_password = cls.config.compute.image_ssh_password
         cls.image_ref = cls.config.compute.image_ref
         cls.image_ref_alt = cls.config.compute.image_ref_alt
         cls.flavor_ref = cls.config.compute.flavor_ref
         cls.flavor_ref_alt = cls.config.compute.flavor_ref_alt
+        cls.image_ssh_user = cls.config.compute.image_ssh_user
+        cls.image_ssh_password = cls.config.compute.image_ssh_password
         cls.servers = []
         cls.images = []
 
-        cls.servers_client_v3_auth = os.servers_client_v3_auth
-
     @classmethod
     def clear_servers(cls):
         for server in cls.servers:
@@ -162,7 +144,7 @@
 
     @classmethod
     def create_image_from_server(cls, server_id, **kwargs):
-        """Wrapper utility that returns a test server."""
+        """Wrapper utility that returns an image created from the server."""
         name = rand_name(cls.__name__ + "-image")
         if 'name' in kwargs:
             name = kwargs.pop('name')
@@ -195,12 +177,37 @@
             time.sleep(self.build_interval)
 
 
-class BaseComputeAdminTest(BaseComputeTest):
-    """Base test case class for all Compute Admin API tests."""
+class BaseV2ComputeTest(BaseComputeTest):
 
     @classmethod
     def setUpClass(cls):
-        super(BaseComputeAdminTest, cls).setUpClass()
+        super(BaseV2ComputeTest, cls).setUpClass()
+        cls.servers_client = cls.os.servers_client
+        cls.flavors_client = cls.os.flavors_client
+        cls.images_client = cls.os.images_client
+        cls.extensions_client = cls.os.extensions_client
+        cls.floating_ips_client = cls.os.floating_ips_client
+        cls.keypairs_client = cls.os.keypairs_client
+        cls.security_groups_client = cls.os.security_groups_client
+        cls.quotas_client = cls.os.quotas_client
+        cls.limits_client = cls.os.limits_client
+        cls.volumes_extensions_client = cls.os.volumes_extensions_client
+        cls.volumes_client = cls.os.volumes_client
+        cls.interfaces_client = cls.os.interfaces_client
+        cls.fixed_ips_client = cls.os.fixed_ips_client
+        cls.availability_zone_client = cls.os.availability_zone_client
+        cls.aggregates_client = cls.os.aggregates_client
+        cls.services_client = cls.os.services_client
+        cls.hypervisor_client = cls.os.hypervisor_client
+        cls.servers_client_v3_auth = cls.os.servers_client_v3_auth
+
+
+class BaseV2ComputeAdminTest(BaseV2ComputeTest):
+    """Base test case class for Compute Admin V2 API tests."""
+
+    @classmethod
+    def setUpClass(cls):
+        super(BaseV2ComputeAdminTest, cls).setUpClass()
         admin_username = cls.config.compute_admin.username
         admin_password = cls.config.compute_admin.password
         admin_tenant = cls.config.compute_admin.tenant_name
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index cea13a0..eac98ea 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class FlavorsTestJSON(base.BaseComputeTest):
+class FlavorsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index a5a361e..ff7188b 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -23,7 +23,7 @@
 from tempest.test import attr
 
 
-class FloatingIPsTestJSON(base.BaseComputeTest):
+class FloatingIPsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
     server_id = None
     floating_ip = None
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips.py b/tempest/api/compute/floating_ips/test_list_floating_ips.py
index fb9610a..7fec2d1 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips.py
@@ -23,7 +23,7 @@
 from tempest.test import attr
 
 
-class FloatingIPDetailsTestJSON(base.BaseComputeTest):
+class FloatingIPDetailsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 8f19514..df857bf 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class ImagesMetadataTestJSON(base.BaseComputeTest):
+class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index 57f26f8..383ea1d 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -23,7 +23,7 @@
 from tempest.test import attr
 
 
-class ImagesTestJSON(base.BaseComputeTest):
+class ImagesTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index c484005..bec5ea4 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -30,7 +30,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class ImagesOneServerTestJSON(base.BaseComputeTest):
+class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     def tearDown(self):
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index 8a8d5bd..8d4e47b 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -25,7 +25,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class ListImageFiltersTestJSON(base.BaseComputeTest):
+class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/images/test_list_images.py b/tempest/api/compute/images/test_list_images.py
index 0647f86..a6726b6 100644
--- a/tempest/api/compute/images/test_list_images.py
+++ b/tempest/api/compute/images/test_list_images.py
@@ -19,7 +19,7 @@
 from tempest.test import attr
 
 
-class ListImagesTestJSON(base.BaseComputeTest):
+class ListImagesTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py
index 9b2a1de..d059994 100644
--- a/tempest/api/compute/keypairs/test_keypairs.py
+++ b/tempest/api/compute/keypairs/test_keypairs.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class KeyPairsTestJSON(base.BaseComputeTest):
+class KeyPairsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/limits/test_absolute_limits.py b/tempest/api/compute/limits/test_absolute_limits.py
index d2430df..2809244 100644
--- a/tempest/api/compute/limits/test_absolute_limits.py
+++ b/tempest/api/compute/limits/test_absolute_limits.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class AbsoluteLimitsTestJSON(base.BaseComputeTest):
+class AbsoluteLimitsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/security_groups/test_security_group_rules.py b/tempest/api/compute/security_groups/test_security_group_rules.py
index 5faa9a4..9dc164d 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules.py
@@ -23,7 +23,7 @@
 from tempest.test import skip_because
 
 
-class SecurityGroupRulesTestJSON(base.BaseComputeTest):
+class SecurityGroupRulesTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 2d9c62d..6e08700 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -25,7 +25,7 @@
 from tempest.test import skip_because
 
 
-class SecurityGroupsTestJSON(base.BaseComputeTest):
+class SecurityGroupsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index 9f66a6c..c554dc2 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -19,7 +19,7 @@
 import time
 
 
-class AttachInterfacesTestJSON(base.BaseComputeTest):
+class AttachInterfacesTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 31ca387..adbc048 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -28,7 +28,7 @@
 from tempest.test import attr
 
 
-class ServersTestJSON(base.BaseComputeTest):
+class ServersTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
     run_ssh = tempest.config.TempestConfig().compute.run_ssh
     disk_config = 'AUTO'
diff --git a/tempest/api/compute/servers/test_disk_config.py b/tempest/api/compute/servers/test_disk_config.py
index ffc8b6b..76a7117 100644
--- a/tempest/api/compute/servers/test_disk_config.py
+++ b/tempest/api/compute/servers/test_disk_config.py
@@ -22,7 +22,7 @@
 from tempest.test import attr
 
 
-class ServerDiskConfigTestJSON(base.BaseComputeTest):
+class ServerDiskConfigTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_instance_actions.py b/tempest/api/compute/servers/test_instance_actions.py
index f13e51e..61be50a 100644
--- a/tempest/api/compute/servers/test_instance_actions.py
+++ b/tempest/api/compute/servers/test_instance_actions.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class InstanceActionsTestJSON(base.BaseComputeTest):
+class InstanceActionsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 8e95671..778b8ec 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -24,7 +24,7 @@
 from tempest.test import skip_because
 
 
-class ListServerFiltersTestJSON(base.BaseComputeTest):
+class ListServerFiltersTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_list_servers_negative.py b/tempest/api/compute/servers/test_list_servers_negative.py
index 9dd2e27..bef45a7 100644
--- a/tempest/api/compute/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/servers/test_list_servers_negative.py
@@ -24,7 +24,7 @@
 from tempest.test import attr
 
 
-class ListServersNegativeTestJSON(base.BaseComputeTest):
+class ListServersNegativeTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_multiple_create.py b/tempest/api/compute/servers/test_multiple_create.py
index 7e4a70b..d582894 100644
--- a/tempest/api/compute/servers/test_multiple_create.py
+++ b/tempest/api/compute/servers/test_multiple_create.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class MultipleCreateTestJSON(base.BaseComputeTest):
+class MultipleCreateTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
     _name = 'multiple-create-test'
 
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index f073ebc..6f50a02 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -30,7 +30,7 @@
 from tempest.test import skip_because
 
 
-class ServerActionsTestJSON(base.BaseComputeTest):
+class ServerActionsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
     resize_available = tempest.config.TempestConfig().compute.resize_available
     run_ssh = tempest.config.TempestConfig().compute.run_ssh
diff --git a/tempest/api/compute/servers/test_server_addresses.py b/tempest/api/compute/servers/test_server_addresses.py
index b1b9253..a594f6c 100644
--- a/tempest/api/compute/servers/test_server_addresses.py
+++ b/tempest/api/compute/servers/test_server_addresses.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class ServerAddressesTest(base.BaseComputeTest):
+class ServerAddressesTest(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index 15c3e6b..4e45e4b 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class ServerMetadataTestJSON(base.BaseComputeTest):
+class ServerMetadataTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_server_personality.py b/tempest/api/compute/servers/test_server_personality.py
index 2019732..ba5c0df 100644
--- a/tempest/api/compute/servers/test_server_personality.py
+++ b/tempest/api/compute/servers/test_server_personality.py
@@ -22,7 +22,7 @@
 from tempest.test import attr
 
 
-class ServerPersonalityTestJSON(base.BaseComputeTest):
+class ServerPersonalityTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 3cbae56..f72d36e 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -22,7 +22,7 @@
 from tempest.test import attr
 
 
-class ServerRescueTestJSON(base.BaseComputeTest):
+class ServerRescueTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     run_ssh = tempest.config.TempestConfig().compute.run_ssh
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 5ce51c0..92ffd3a 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class ServersTestJSON(base.BaseComputeTest):
+class ServersTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index d2088fa..0f753a0 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -26,7 +26,7 @@
 from tempest.test import attr
 
 
-class ServersNegativeTestJSON(base.BaseComputeTest):
+class ServersNegativeTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     def setUp(self):
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
index 2c7ff32..a00e8ed 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -25,7 +25,7 @@
 from tempest.test import skip_because
 
 
-class VirtualInterfacesTestJSON(base.BaseComputeTest):
+class VirtualInterfacesTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     CONF = config.TempestConfig()
diff --git a/tempest/api/compute/test_auth_token.py b/tempest/api/compute/test_auth_token.py
index bbe92ef..ffeede8 100644
--- a/tempest/api/compute/test_auth_token.py
+++ b/tempest/api/compute/test_auth_token.py
@@ -19,7 +19,7 @@
 import tempest.config as config
 
 
-class AuthTokenTestJSON(base.BaseComputeTest):
+class AuthTokenTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 0a8595f..a7d9310 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -27,7 +27,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class AuthorizationTestJSON(base.BaseComputeTest):
+class AuthorizationTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/test_extensions.py b/tempest/api/compute/test_extensions.py
index c1b7aa5..8f1e446 100644
--- a/tempest/api/compute/test_extensions.py
+++ b/tempest/api/compute/test_extensions.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class ExtensionsTestJSON(base.BaseComputeTest):
+class ExtensionsTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @attr(type='gate')
diff --git a/tempest/api/compute/test_live_block_migration.py b/tempest/api/compute/test_live_block_migration.py
index 65daee0..bb8b372 100644
--- a/tempest/api/compute/test_live_block_migration.py
+++ b/tempest/api/compute/test_live_block_migration.py
@@ -26,7 +26,7 @@
 from tempest.test import attr
 
 
-class LiveBlockMigrationTestJSON(base.BaseComputeAdminTest):
+class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest):
     _host_key = 'OS-EXT-SRV-ATTR:host'
     _interface = 'json'
 
diff --git a/tempest/api/compute/test_quotas.py b/tempest/api/compute/test_quotas.py
index 6453cf4..4617bd2 100644
--- a/tempest/api/compute/test_quotas.py
+++ b/tempest/api/compute/test_quotas.py
@@ -19,7 +19,7 @@
 from tempest.test import attr
 
 
-class QuotasTestJSON(base.BaseComputeTest):
+class QuotasTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index ee1ad9e..a993077 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -23,7 +23,7 @@
 from tempest.test import attr
 
 
-class AttachVolumeTestJSON(base.BaseComputeTest):
+class AttachVolumeTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
     run_ssh = tempest.config.TempestConfig().compute.run_ssh
 
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index fba8347..192d81e 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class VolumesGetTestJSON(base.BaseComputeTest):
+class VolumesGetTestJSON(base.BaseV2ComputeTest):
 
     _interface = 'json'
 
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index 956abdf..b4e00f9 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class VolumesTestJSON(base.BaseComputeTest):
+class VolumesTestJSON(base.BaseV2ComputeTest):
 
     """
     This test creates a number of 1G volumes. To run successfully,
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
index 90e6946..785902e 100644
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -23,7 +23,7 @@
 from tempest.test import attr
 
 
-class VolumesNegativeTest(base.BaseComputeTest):
+class VolumesNegativeTest(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/volume/test_volumes_negative.py b/tempest/api/volume/test_volumes_negative.py
index 3e2b6ad..02adc5d 100644
--- a/tempest/api/volume/test_volumes_negative.py
+++ b/tempest/api/volume/test_volumes_negative.py
@@ -85,6 +85,33 @@
                           size='-1', display_name=v_name, metadata=metadata)
 
     @attr(type=['negative', 'gate'])
+    def test_create_volume_with_nonexistant_volume_type(self):
+        # Should not be able to create volume with non-existant volume type
+        v_name = rand_name('Volume-')
+        metadata = {'Type': 'work'}
+        self.assertRaises(exceptions.NotFound, self.client.create_volume,
+                          size='1', volume_type=str(uuid.uuid4()),
+                          display_name=v_name, metadata=metadata)
+
+    @attr(type=['negative', 'gate'])
+    def test_create_volume_with_nonexistant_snapshot_id(self):
+        # Should not be able to create volume with non-existant snapshot
+        v_name = rand_name('Volume-')
+        metadata = {'Type': 'work'}
+        self.assertRaises(exceptions.NotFound, self.client.create_volume,
+                          size='1', snapshot_id=str(uuid.uuid4()),
+                          display_name=v_name, metadata=metadata)
+
+    @attr(type=['negative', 'gate'])
+    def test_create_volume_with_nonexistant_source_volid(self):
+        # Should not be able to create volume with non-existant source volume
+        v_name = rand_name('Volume-')
+        metadata = {'Type': 'work'}
+        self.assertRaises(exceptions.NotFound, self.client.create_volume,
+                          size='1', source_volid=str(uuid.uuid4()),
+                          display_name=v_name, metadata=metadata)
+
+    @attr(type=['negative', 'gate'])
     def test_update_volume_with_nonexistant_volume_id(self):
         v_name = rand_name('Volume-')
         metadata = {'Type': 'work'}
diff --git a/tempest/clients.py b/tempest/clients.py
index 63ce1ba..dd104a7 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -116,151 +116,6 @@
 
 LOG = logging.getLogger(__name__)
 
-IMAGES_CLIENTS = {
-    "json": ImagesClientJSON,
-    "xml": ImagesClientXML,
-}
-
-NETWORKS_CLIENTS = {
-    "json": NetworkClientJSON,
-    "xml": NetworkClientXML,
-}
-
-KEYPAIRS_CLIENTS = {
-    "json": KeyPairsClientJSON,
-    "xml": KeyPairsClientXML,
-}
-
-QUOTAS_CLIENTS = {
-    "json": QuotasClientJSON,
-    "xml": QuotasClientXML,
-}
-
-SERVERS_CLIENTS = {
-    "json": ServersClientJSON,
-    "xml": ServersClientXML,
-}
-
-LIMITS_CLIENTS = {
-    "json": LimitsClientJSON,
-    "xml": LimitsClientXML,
-}
-
-FLAVORS_CLIENTS = {
-    "json": FlavorsClientJSON,
-    "xml": FlavorsClientXML
-}
-
-EXTENSIONS_CLIENTS = {
-    "json": ExtensionsClientJSON,
-    "xml": ExtensionsClientXML
-}
-
-VOLUMES_EXTENSIONS_CLIENTS = {
-    "json": VolumesExtensionsClientJSON,
-    "xml": VolumesExtensionsClientXML,
-}
-
-FLOAT_CLIENTS = {
-    "json": FloatingIPsClientJSON,
-    "xml": FloatingIPsClientXML,
-}
-
-SNAPSHOTS_CLIENTS = {
-    "json": SnapshotsClientJSON,
-    "xml": SnapshotsClientXML,
-}
-
-VOLUMES_CLIENTS = {
-    "json": VolumesClientJSON,
-    "xml": VolumesClientXML,
-}
-
-VOLUME_TYPES_CLIENTS = {
-    "json": VolumeTypesClientJSON,
-    "xml": VolumeTypesClientXML,
-}
-
-IDENTITY_CLIENT = {
-    "json": IdentityClientJSON,
-    "xml": IdentityClientXML,
-}
-
-IDENTITY_V3_CLIENT = {
-    "json": IdentityV3ClientJSON,
-    "xml": IdentityV3ClientXML,
-}
-
-TOKEN_CLIENT = {
-    "json": TokenClientJSON,
-    "xml": TokenClientXML,
-}
-
-SECURITY_GROUPS_CLIENT = {
-    "json": SecurityGroupsClientJSON,
-    "xml": SecurityGroupsClientXML,
-}
-
-INTERFACES_CLIENT = {
-    "json": InterfacesClientJSON,
-    "xml": InterfacesClientXML,
-}
-
-ENDPOINT_CLIENT = {
-    "json": EndPointClientJSON,
-    "xml": EndPointClientXML,
-}
-
-FIXED_IPS_CLIENT = {
-    "json": FixedIPsClientJSON,
-    "xml": FixedIPsClientXML
-}
-
-AVAILABILITY_ZONE_CLIENT = {
-    "json": AvailabilityZoneClientJSON,
-    "xml": AvailabilityZoneClientXML,
-}
-
-SERVICE_CLIENT = {
-    "json": ServiceClientJSON,
-    "xml": ServiceClientXML,
-}
-
-AGGREGATES_CLIENT = {
-    "json": AggregatesClientJSON,
-    "xml": AggregatesClientXML,
-}
-
-SERVICES_CLIENT = {
-    "json": ServicesClientJSON,
-    "xml": ServicesClientXML,
-}
-
-TENANT_USAGES_CLIENT = {
-    "json": TenantUsagesClientJSON,
-    "xml": TenantUsagesClientXML,
-}
-
-POLICY_CLIENT = {
-    "json": PolicyClientJSON,
-    "xml": PolicyClientXML,
-}
-
-HYPERVISOR_CLIENT = {
-    "json": HypervisorClientJSON,
-    "xml": HypervisorClientXML,
-}
-
-V3_TOKEN_CLIENT = {
-    "json": V3TokenClientJSON,
-    "xml": V3TokenClientXML,
-}
-
-CREDENTIALS_CLIENT = {
-    "json": CredentialsClientJSON,
-    "xml": CredentialsClientXML,
-}
-
 
 class Manager(object):
 
@@ -308,55 +163,88 @@
         else:
             client_args_v3_auth = None
 
-        try:
-            self.servers_client = SERVERS_CLIENTS[interface](*client_args)
-            self.network_client = NETWORKS_CLIENTS[interface](*client_args)
-            self.limits_client = LIMITS_CLIENTS[interface](*client_args)
-            if self.config.service_available.glance:
-                self.images_client = IMAGES_CLIENTS[interface](*client_args)
-            self.keypairs_client = KEYPAIRS_CLIENTS[interface](*client_args)
-            self.quotas_client = QUOTAS_CLIENTS[interface](*client_args)
-            self.flavors_client = FLAVORS_CLIENTS[interface](*client_args)
-            ext_cli = EXTENSIONS_CLIENTS[interface](*client_args)
-            self.extensions_client = ext_cli
-            vol_ext_cli = VOLUMES_EXTENSIONS_CLIENTS[interface](*client_args)
-            self.volumes_extensions_client = vol_ext_cli
-            self.floating_ips_client = FLOAT_CLIENTS[interface](*client_args)
-            self.snapshots_client = SNAPSHOTS_CLIENTS[interface](*client_args)
-            self.volumes_client = VOLUMES_CLIENTS[interface](*client_args)
-            self.volume_types_client = \
-                VOLUME_TYPES_CLIENTS[interface](*client_args)
-            self.identity_client = IDENTITY_CLIENT[interface](*client_args)
-            self.identity_v3_client = \
-                IDENTITY_V3_CLIENT[interface](*client_args)
-            self.token_client = TOKEN_CLIENT[interface](self.config)
-            self.security_groups_client = \
-                SECURITY_GROUPS_CLIENT[interface](*client_args)
-            self.interfaces_client = INTERFACES_CLIENT[interface](*client_args)
-            self.endpoints_client = ENDPOINT_CLIENT[interface](*client_args)
-            self.fixed_ips_client = FIXED_IPS_CLIENT[interface](*client_args)
-            self.availability_zone_client = \
-                AVAILABILITY_ZONE_CLIENT[interface](*client_args)
-            self.service_client = SERVICE_CLIENT[interface](*client_args)
-            self.aggregates_client = AGGREGATES_CLIENT[interface](*client_args)
-            self.services_client = SERVICES_CLIENT[interface](*client_args)
-            self.tenant_usages_client = \
-                TENANT_USAGES_CLIENT[interface](*client_args)
-            self.policy_client = POLICY_CLIENT[interface](*client_args)
-            self.hypervisor_client = HYPERVISOR_CLIENT[interface](*client_args)
-            self.token_v3_client = V3_TOKEN_CLIENT[interface](*client_args)
-            self.credentials_client = \
-                CREDENTIALS_CLIENT[interface](*client_args)
+        self.servers_client_v3_auth = None
+
+        if interface == 'xml':
+            self.servers_client = ServersClientXML(*client_args)
+            self.limits_client = LimitsClientXML(*client_args)
+            self.images_client = ImagesClientXML(*client_args)
+            self.keypairs_client = KeyPairsClientXML(*client_args)
+            self.quotas_client = QuotasClientXML(*client_args)
+            self.flavors_client = FlavorsClientXML(*client_args)
+            self.extensions_client = ExtensionsClientXML(*client_args)
+            self.volumes_extensions_client = VolumesExtensionsClientXML(
+                *client_args)
+            self.floating_ips_client = FloatingIPsClientXML(*client_args)
+            self.snapshots_client = SnapshotsClientXML(*client_args)
+            self.volumes_client = VolumesClientXML(*client_args)
+            self.volume_types_client = VolumeTypesClientXML(*client_args)
+            self.identity_client = IdentityClientXML(*client_args)
+            self.identity_v3_client = IdentityV3ClientXML(*client_args)
+            self.token_client = TokenClientXML(self.config)
+            self.security_groups_client = SecurityGroupsClientXML(
+                *client_args)
+            self.interfaces_client = InterfacesClientXML(*client_args)
+            self.endpoints_client = EndPointClientXML(*client_args)
+            self.fixed_ips_client = FixedIPsClientXML(*client_args)
+            self.availability_zone_client = AvailabilityZoneClientXML(
+                *client_args)
+            self.service_client = ServiceClientXML(*client_args)
+            self.aggregates_client = AggregatesClientXML(*client_args)
+            self.services_client = ServicesClientXML(*client_args)
+            self.tenant_usages_client = TenantUsagesClientXML(*client_args)
+            self.policy_client = PolicyClientXML(*client_args)
+            self.hypervisor_client = HypervisorClientXML(*client_args)
+            self.token_v3_client = V3TokenClientXML(*client_args)
+            self.network_client = NetworkClientXML(*client_args)
+            self.credentials_client = CredentialsClientXML(*client_args)
 
             if client_args_v3_auth:
-                self.servers_client_v3_auth = SERVERS_CLIENTS[interface](
+                self.servers_client_v3_auth = ServersClientXML(
                     *client_args_v3_auth)
-            else:
-                self.servers_client_v3_auth = None
 
-        except KeyError:
+        elif interface == 'json':
+            self.servers_client = ServersClientJSON(*client_args)
+            self.limits_client = LimitsClientJSON(*client_args)
+            self.images_client = ImagesClientJSON(*client_args)
+            self.keypairs_client = KeyPairsClientJSON(*client_args)
+            self.quotas_client = QuotasClientJSON(*client_args)
+            self.flavors_client = FlavorsClientJSON(*client_args)
+            self.extensions_client = ExtensionsClientJSON(*client_args)
+            self.volumes_extensions_client = VolumesExtensionsClientJSON(
+                *client_args)
+            self.floating_ips_client = FloatingIPsClientJSON(*client_args)
+            self.snapshots_client = SnapshotsClientJSON(*client_args)
+            self.volumes_client = VolumesClientJSON(*client_args)
+            self.volume_types_client = VolumeTypesClientJSON(*client_args)
+            self.identity_client = IdentityClientJSON(*client_args)
+            self.identity_v3_client = IdentityV3ClientJSON(*client_args)
+            self.token_client = TokenClientJSON(self.config)
+            self.security_groups_client = SecurityGroupsClientJSON(
+                *client_args)
+            self.interfaces_client = InterfacesClientJSON(*client_args)
+            self.endpoints_client = EndPointClientJSON(*client_args)
+            self.fixed_ips_client = FixedIPsClientJSON(*client_args)
+            self.availability_zone_client = AvailabilityZoneClientJSON(
+                *client_args)
+            self.service_client = ServiceClientJSON(*client_args)
+            self.aggregates_client = AggregatesClientJSON(*client_args)
+            self.services_client = ServicesClientJSON(*client_args)
+            self.tenant_usages_client = TenantUsagesClientJSON(*client_args)
+            self.policy_client = PolicyClientJSON(*client_args)
+            self.hypervisor_client = HypervisorClientJSON(*client_args)
+            self.token_v3_client = V3TokenClientJSON(*client_args)
+            self.network_client = NetworkClientJSON(*client_args)
+            self.credentials_client = CredentialsClientJSON(*client_args)
+
+            if client_args_v3_auth:
+                self.servers_client_v3_auth = ServersClientJSON(
+                    *client_args_v3_auth)
+        else:
             msg = "Unsupported interface type `%s'" % interface
             raise exceptions.InvalidConfiguration(msg)
+
+        # common clients
         self.hosts_client = HostsClientJSON(*client_args)
         self.account_client = AccountClient(*client_args)
         if self.config.service_available.glance:
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index c3b568d..dc05e3e 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -102,6 +102,13 @@
         body = json.loads(body)
         return resp, body['extra_specs']
 
+    def get_flavor_extra_spec_with_key(self, flavor_id, key):
+        """Gets a specified key value for the mentioned flavor."""
+        resp, body = self.get('flavors/%s/os-extra_specs/%s' % (str(flavor_id),
+                              key))
+        body = json.loads(body)
+        return resp, body[key]
+
     def unset_flavor_extra_spec(self, flavor_id, key):
         """Unsets extra Specs from the mentioned flavor."""
         return self.delete('flavors/%s/os-extra_specs/%s' % (str(flavor_id),
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
index c5886ee..c7ed044 100644
--- a/tempest/services/compute/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -148,6 +148,13 @@
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
+    def get_flavor_extra_spec_with_key(self, flavor_id, key):
+        """Gets a specified key detail for the mentioned flavor."""
+        resp, body = self.get('flavors/%s/os-extra_specs/%s' % (str(flavor_id),
+                              key), self.headers)
+        body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
     def unset_flavor_extra_spec(self, flavor_id, key):
         """Unsets an extra spec based on the mentioned flavor and key."""
         return self.delete('flavors/%s/os-extra_specs/%s' % (str(flavor_id),