diff --git a/REVIEWING.rst b/REVIEWING.rst
index 8a1e152..bf63ed2 100644
--- a/REVIEWING.rst
+++ b/REVIEWING.rst
@@ -36,8 +36,11 @@
 For any change that adds new functionality to either common functionality or an
 out-of-band tool unit tests are required. This is to ensure we don't introduce
 future regressions and to test conditions which we may not hit in the gate runs.
-Tests, and service clients aren't required to have unit tests since they should
-be self verifying by running them in the gate.
+API and scenario tests aren't required to have unit tests since they should
+be self-verifying by running them in the gate. All service clients, on the
+other hand, `must have`_ unit tests, as they belong to ``tempest/lib``.
+
+.. _must have: https://docs.openstack.org/tempest/latest/library.html#testing
 
 
 API Stability
diff --git a/tempest/cmd/account_generator.py b/tempest/cmd/account_generator.py
index 9be8ee2..e41aa86 100755
--- a/tempest/cmd/account_generator.py
+++ b/tempest/cmd/account_generator.py
@@ -195,7 +195,6 @@
 
         if test_resource.network:
             account['resources'] = {}
-        if test_resource.network:
             account['resources']['network'] = test_resource.network['name']
         accounts.append(account)
     if os.path.exists(account_file):
diff --git a/tempest/lib/api_schema/response/volume/qos.py b/tempest/lib/api_schema/response/volume/qos.py
new file mode 100644
index 0000000..d1b3910
--- /dev/null
+++ b/tempest/lib/api_schema/response/volume/qos.py
@@ -0,0 +1,123 @@
+# 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.
+
+show_qos = {
+    'status_code': [200],
+    'response_body': {
+        'type': 'object',
+        'properties': {
+            'qos_specs': {
+                'type': 'object',
+                'properties': {
+                    'name': {'type': 'string'},
+                    'id': {'type': 'string', 'format': 'uuid'},
+                    'consumer': {'type': 'string'},
+                    'specs': {'type': ['object', 'null']},
+                },
+                'additionalProperties': False,
+                'required': ['name', 'id', 'specs']
+            },
+            'links': {
+                'type': 'array',
+                'items': {
+                    'type': 'object',
+                    'properties': {
+                        'href': {'type': 'string',
+                                 'format': 'uri'},
+                        'rel': {'type': 'string'},
+                    },
+                    'additionalProperties': False,
+                    'required': ['href', 'rel']
+                }
+            }
+        },
+        'additionalProperties': False,
+        'required': ['qos_specs', 'links']
+    }
+}
+
+delete_qos = {'status_code': [202]}
+
+list_qos = {
+    'status_code': [200],
+    'response_body': {
+        'type': 'object',
+        'properties': {
+            'qos_specs': {
+                'type': 'array',
+                'items': {
+                    'type': 'object',
+                    'properties': {
+                        'specs': {
+                            'type': 'object',
+                            'patternProperties': {'^.+$': {'type': 'string'}}
+                        },
+                        'consumer': {'type': 'string'},
+                        'id': {'type': 'string', 'format': 'uuid'},
+                        'name': {'type': 'string'}
+                    },
+                    'additionalProperties': False,
+                    'required': ['specs', 'id', 'name']
+                }
+            }
+        },
+        'additionalProperties': False,
+        'required': ['qos_specs']
+    }
+}
+
+set_qos_key = {
+    'status_code': [200],
+    'response_body': {
+        'type': 'object',
+        'properties': {
+            'qos_specs': {
+                'type': 'object',
+                'patternProperties': {'^.+$': {'type': 'string'}}
+            },
+        },
+        'additionalProperties': False,
+        'required': ['qos_specs']
+    }
+}
+
+unset_qos_key = {'status_code': [202]}
+associate_qos = {'status_code': [202]}
+
+show_association_qos = {
+    'status_code': [200],
+    'response_body': {
+        'type': 'object',
+        'properties': {
+            'qos_associations': {
+                'type': 'array',
+                'items': {
+                    'type': 'object',
+                    'properties': {
+                        'association_type': {'type': 'string'},
+                        'id': {'type': 'string', 'format': 'uuid'},
+                        'name': {'type': 'string'}
+                    },
+                    'additionalProperties': False,
+                    'required': ['association_type', 'id', 'name']
+                }
+            },
+        },
+        'additionalProperties': False,
+        'required': ['qos_associations']
+    }
+}
+
+disassociate_qos = {'status_code': [202]}
+disassociate_all_qos = {'status_code': [202]}
diff --git a/tempest/lib/services/volume/v3/qos_client.py b/tempest/lib/services/volume/v3/qos_client.py
index 8f4d37f..5205590 100644
--- a/tempest/lib/services/volume/v3/qos_client.py
+++ b/tempest/lib/services/volume/v3/qos_client.py
@@ -14,6 +14,7 @@
 
 from oslo_serialization import jsonutils as json
 
+from tempest.lib.api_schema.response.volume import qos as schema
 from tempest.lib.common import rest_client
 from tempest.lib import exceptions as lib_exc
 
@@ -45,15 +46,15 @@
         """
         post_body = json.dumps({'qos_specs': kwargs})
         resp, body = self.post('qos-specs', post_body)
-        self.expected_success(200, resp.status)
         body = json.loads(body)
+        self.validate_response(schema.show_qos, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def delete_qos(self, qos_id, force=False):
         """Delete the specified QoS specification."""
         resp, body = self.delete(
             "qos-specs/%s?force=%s" % (qos_id, force))
-        self.expected_success(202, resp.status)
+        self.validate_response(schema.delete_qos, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def list_qos(self):
@@ -61,7 +62,7 @@
         url = 'qos-specs'
         resp, body = self.get(url)
         body = json.loads(body)
-        self.expected_success(200, resp.status)
+        self.validate_response(schema.list_qos, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def show_qos(self, qos_id):
@@ -69,7 +70,7 @@
         url = "qos-specs/%s" % qos_id
         resp, body = self.get(url)
         body = json.loads(body)
-        self.expected_success(200, resp.status)
+        self.validate_response(schema.show_qos, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def set_qos_key(self, qos_id, **kwargs):
@@ -82,7 +83,7 @@
         put_body = json.dumps({"qos_specs": kwargs})
         resp, body = self.put('qos-specs/%s' % qos_id, put_body)
         body = json.loads(body)
-        self.expected_success(200, resp.status)
+        self.validate_response(schema.set_qos_key, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def unset_qos_key(self, qos_id, keys):
@@ -96,7 +97,7 @@
         """
         put_body = json.dumps({'keys': keys})
         resp, body = self.put('qos-specs/%s/delete_keys' % qos_id, put_body)
-        self.expected_success(202, resp.status)
+        self.validate_response(schema.unset_qos_key, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def associate_qos(self, qos_id, vol_type_id):
@@ -104,7 +105,7 @@
         url = "qos-specs/%s/associate" % qos_id
         url += "?vol_type_id=%s" % vol_type_id
         resp, body = self.get(url)
-        self.expected_success(202, resp.status)
+        self.validate_response(schema.associate_qos, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def show_association_qos(self, qos_id):
@@ -112,7 +113,7 @@
         url = "qos-specs/%s/associations" % qos_id
         resp, body = self.get(url)
         body = json.loads(body)
-        self.expected_success(200, resp.status)
+        self.validate_response(schema.show_association_qos, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def disassociate_qos(self, qos_id, vol_type_id):
@@ -120,12 +121,12 @@
         url = "qos-specs/%s/disassociate" % qos_id
         url += "?vol_type_id=%s" % vol_type_id
         resp, body = self.get(url)
-        self.expected_success(202, resp.status)
+        self.validate_response(schema.disassociate_qos, resp, body)
         return rest_client.ResponseBody(resp, body)
 
     def disassociate_all_qos(self, qos_id):
         """Disassociate the specified QoS with all associations."""
         url = "qos-specs/%s/disassociate_all" % qos_id
         resp, body = self.get(url)
-        self.expected_success(202, resp.status)
+        self.validate_response(schema.disassociate_all_qos, resp, body)
         return rest_client.ResponseBody(resp, body)
