Merge "Add api-ref link for some interfaces"
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index 3789aa0..6a2af71 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -24,6 +24,7 @@
 from tempest.common.utils import net_utils
 from tempest.common import waiters
 from tempest import config
+from tempest.lib.common.utils import data_utils
 from tempest.lib.common.utils.linux import remote_client
 from tempest.lib.common.utils import test_utils
 from tempest.lib import decorators
@@ -150,7 +151,9 @@
 
     def _test_create_interface_by_port_id(self, server, ifs):
         network_id = ifs[0]['net_id']
-        port = self.ports_client.create_port(network_id=network_id)
+        port = self.ports_client.create_port(
+            network_id=network_id,
+            name=data_utils.rand_name(self.__class__.__name__))
         port_id = port['port']['id']
         self.addCleanup(self.ports_client.delete_port, port_id)
         iface = self.interfaces_client.create_interface(
@@ -291,7 +294,9 @@
         """
         network = self.get_tenant_network()
         network_id = network['id']
-        port = self.ports_client.create_port(network_id=network_id)
+        port = self.ports_client.create_port(
+            network_id=network_id,
+            name=data_utils.rand_name(self.__class__.__name__))
         port_id = port['port']['id']
         self.addCleanup(self.ports_client.delete_port, port_id)
 
diff --git a/tempest/api/compute/servers/test_device_tagging.py b/tempest/api/compute/servers/test_device_tagging.py
index e817587..4ee243e 100644
--- a/tempest/api/compute/servers/test_device_tagging.py
+++ b/tempest/api/compute/servers/test_device_tagging.py
@@ -175,11 +175,13 @@
         # Create ports
         self.port1 = self.ports_client.create_port(
             network_id=net1['id'],
+            name=data_utils.rand_name(self.__class__.__name__),
             fixed_ips=[{'subnet_id': subnet1['id']}])['port']
         self.addCleanup(self.ports_client.delete_port, self.port1['id'])
 
         self.port2 = self.ports_client.create_port(
             network_id=net1['id'],
+            name=data_utils.rand_name(self.__class__.__name__),
             fixed_ips=[{'subnet_id': subnet1['id']}])['port']
         self.addCleanup(self.ports_client.delete_port, self.port2['id'])
 
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 76d65dd..1e3e966 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -209,7 +209,8 @@
                                        server['id'], 'ACTIVE')
 
         # Check rebuild API response schema
-        self.servers_client.rebuild_server(server['id'], self.image_ref_alt)
+        self.servers_client.rebuild_server(
+            server['id'], CONF.compute.certified_image_ref)
         waiters.wait_for_server_status(self.servers_client,
                                        server['id'], 'ACTIVE')
 
diff --git a/tempest/api/network/admin/test_external_networks_negative.py b/tempest/api/network/admin/test_external_networks_negative.py
index 0709d2a..da32f2d 100644
--- a/tempest/api/network/admin/test_external_networks_negative.py
+++ b/tempest/api/network/admin/test_external_networks_negative.py
@@ -16,6 +16,7 @@
 
 from tempest.api.network import base
 from tempest import config
+from tempest.lib.common.utils import data_utils
 from tempest.lib.common.utils import test_utils
 from tempest.lib import decorators
 from tempest.lib import exceptions as lib_exc
@@ -50,5 +51,6 @@
         # create a port which will internally create an instance-ip
         self.assertRaises(lib_exc.Conflict,
                           self.admin_ports_client.create_port,
+                          name=data_utils.rand_name(self.__class__.__name__),
                           network_id=CONF.network.public_network_id,
                           fixed_ips=fixed_ips)
diff --git a/tempest/api/network/admin/test_ports.py b/tempest/api/network/admin/test_ports.py
index 3910fc9..289e577 100644
--- a/tempest/api/network/admin/test_ports.py
+++ b/tempest/api/network/admin/test_ports.py
@@ -16,6 +16,7 @@
 from tempest.api.network import base
 from tempest.common import utils
 from tempest import config
+from tempest.lib.common.utils import data_utils
 from tempest.lib.common.utils import test_utils
 from tempest.lib import decorators
 
@@ -41,7 +42,8 @@
     @utils.services('compute')
     def test_create_port_binding_ext_attr(self):
         post_body = {"network_id": self.network['id'],
-                     "binding:host_id": self.host_id}
+                     "binding:host_id": self.host_id,
+                     "name": data_utils.rand_name(self.__class__.__name__)}
         body = self.admin_ports_client.create_port(**post_body)
         port = body['port']
         self.addCleanup(
@@ -54,7 +56,8 @@
     @decorators.idempotent_id('6f6c412c-711f-444d-8502-0ac30fbf5dd5')
     @utils.services('compute')
     def test_update_port_binding_ext_attr(self):
-        post_body = {"network_id": self.network['id']}
+        post_body = {"network_id": self.network['id'],
+                     "name": data_utils.rand_name(self.__class__.__name__)}
         body = self.admin_ports_client.create_port(**post_body)
         port = body['port']
         self.addCleanup(
@@ -71,7 +74,8 @@
     @utils.services('compute')
     def test_list_ports_binding_ext_attr(self):
         # Create a new port
-        post_body = {"network_id": self.network['id']}
+        post_body = {"network_id": self.network['id'],
+                     "name": data_utils.rand_name(self.__class__.__name__)}
         body = self.admin_ports_client.create_port(**post_body)
         port = body['port']
         self.addCleanup(
@@ -98,6 +102,7 @@
     @decorators.idempotent_id('b54ac0ff-35fc-4c79-9ca3-c7dbd4ea4f13')
     def test_show_port_binding_ext_attr(self):
         body = self.admin_ports_client.create_port(
+            name=data_utils.rand_name(self.__class__.__name__),
             network_id=self.network['id'])
         port = body['port']
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
diff --git a/tempest/api/network/admin/test_routers_negative.py b/tempest/api/network/admin/test_routers_negative.py
index fdcc977..f605945 100644
--- a/tempest/api/network/admin/test_routers_negative.py
+++ b/tempest/api/network/admin/test_routers_negative.py
@@ -18,6 +18,7 @@
 from tempest.api.network import base
 from tempest.common import utils
 from tempest import config
+from tempest.lib.common.utils import data_utils
 from tempest.lib.common.utils import test_utils
 from tempest.lib import decorators
 from tempest.lib import exceptions as lib_exc
@@ -42,6 +43,7 @@
     def test_router_set_gateway_used_ip_returns_409(self):
         # At first create a address from public_network_id
         port = self.admin_ports_client.create_port(
+            name=data_utils.rand_name(self.__class__.__name__),
             network_id=CONF.network.public_network_id)['port']
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.admin_ports_client.delete_port,
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 9032fdc..b6bf369 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -156,6 +156,8 @@
 
     @classmethod
     def create_port(cls, network, **kwargs):
+        if 'name' not in kwargs:
+            kwargs['name'] = data_utils.rand_name(cls.__name__)
         """Wrapper utility that returns a test port."""
         body = cls.ports_client.create_port(network_id=network['id'],
                                             **kwargs)
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index d393207..639defb 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -17,6 +17,7 @@
 
 from tempest.api.network import base
 from tempest.common import utils
+from tempest.lib.common.utils import data_utils
 from tempest.lib.common.utils import test_utils
 from tempest.lib import decorators
 
@@ -61,6 +62,7 @@
                                   'mac_address': self.mac_address}]
         body = self.ports_client.create_port(
             network_id=self.network['id'],
+            name=data_utils.rand_name(self.__class__.__name__),
             allowed_address_pairs=allowed_address_pairs)
         port_id = body['port']['id']
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
@@ -76,7 +78,9 @@
 
     def _update_port_with_address(self, address, mac_address=None, **kwargs):
         # Create a port without allowed address pair
-        body = self.ports_client.create_port(network_id=self.network['id'])
+        body = self.ports_client.create_port(
+            network_id=self.network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         port_id = body['port']['id']
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, port_id)
@@ -107,7 +111,9 @@
     @decorators.idempotent_id('b3f20091-6cd5-472b-8487-3516137df933')
     def test_update_port_with_multiple_ip_mac_address_pair(self):
         # Create an ip _address and mac_address through port create
-        resp = self.ports_client.create_port(network_id=self.network['id'])
+        resp = self.ports_client.create_port(
+            network_id=self.network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         newportid = resp['port']['id']
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, newportid)
diff --git a/tempest/api/network/test_extra_dhcp_options.py b/tempest/api/network/test_extra_dhcp_options.py
index 8e94429..d363081 100644
--- a/tempest/api/network/test_extra_dhcp_options.py
+++ b/tempest/api/network/test_extra_dhcp_options.py
@@ -61,6 +61,7 @@
         # Create a port with Extra DHCP Options
         body = self.ports_client.create_port(
             network_id=self.network['id'],
+            name=data_utils.rand_name(self.__class__.__name__),
             extra_dhcp_opts=self.extra_dhcp_opts)
         port_id = body['port']['id']
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py
index 9704c73..aaa5497 100644
--- a/tempest/api/network/test_floating_ips.py
+++ b/tempest/api/network/test_floating_ips.py
@@ -142,7 +142,9 @@
             self.floating_ips_client.delete_floatingip,
             created_floating_ip['id'])
         # Create a port
-        port = self.ports_client.create_port(network_id=self.network['id'])
+        port = self.ports_client.create_port(
+            network_id=self.network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         created_port = port['port']
         floating_ip = self.floating_ips_client.update_floatingip(
             created_floating_ip['id'],
@@ -237,8 +239,10 @@
             2)
         fixed_ips = [{'ip_address': list_ips[0]}, {'ip_address': list_ips[1]}]
         # Create port
-        body = self.ports_client.create_port(network_id=self.network['id'],
-                                             fixed_ips=fixed_ips)
+        body = self.ports_client.create_port(
+            network_id=self.network['id'],
+            name=data_utils.rand_name(self.__class__.__name__),
+            fixed_ips=fixed_ips)
         port = body['port']
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, port['id'])
diff --git a/tempest/api/network/test_networks_negative.py b/tempest/api/network/test_networks_negative.py
index bc4f41f..3af67dd 100644
--- a/tempest/api/network/test_networks_negative.py
+++ b/tempest/api/network/test_networks_negative.py
@@ -79,7 +79,8 @@
         non_exist_net_id = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound,
                           self.ports_client.create_port,
-                          network_id=non_exist_net_id)
+                          network_id=non_exist_net_id,
+                          name=data_utils.rand_name(self.__class__.__name__))
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('cf8eef21-4351-4f53-adcd-cc5cb1e76b92')
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index 93a4631..56b5509 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -71,7 +71,9 @@
     @decorators.idempotent_id('c72c1c0c-2193-4aca-aaa4-b1442640f51c')
     def test_create_update_delete_port(self):
         # Verify port creation
-        body = self.ports_client.create_port(network_id=self.network['id'])
+        body = self.ports_client.create_port(
+            network_id=self.network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         port = body['port']
         # Schedule port deletion with verification upon test completion
         self.addCleanup(self._delete_port, port['id'])
@@ -118,7 +120,9 @@
         self._create_subnet(network, cidr=address,
                             mask_bits=address.prefixlen,
                             **allocation_pools)
-        body = self.ports_client.create_port(network_id=net_id)
+        body = self.ports_client.create_port(
+            network_id=net_id,
+            name=data_utils.rand_name(self.__class__.__name__))
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, body['port']['id'])
         port = body['port']
@@ -172,10 +176,14 @@
         network = self._create_network()
         self._create_subnet(network)
         # Create two ports
-        port_1 = self.ports_client.create_port(network_id=network['id'])
+        port_1 = self.ports_client.create_port(
+            network_id=network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, port_1['port']['id'])
-        port_2 = self.ports_client.create_port(network_id=network['id'])
+        port_2 = self.ports_client.create_port(
+            network_id=network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, port_2['port']['id'])
         # List ports filtered by fixed_ips
@@ -224,13 +232,17 @@
 
         # Create two ports
         fixed_ips = [{'subnet_id': subnet['id'], 'ip_address': ip_address_1}]
-        port_1 = self.ports_client.create_port(network_id=network['id'],
-                                               fixed_ips=fixed_ips)
+        port_1 = self.ports_client.create_port(
+            network_id=network['id'],
+            name=data_utils.rand_name(self.__class__.__name__),
+            fixed_ips=fixed_ips)
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, port_1['port']['id'])
         fixed_ips = [{'subnet_id': subnet['id'], 'ip_address': ip_address_2}]
-        port_2 = self.ports_client.create_port(network_id=network['id'],
-                                               fixed_ips=fixed_ips)
+        port_2 = self.ports_client.create_port(
+            network_id=network['id'],
+            name=data_utils.rand_name(self.__class__.__name__),
+            fixed_ips=fixed_ips)
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, port_2['port']['id'])
 
@@ -283,7 +295,9 @@
         router = self.create_router()
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.routers_client.delete_router, router['id'])
-        port = self.ports_client.create_port(network_id=network['id'])
+        port = self.ports_client.create_port(
+            network_id=network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         # Add router interface to port created above
         self.routers_client.add_router_interface(router['id'],
                                                  port_id=port['port']['id'])
@@ -359,7 +373,7 @@
                         self.security_groups_client.delete_security_group,
                         security_group['security_group']['id'])
         post_body = {
-            "name": data_utils.rand_name('port-'),
+            "name": data_utils.rand_name(self.__class__.__name__),
             "security_groups": [security_group['security_group']['id']],
             "network_id": self.network['id'],
             "admin_state_up": True,
@@ -372,10 +386,11 @@
         # Update the port with security groups
         subnet_2 = self.create_subnet(self.network)
         fixed_ip_2 = [{'subnet_id': subnet_2['id']}]
-        update_body = {"name": data_utils.rand_name('port-'),
-                       "admin_state_up": False,
-                       "fixed_ips": fixed_ip_2,
-                       "security_groups": security_groups_list}
+        update_body = {
+            "name": data_utils.rand_name(self.__class__.__name__),
+            "admin_state_up": False,
+            "fixed_ips": fixed_ip_2,
+            "security_groups": security_groups_list}
         body = self.ports_client.update_port(port['id'], **update_body)
         port_show = body['port']
         # Verify the security groups and other attributes updated to port
@@ -410,13 +425,17 @@
     @decorators.idempotent_id('13e95171-6cbd-489c-9d7c-3f9c58215c18')
     def test_create_show_delete_port_user_defined_mac(self):
         # Create a port for a legal mac
-        body = self.ports_client.create_port(network_id=self.network['id'])
+        body = self.ports_client.create_port(
+            network_id=self.network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         old_port = body['port']
         free_mac_address = old_port['mac_address']
         self.ports_client.delete_port(old_port['id'])
         # Create a new port with user defined mac
-        body = self.ports_client.create_port(network_id=self.network['id'],
-                                             mac_address=free_mac_address)
+        body = self.ports_client.create_port(
+            network_id=self.network['id'],
+            mac_address=free_mac_address,
+            name=data_utils.rand_name(self.__class__.__name__))
         self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                         self.ports_client.delete_port, body['port']['id'])
         port = body['port']
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index f223fa4..ad316d1 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -123,7 +123,8 @@
         router = self.create_router()
         self.addCleanup(self.delete_router, router)
         port_body = self.ports_client.create_port(
-            network_id=network['id'])
+            network_id=network['id'],
+            name=data_utils.rand_name(self.__class__.__name__))
         # add router interface to port created above
         interface = self.routers_client.add_router_interface(
             router['id'],
@@ -150,6 +151,7 @@
         # Don't know public_network_address, so at first create address
         # from public_network and delete
         port = self.admin_ports_client.create_port(
+            name=data_utils.rand_name(self.__class__.__name__),
             network_id=CONF.network.public_network_id)['port']
         self.admin_ports_client.delete_port(port_id=port['id'])
 
diff --git a/tempest/api/volume/admin/test_user_messages.py b/tempest/api/volume/admin/test_user_messages.py
index 9907497..8048017 100644
--- a/tempest/api/volume/admin/test_user_messages.py
+++ b/tempest/api/volume/admin/test_user_messages.py
@@ -20,18 +20,6 @@
 
 CONF = config.CONF
 
-MESSAGE_KEYS = [
-    'created_at',
-    'event_id',
-    'guaranteed_until',
-    'id',
-    'message_level',
-    'request_id',
-    'resource_type',
-    'resource_uuid',
-    'user_message',
-    'links']
-
 
 class UserMessagesTest(base.BaseVolumeAdminTest):
     _api_version = 3
@@ -66,18 +54,11 @@
         message_id = self._create_user_message()
         self.addCleanup(self.messages_client.delete_message, message_id)
 
-        # show message
-        message = self.messages_client.show_message(message_id)['message']
-        for key in MESSAGE_KEYS:
-            self.assertIn(key, message.keys(), 'Missing expected key %s' % key)
+        # show message, check response schema
+        self.messages_client.show_message(message_id)
 
-        # list messages
-        messages = self.messages_client.list_messages()['messages']
-        self.assertIsInstance(messages, list)
-        for message in messages:
-            for key in MESSAGE_KEYS:
-                self.assertIn(key, message.keys(),
-                              'Missing expected key %s' % key)
+        # list messages, check response schema
+        self.messages_client.list_messages()
 
     @decorators.idempotent_id('c6eb6901-cdcc-490f-b735-4fe251842aed')
     def test_delete_message(self):
diff --git a/tempest/api/volume/admin/test_volume_retype.py b/tempest/api/volume/admin/test_volume_retype.py
index 9136139..18e0b9b 100644
--- a/tempest/api/volume/admin/test_volume_retype.py
+++ b/tempest/api/volume/admin/test_volume_retype.py
@@ -94,7 +94,7 @@
         super(VolumeRetypeTest, cls).skip_checks()
 
         if not CONF.volume_feature_enabled.multi_backend:
-            raise cls.skipException("Cinder multi-backend feature disabled.")
+            raise cls.skipException("Cinder multi-backend feature disabled")
 
         if len(set(CONF.volume.backend_names)) < 2:
             raise cls.skipException("Requires at least two different "
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index d5358ab..2345698 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -17,7 +17,7 @@
 import operator
 import random
 
-from six.moves.urllib import parse
+from six.moves.urllib.parse import urlparse
 from testtools import matchers
 
 from tempest.api.volume import base
@@ -333,7 +333,19 @@
             # If the current iteration is from a 'next' link, check that the
             # absolute url is the same as the one used for this request
             if next:
-                self.assertEqual(next, response.response['content-location'])
+                curr = response.response['content-location']
+                currparsed = urlparse(curr)
+                nextparsed = urlparse(next)
+                # Depending on the environment, certain fields are omitted
+                # from url (ie port). The fields to check are defined here.
+                fieldscheck = ['scheme', 'hostname', 'path', 'query', 'params',
+                               'fragment']
+                for field in fieldscheck:
+                    self.assertEqual(getattr(currparsed, field),
+                                     getattr(nextparsed, field),
+                                     'Incorrect link to next page. URLs do '
+                                     'not match at %s:\n%s\n%s' % (field, curr,
+                                                                   next))
 
             # Get next from response
             next = None
@@ -352,7 +364,7 @@
             # If we can follow to the next page, get params from url to make
             # request in the form of a relative URL
             if next:
-                params = parse.urlparse(next).query
+                params = urlparse(next).query
 
             # If cannot follow make sure it's because we have finished
             else:
diff --git a/tempest/lib/api_schema/response/volume/messages.py b/tempest/lib/api_schema/response/volume/messages.py
new file mode 100644
index 0000000..381f542
--- /dev/null
+++ b/tempest/lib/api_schema/response/volume/messages.py
@@ -0,0 +1,64 @@
+# Copyright 2018 ZTE Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.lib.api_schema.response.compute.v2_1 import parameter_types
+
+delete_message = {
+    'status_code': [204],
+}
+
+common_show_message = {
+    'type': 'object',
+    'properties': {
+        'request_id': {'type': 'string'},
+        'message_level': {'type': 'string'},
+        'links': parameter_types.links,
+        'event_id': {'type': 'string'},
+        'created_at': parameter_types.date_time,
+        'guaranteed_until': parameter_types.date_time,
+        'resource_uuid': {'type': 'string', 'format': 'uuid'},
+        'id': {'type': 'string', 'format': 'uuid'},
+        'resource_type': {'type': 'string'},
+        'user_message': {'type': 'string'}},
+    'additionalProperties': False,
+    'required': ['request_id', 'message_level', 'event_id', 'created_at',
+                 'id', 'user_message'],
+}
+
+show_message = {
+    'status_code': [200],
+    'response_body': {
+        'type': 'object',
+        'properties': {
+            'message': common_show_message
+        },
+        'additionalProperties': False,
+        'required': ['message']
+    }
+}
+
+list_messages = {
+    'status_code': [200],
+    'response_body': {
+        'type': 'object',
+        'properties': {
+            'messages': {
+                'type': 'array',
+                'items': common_show_message
+            },
+        },
+        'additionalProperties': False,
+        'required': ['messages']
+    }
+}
diff --git a/tempest/lib/services/volume/v3/messages_client.py b/tempest/lib/services/volume/v3/messages_client.py
index 47538cd..b770fac 100644
--- a/tempest/lib/services/volume/v3/messages_client.py
+++ b/tempest/lib/services/volume/v3/messages_client.py
@@ -15,6 +15,7 @@
 
 from oslo_serialization import jsonutils as json
 
+from tempest.lib.api_schema.response.volume import messages as schema
 from tempest.lib.common import rest_client
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.volume import base_client
@@ -28,7 +29,7 @@
         url = 'messages/%s' % str(message_id)
         resp, body = self.get(url)
         body = json.loads(body)
-        self.expected_success(200, resp.status)
+        self.validate_response(schema.show_message, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def list_messages(self):
@@ -36,14 +37,14 @@
         url = 'messages'
         resp, body = self.get(url)
         body = json.loads(body)
-        self.expected_success(200, resp.status)
+        self.validate_response(schema.list_messages, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def delete_message(self, message_id):
         """Delete a single message."""
         url = 'messages/%s' % str(message_id)
         resp, body = self.delete(url)
-        self.expected_success(204, resp.status)
+        self.validate_response(schema.delete_message, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def is_resource_deleted(self, id):