Merge "Added test_list_tenants non-admin test for v2, v3 api/identity"
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
index 85f0041..7aa6d34 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -57,4 +57,5 @@
         for virt_iface in virt_ifaces['virtual_interfaces']:
             mac_address = virt_iface['mac_address']
             self.assertTrue(netaddr.valid_mac(mac_address),
-                            "Invalid mac address detected.")
+                            "Invalid mac address detected. mac address: %s"
+                            % mac_address)
diff --git a/tempest/api/compute/test_networks.py b/tempest/api/compute/test_networks.py
index bf2a78d..b53db3d 100644
--- a/tempest/api/compute/test_networks.py
+++ b/tempest/api/compute/test_networks.py
@@ -19,16 +19,16 @@
 CONF = config.CONF
 
 
-class NetworksTestJSON(base.BaseV2ComputeTest):
+class ComputeNetworksTest(base.BaseV2ComputeTest):
     @classmethod
     def skip_checks(cls):
-        super(NetworksTestJSON, cls).skip_checks()
+        super(ComputeNetworksTest, cls).skip_checks()
         if CONF.service_available.neutron:
             raise cls.skipException('nova-network is not available.')
 
     @classmethod
     def setup_clients(cls):
-        super(NetworksTestJSON, cls).setup_clients()
+        super(ComputeNetworksTest, cls).setup_clients()
         cls.client = cls.os.networks_client
 
     @test.idempotent_id('3fe07175-312e-49a5-a623-5f52eeada4c2')
diff --git a/tempest/api/compute/test_tenant_networks.py b/tempest/api/compute/test_tenant_networks.py
index 11f572e..80691a8 100644
--- a/tempest/api/compute/test_tenant_networks.py
+++ b/tempest/api/compute/test_tenant_networks.py
@@ -16,11 +16,11 @@
 from tempest import test
 
 
-class NetworksTestJSON(base.BaseV2ComputeTest):
+class ComputeTenantNetworksTest(base.BaseV2ComputeTest):
 
     @classmethod
     def resource_setup(cls):
-        super(NetworksTestJSON, cls).resource_setup()
+        super(ComputeTenantNetworksTest, cls).resource_setup()
         cls.client = cls.os.tenant_networks_client
 
     @test.idempotent_id('edfea98e-bbe3-4c7a-9739-87b986baff26')
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index 5685be8..1116573 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -27,7 +27,7 @@
 CONF = config.CONF
 
 
-class NetworksTestJSON(base.BaseNetworkTest):
+class NetworksTest(base.BaseNetworkTest):
     """
     Tests the following operations in the Neutron API using the REST client for
     Neutron:
@@ -61,7 +61,7 @@
 
     @classmethod
     def resource_setup(cls):
-        super(NetworksTestJSON, cls).resource_setup()
+        super(NetworksTest, cls).resource_setup()
         cls.network = cls.create_network()
         cls.name = cls.network['name']
         cls.subnet = cls._create_subnet_with_last_subnet_block(cls.network,
@@ -533,7 +533,7 @@
     _ip_version = 6
 
 
-class NetworksIpV6TestJSON(NetworksTestJSON):
+class NetworksIpV6TestJSON(NetworksTest):
     _ip_version = 6
 
     @test.idempotent_id('e41a4888-65a6-418c-a095-f7c2ef4ad59a')
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 365f37f..07d1d75 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -930,7 +930,7 @@
 
     def list(self):
         client = self.client
-        domains = client.list_domains()
+        domains = client.list_domains()['domains']
         if not self.is_save_state:
             domains = [domain for domain in domains if domain['id']
                        not in self.saved_state_json['domains'].keys()]
diff --git a/tempest/services/compute/json/floating_ip_pools_client.py b/tempest/services/compute/json/floating_ip_pools_client.py
index 7a4434f..c83537a 100644
--- a/tempest/services/compute/json/floating_ip_pools_client.py
+++ b/tempest/services/compute/json/floating_ip_pools_client.py
@@ -13,8 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
+from oslo_serialization import jsonutils as json
 from six.moves.urllib import parse as urllib
 
 from tempest.api_schema.response.compute.v2_1 import floating_ips as schema
diff --git a/tempest/services/compute/json/floating_ips_bulk_client.py b/tempest/services/compute/json/floating_ips_bulk_client.py
index c51f77e..cabeeb1 100644
--- a/tempest/services/compute/json/floating_ips_bulk_client.py
+++ b/tempest/services/compute/json/floating_ips_bulk_client.py
@@ -13,7 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
+from oslo_serialization import jsonutils as json
 
 from tempest.api_schema.response.compute.v2_1 import floating_ips as schema
 from tempest.common import service_client
diff --git a/tempest/services/compute/json/security_group_rules_client.py b/tempest/services/compute/json/security_group_rules_client.py
index c9096d0..c1c6b1a 100644
--- a/tempest/services/compute/json/security_group_rules_client.py
+++ b/tempest/services/compute/json/security_group_rules_client.py
@@ -13,8 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
+from oslo_serialization import jsonutils as json
 from tempest_lib import exceptions as lib_exc
 
 from tempest.api_schema.response.compute.v2_1 import security_groups as schema
diff --git a/tempest/services/compute/json/server_groups_client.py b/tempest/services/compute/json/server_groups_client.py
index 30e9e5b..33501fb 100644
--- a/tempest/services/compute/json/server_groups_client.py
+++ b/tempest/services/compute/json/server_groups_client.py
@@ -14,7 +14,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
+from oslo_serialization import jsonutils as json
 
 from tempest.api_schema.response.compute.v2_1 import servers as schema
 from tempest.common import service_client
diff --git a/tempest/services/database/json/limits_client.py b/tempest/services/database/json/limits_client.py
index 9358a33..da495d7 100644
--- a/tempest/services/database/json/limits_client.py
+++ b/tempest/services/database/json/limits_client.py
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_serialization import jsonutils as json
 from six.moves.urllib import parse as urllib
 
 from tempest.common import service_client
@@ -27,4 +28,5 @@
             url += '?%s' % urllib.urlencode(params)
         resp, body = self.get(url)
         self.expected_success(200, resp.status)
+        body = json.loads(body)
         return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/database/json/versions_client.py b/tempest/services/database/json/versions_client.py
index 43d253b..7a560d9 100644
--- a/tempest/services/database/json/versions_client.py
+++ b/tempest/services/database/json/versions_client.py
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_serialization import jsonutils as json
 from six.moves.urllib import parse as urllib
 
 from tempest.common import service_client
@@ -43,4 +44,5 @@
 
         resp, body = self.get(url)
         self.expected_success(200, resp.status)
+        body = json.loads(body)
         return service_client.ResponseBody(resp, body)