diff --git a/releasenotes/notes/QoS-client-for-placement-based-minimum-bw-allocation-8e5854d5754cec68.yaml b/releasenotes/notes/QoS-client-for-placement-based-minimum-bw-allocation-8e5854d5754cec68.yaml
new file mode 100644
index 0000000..b66ea3a
--- /dev/null
+++ b/releasenotes/notes/QoS-client-for-placement-based-minimum-bw-allocation-8e5854d5754cec68.yaml
@@ -0,0 +1,25 @@
+---
+features:
+  - |
+    Add ``qos-policies`` and ``qos-minimum-bandwidth-rule`` clients
+    to Tempest to make possible the testing of the placement based
+    bandwidth allocation feature.
+    The following API calls are available for tempest from now:
+
+    ``QoS policies`` client:
+
+    * GET /qos/policies
+    * POST /qos/policies
+    * GET /qos/policies/{policy_id}
+    * PUT /qos/policies/{policy_id}
+    * DELETE /qos/policies/{policy_id}
+
+
+    ``QoS minimum bandwidth rules`` client:
+
+    * GET qos/policies/{policy_id}/minimum_bandwidth_rules
+    * POST /qos/policies/{policy_id}/minimum_bandwidth_rules
+    * GET qos/policies/{policy_id}/minimum_bandwidth_rules/{rule_id}
+    * PUT qos/policies/{policy_id}/minimum_bandwidth_rules/{rule_id}
+    * DELETE /qos/policies/{policy_id}/minimum_bandwidth_rules/{rule_id}
+
diff --git a/tempest/clients.py b/tempest/clients.py
index 0506646..f7a83be 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -69,6 +69,8 @@
         self.network_versions_client = self.network.NetworkVersionsClient()
         self.service_providers_client = self.network.ServiceProvidersClient()
         self.tags_client = self.network.TagsClient()
+        self.qos_client = self.network.QosClient()
+        self.qos_min_bw_client = self.network.QosMinimumBandwidthRulesClient()
 
     def _set_image_clients(self):
         if CONF.service_available.glance:
diff --git a/tempest/lib/services/network/__init__.py b/tempest/lib/services/network/__init__.py
index 419e593..69f178e 100644
--- a/tempest/lib/services/network/__init__.py
+++ b/tempest/lib/services/network/__init__.py
@@ -21,6 +21,9 @@
     MeteringLabelsClient
 from tempest.lib.services.network.networks_client import NetworksClient
 from tempest.lib.services.network.ports_client import PortsClient
+from tempest.lib.services.network.qos_client import QosClient
+from tempest.lib.services.network.qos_minimum_bandwidth_rules_client import \
+    QosMinimumBandwidthRulesClient
 from tempest.lib.services.network.quotas_client import QuotasClient
 from tempest.lib.services.network.routers_client import RoutersClient
 from tempest.lib.services.network.security_group_rules_client import \
@@ -37,6 +40,7 @@
 __all__ = ['AgentsClient', 'ExtensionsClient', 'FloatingIPsClient',
            'MeteringLabelRulesClient', 'MeteringLabelsClient',
            'NetworksClient', 'NetworkVersionsClient', 'PortsClient',
-           'QuotasClient', 'RoutersClient', 'SecurityGroupRulesClient',
-           'SecurityGroupsClient', 'ServiceProvidersClient',
-           'SubnetpoolsClient', 'SubnetsClient', 'TagsClient']
+           'QosClient', 'QosMinimumBandwidthRulesClient', 'QuotasClient',
+           'RoutersClient', 'SecurityGroupRulesClient', 'SecurityGroupsClient',
+           'ServiceProvidersClient', 'SubnetpoolsClient', 'SubnetsClient',
+           'TagsClient']
diff --git a/tempest/lib/services/network/qos_client.py b/tempest/lib/services/network/qos_client.py
new file mode 100644
index 0000000..bcd1066
--- /dev/null
+++ b/tempest/lib/services/network/qos_client.py
@@ -0,0 +1,70 @@
+# Copyright (c) 2019 Ericsson
+#
+#    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.services.network import base
+
+
+class QosClient(base.BaseNetworkClient):
+
+    def create_qos_policy(self, **kwargs):
+        """Creates a QoS policy.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#create-qos-policy
+        """
+        uri = '/qos/policies'
+        post_data = {'policy': kwargs}
+        return self.create_resource(uri, post_data)
+
+    def update_qos_policy(self, qos_policy_id, **kwargs):
+        """Updates a QoS policy.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#update-qos-policy
+        """
+        uri = '/qos/policies/%s' % qos_policy_id
+        post_data = {'policy': kwargs}
+        return self.update_resource(uri, post_data)
+
+    def show_qos_policy(self, qos_policy_id, **fields):
+        """Show details of a QoS policy.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#show-qos-policy-details
+        """
+        uri = '/qos/policies/%s' % qos_policy_id
+        return self.show_resource(uri, **fields)
+
+    def delete_qos_policy(self, qos_policy_id):
+        """Deletes a QoS policy.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#delete-qos-policy
+        """
+        uri = '/qos/policies/%s' % qos_policy_id
+        return self.delete_resource(uri)
+
+    def list_qos_policies(self, **filters):
+        """Lists QoS policies.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#list-qos-policies
+        """
+        uri = '/qos/policies'
+        return self.list_resources(uri, **filters)
diff --git a/tempest/lib/services/network/qos_minimum_bandwidth_rules_client.py b/tempest/lib/services/network/qos_minimum_bandwidth_rules_client.py
new file mode 100644
index 0000000..4f4ee3f
--- /dev/null
+++ b/tempest/lib/services/network/qos_minimum_bandwidth_rules_client.py
@@ -0,0 +1,73 @@
+# Copyright (c) 2019 Ericsson
+#
+#    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.services.network import base
+
+
+class QosMinimumBandwidthRulesClient(base.BaseNetworkClient):
+
+    def create_minimum_bandwidth_rule(self, qos_policy_id, **kwargs):
+        """Creates a minimum bandwidth rule for a QoS policy.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#create-minimum-bandwidth-rule
+        """
+        uri = '/qos/policies/%s/minimum_bandwidth_rules' % qos_policy_id
+        post_data = {'minimum_bandwidth_rule': kwargs}
+        return self.create_resource(uri, post_data)
+
+    def update_minimum_bandwidth_rule(self, qos_policy_id, rule_id, **kwargs):
+        """Updates a minimum bandwidth rule.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#update-minimum-bandwidth-rule
+        """
+        uri = '/qos/policies/%s/minimum_bandwidth_rules/%s' % (
+            qos_policy_id, rule_id)
+        post_data = {'minimum_bandwidth_rule': kwargs}
+        return self.update_resource(uri, post_data)
+
+    def show_minimum_bandwidth_rule(self, qos_policy_id, rule_id, **fields):
+        """Show details of a minimum bandwidth rule.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#show-minimum-bandwidth-rule-details
+        """
+        uri = '/qos/policies/%s/minimum_bandwidth_rules/%s' % (
+            qos_policy_id, rule_id)
+        return self.show_resource(uri, **fields)
+
+    def delete_minimum_bandwidth_rule(self, qos_policy_id, rule_id):
+        """Deletes a minimum bandwidth rule for a QoS policy.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#delete-minimum-bandwidth-rule
+        """
+        uri = '/qos/policies/%s/minimum_bandwidth_rules/%s' % (
+            qos_policy_id, rule_id)
+        return self.delete_resource(uri)
+
+    def list_minimum_bandwidth_rules(self, qos_policy_id, **filters):
+        """Lists all minimum bandwidth rules for a QoS policy.
+
+        For full list of available parameters, please refer to the official
+        API reference:
+        https://developer.openstack.org/api-ref/network/v2/index.html#list-minimum-bandwidth-rules-for-qos-policy
+        """
+        uri = '/qos/policies/%s/minimum_bandwidth_rules' % qos_policy_id
+        return self.list_resources(uri, **filters)
diff --git a/tempest/tests/lib/services/network/test_qos_client.py b/tempest/tests/lib/services/network/test_qos_client.py
new file mode 100644
index 0000000..b04b847
--- /dev/null
+++ b/tempest/tests/lib/services/network/test_qos_client.py
@@ -0,0 +1,139 @@
+# Copyright (c) 2019 Ericsson
+#
+#    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.
+
+import copy
+
+from tempest.lib.services.network import qos_client
+from tempest.tests.lib import fake_auth_provider
+from tempest.tests.lib.services import base
+
+
+class TestQosClient(base.BaseServiceTest):
+
+    FAKE_QOS_POLICY_ID = "f1011b08-1297-11e9-a1e7-c7e6825a2616"
+
+    FAKE_QOS_POLICY_REQUEST = {
+        'name': 'foo',
+        'shared': True
+    }
+
+    FAKE_QOS_POLICY_RESPONSE = {
+        'policy': {
+            "name": "10Mbit",
+            "description": "This policy limits the ports to 10Mbit max.",
+            "rules": [],
+            "id": FAKE_QOS_POLICY_ID,
+            "is_default": False,
+            "project_id": "8d4c70a21fed4aeba121a1a429ba0d04",
+            "revision_number": 1,
+            "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04",
+            "created_at": "2018-04-03T21:26:39Z",
+            "updated_at": "2018-04-03T21:26:39Z",
+            "shared": False,
+            "tags": ["tag1,tag2"]
+        }
+    }
+
+    FAKE_QOS_POLICIES = {
+        'policies': [
+            FAKE_QOS_POLICY_RESPONSE['policy']
+        ]
+    }
+
+    def setUp(self):
+        super(TestQosClient, self).setUp()
+        fake_auth = fake_auth_provider.FakeAuthProvider()
+        self.qos_client = qos_client.QosClient(
+            fake_auth, "network", "regionOne")
+
+    def _test_create_qos_policy(self, bytes_body=False):
+        self.check_service_client_function(
+            self.qos_client.create_qos_policy,
+            "tempest.lib.common.rest_client.RestClient.post",
+            self.FAKE_QOS_POLICY_RESPONSE,
+            bytes_body,
+            201,
+            **self.FAKE_QOS_POLICY_REQUEST)
+
+    def _test_list_qos_policies(self, bytes_body=False):
+        self.check_service_client_function(
+            self.qos_client.list_qos_policies,
+            "tempest.lib.common.rest_client.RestClient.get",
+            self.FAKE_QOS_POLICIES,
+            bytes_body,
+            200)
+
+    def _test_show_qos_policy(self, bytes_body=False):
+        self.check_service_client_function(
+            self.qos_client.show_qos_policy,
+            "tempest.lib.common.rest_client.RestClient.get",
+            self.FAKE_QOS_POLICY_RESPONSE,
+            bytes_body,
+            200,
+            qos_policy_id=self.FAKE_QOS_POLICY_ID)
+
+    def _test_update_qos_polcy(self, bytes_body=False):
+        update_kwargs = {
+            "name": "100Mbit",
+            "description": "This policy limits the ports to 100Mbit max.",
+            "shared": True
+        }
+
+        resp_body = {
+            "policy": copy.deepcopy(
+                self.FAKE_QOS_POLICY_RESPONSE['policy']
+            )
+        }
+        resp_body["policy"].update(update_kwargs)
+
+        self.check_service_client_function(
+            self.qos_client.update_qos_policy,
+            "tempest.lib.common.rest_client.RestClient.put",
+            resp_body,
+            bytes_body,
+            200,
+            qos_policy_id=self.FAKE_QOS_POLICY_ID,
+            **update_kwargs)
+
+    def test_create_qos_policy_with_str_body(self):
+        self._test_create_qos_policy()
+
+    def test_create_qos_policy_with_bytes_body(self):
+        self._test_create_qos_policy(bytes_body=True)
+
+    def test_update_qos_policy_with_str_body(self):
+        self._test_update_qos_polcy()
+
+    def test_update_qos_policy_with_bytes_body(self):
+        self._test_update_qos_polcy(bytes_body=True)
+
+    def test_show_qos_policy_with_str_body(self):
+        self._test_show_qos_policy()
+
+    def test_show_qos_policy_with_bytes_body(self):
+        self._test_show_qos_policy(bytes_body=True)
+
+    def test_delete_qos_policy(self):
+        self.check_service_client_function(
+            self.qos_client.delete_qos_policy,
+            "tempest.lib.common.rest_client.RestClient.delete",
+            {},
+            status=204,
+            qos_policy_id=self.FAKE_QOS_POLICY_ID)
+
+    def test_list_qos_policies_with_str_body(self):
+        self._test_list_qos_policies()
+
+    def test_list_qos_policies_with_bytes_body(self):
+        self._test_list_qos_policies(bytes_body=True)
diff --git a/tempest/tests/lib/services/network/test_qos_minimum_bandwidth_rules_client.py b/tempest/tests/lib/services/network/test_qos_minimum_bandwidth_rules_client.py
new file mode 100644
index 0000000..8234dda
--- /dev/null
+++ b/tempest/tests/lib/services/network/test_qos_minimum_bandwidth_rules_client.py
@@ -0,0 +1,137 @@
+# Copyright (c) 2019 Ericsson
+#
+#    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.
+
+import copy
+
+from tempest.lib.services.network import qos_minimum_bandwidth_rules_client
+from tempest.tests.lib import fake_auth_provider
+from tempest.tests.lib.services import base
+
+
+class TestQosMinimumBandwidthRulesClient(base.BaseServiceTest):
+
+    FAKE_QOS_POLICY_ID = "f1011b08-1297-11e9-a1e7-c7e6825a2616"
+    FAKE_MIN_BW_RULE_ID = "e758c89e-1297-11e9-a6cf-cf46a71e6699"
+
+    FAKE_MIN_BW_RULE_REQUEST = {
+        'qos_policy_id': FAKE_QOS_POLICY_ID,
+        'min_kbps': 1000,
+        'direction': 'ingress'
+    }
+
+    FAKE_MIN_BW_RULE_RESPONSE = {
+        'minimum_bandwidth_rule': {
+            'id': FAKE_MIN_BW_RULE_ID,
+            'min_kbps': 10000,
+            'direction': 'egress'
+        }
+    }
+
+    FAKE_MIN_BW_RULES = {
+        'bandwidth_limit_rules': [
+            FAKE_MIN_BW_RULE_RESPONSE['minimum_bandwidth_rule']
+        ]
+    }
+
+    def setUp(self):
+        super(TestQosMinimumBandwidthRulesClient, self).setUp()
+        fake_auth = fake_auth_provider.FakeAuthProvider()
+        self.qos_min_bw_client = qos_minimum_bandwidth_rules_client.\
+            QosMinimumBandwidthRulesClient(fake_auth, "network", "regionOne")
+
+    def _test_create_minimum_bandwidth_rule(self, bytes_body=False):
+        self.check_service_client_function(
+            self.qos_min_bw_client.create_minimum_bandwidth_rule,
+            "tempest.lib.common.rest_client.RestClient.post",
+            self.FAKE_MIN_BW_RULE_RESPONSE,
+            bytes_body,
+            201,
+            **self.FAKE_MIN_BW_RULE_REQUEST
+        )
+
+    def _test_list_minimum_bandwidth_rules(self, bytes_body=False):
+        self.check_service_client_function(
+            self.qos_min_bw_client.list_minimum_bandwidth_rules,
+            "tempest.lib.common.rest_client.RestClient.get",
+            self.FAKE_MIN_BW_RULES,
+            bytes_body,
+            200,
+            qos_policy_id=self.FAKE_QOS_POLICY_ID
+        )
+
+    def _test_show_minimum_bandwidth_rule(self, bytes_body=False):
+        self.check_service_client_function(
+            self.qos_min_bw_client.show_minimum_bandwidth_rule,
+            "tempest.lib.common.rest_client.RestClient.get",
+            self.FAKE_MIN_BW_RULE_RESPONSE,
+            bytes_body,
+            200,
+            qos_policy_id=self.FAKE_QOS_POLICY_ID,
+            rule_id=self.FAKE_MIN_BW_RULE_ID
+        )
+
+    def _test_update_qos_polcy(self, bytes_body=False):
+        update_kwargs = {
+            "min_kbps": "20000"
+        }
+
+        resp_body = {
+            "minimum_bandwidth_rule": copy.deepcopy(
+                self.FAKE_MIN_BW_RULE_RESPONSE['minimum_bandwidth_rule']
+            )
+        }
+        resp_body["minimum_bandwidth_rule"].update(update_kwargs)
+
+        self.check_service_client_function(
+            self.qos_min_bw_client.update_minimum_bandwidth_rule,
+            "tempest.lib.common.rest_client.RestClient.put",
+            resp_body,
+            bytes_body,
+            200,
+            qos_policy_id=self.FAKE_QOS_POLICY_ID,
+            rule_id=self.FAKE_MIN_BW_RULE_ID,
+            **update_kwargs)
+
+    def test_create_minimum_bandwidth_rule_with_str_body(self):
+        self._test_create_minimum_bandwidth_rule()
+
+    def test_create_minimum_bandwidth_rule_with_bytes_body(self):
+        self._test_create_minimum_bandwidth_rule(bytes_body=True)
+
+    def test_update_minimum_bandwidth_rule_with_str_body(self):
+        self._test_update_qos_polcy()
+
+    def test_update_minimum_bandwidth_rule_with_bytes_body(self):
+        self._test_update_qos_polcy(bytes_body=True)
+
+    def test_show_minimum_bandwidth_rule_with_str_body(self):
+        self._test_show_minimum_bandwidth_rule()
+
+    def test_show_minimum_bandwidth_rule_with_bytes_body(self):
+        self._test_show_minimum_bandwidth_rule(bytes_body=True)
+
+    def test_delete_minimum_bandwidth_rule(self):
+        self.check_service_client_function(
+            self.qos_min_bw_client.delete_minimum_bandwidth_rule,
+            "tempest.lib.common.rest_client.RestClient.delete",
+            {},
+            status=204,
+            qos_policy_id=self.FAKE_QOS_POLICY_ID,
+            rule_id=self.FAKE_MIN_BW_RULE_ID)
+
+    def test_list_minimum_bandwidth_rule_with_str_body(self):
+        self._test_list_minimum_bandwidth_rules()
+
+    def test_list_minimum_bandwidth_rule_with_bytes_body(self):
+        self._test_list_minimum_bandwidth_rules(bytes_body=True)
