From: Ihar Hrachyshka Date: Fri, 7 Aug 2015 11:56:35 +0000 (+0200) Subject: Don't claim Linux Bridge ml2 driver supports bandwidth limit QoS rules X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=29808803dfa7efb17b213cdf5f055aa2f04a17b2;p=openstack-build%2Fneutron-build.git Don't claim Linux Bridge ml2 driver supports bandwidth limit QoS rules Since we don't want rule_types API to misbehave by claiming support for QoS for linuxbridge ml2 driver, let's trade API test for its service correctness. Note that we cannot enforce the supported rule_types for actual CRUD operations because then we would need to disable the whole API test coverage for rules, and we don't want it. This suggests we should get Linux Bridge support in some way or another. Change-Id: I86197d02d0474fd9a55a09efcce6a7380c08c5e0 Partially-Implements: blueprint ml2-qos --- diff --git a/doc/source/devref/quality_of_service.rst b/doc/source/devref/quality_of_service.rst index 448b82d5f..9dd014368 100644 --- a/doc/source/devref/quality_of_service.rst +++ b/doc/source/devref/quality_of_service.rst @@ -45,6 +45,11 @@ list defined on the class. For Ml2 plugin, the list of supported QoS rule types is defined as a common subset of rules supported by all active mechanism drivers. +Note: the list of supported rule types reported by core plugin is not enforced +when accessing QoS rule resources. This is mostly because then we would not be +able to create any rules while at least one ml2 driver in gate lacks support +for QoS (at the moment of writing, linuxbridge is such a driver). + QoS resources ------------- diff --git a/neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py b/neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py index 0269c67d4..f69b5da41 100644 --- a/neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py +++ b/neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py @@ -20,7 +20,6 @@ from neutron.common import constants from neutron.extensions import portbindings from neutron.plugins.common import constants as p_constants from neutron.plugins.ml2.drivers import mech_agent -from neutron.services.qos import qos_consts LOG = log.getLogger(__name__) @@ -35,12 +34,6 @@ class LinuxbridgeMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase): network. """ - # TODO(QoS): really, there is no support for QoS in the driver. Leaving it - # here since API tests are executed against both ovs and lb drivers, and it - # effectively makes ml2 plugin return an empty list for supported rule - # types - supported_qos_rule_types = [qos_consts.RULE_TYPE_BANDWIDTH_LIMIT] - def __init__(self): sg_enabled = securitygroups_rpc.is_firewall_enabled() super(LinuxbridgeMechanismDriver, self).__init__( diff --git a/neutron/services/qos/qos_plugin.py b/neutron/services/qos/qos_plugin.py index c11c5e9c5..9073d712b 100644 --- a/neutron/services/qos/qos_plugin.py +++ b/neutron/services/qos/qos_plugin.py @@ -140,6 +140,7 @@ class QoSPlugin(qos.QoSPluginBase): self._get_policy_obj(context, policy_id) return rule_object.QosBandwidthLimitRule.get_objects(context) + # TODO(QoS): enforce rule types when accessing rule objects @db_base_plugin_common.filter_fields @db_base_plugin_common.convert_result_to_dict def get_rule_types(self, context, filters=None, fields=None, diff --git a/neutron/tests/api/test_qos.py b/neutron/tests/api/test_qos.py index 453b85387..e40e7ed24 100644 --- a/neutron/tests/api/test_qos.py +++ b/neutron/tests/api/test_qos.py @@ -83,7 +83,16 @@ class QosTestJSON(base.BaseAdminNetworkTest): @test.idempotent_id('cf776f77-8d3d-49f2-8572-12d6a1557224') def test_list_rule_types(self): # List supported rule types - expected_rule_types = qos_consts.VALID_RULE_TYPES + # TODO(QoS): since in gate we run both ovs and linuxbridge ml2 drivers, + # and since Linux Bridge ml2 driver does not have QoS support yet, ml2 + # plugin reports no rule types are supported. Once linuxbridge will + # receive support for QoS, the list of expected rule types will change. + # + # In theory, we could make the test conditional on which ml2 drivers + # are enabled in gate (or more specifically, on which supported qos + # rules are claimed by core plugin), but that option doesn't seem to be + # available thru tempest_lib framework + expected_rule_types = [] expected_rule_details = ['type'] rule_types = self.admin_client.list_qos_rule_types()