]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Don't claim Linux Bridge ml2 driver supports bandwidth limit QoS rules
authorIhar Hrachyshka <ihrachys@redhat.com>
Fri, 7 Aug 2015 11:56:35 +0000 (13:56 +0200)
committerIhar Hrachyshka <ihrachys@redhat.com>
Fri, 7 Aug 2015 12:06:33 +0000 (14:06 +0200)
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

doc/source/devref/quality_of_service.rst
neutron/plugins/ml2/drivers/linuxbridge/mech_driver/mech_linuxbridge.py
neutron/services/qos/qos_plugin.py
neutron/tests/api/test_qos.py

index 448b82d5f122ab0108edaaf20a4730a26663f9c4..9dd014368a5e8ff3c5a874a9438fd2263a96f135 100644 (file)
@@ -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
 -------------
index 0269c67d42d70baa95768d05ea04b6ea566908b6..f69b5da4160061255c12fa90588fb21524407720 100644 (file)
@@ -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__(
index c11c5e9c56ef48a4c0a9fe85130b086f4e176d5e..9073d712bc9121ce51857f8ea40d8df2deb5da15 100644 (file)
@@ -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,
index 453b85387ff7f242a66491957464aa0d26a9a939..e40e7ed2485dc9ba7755b6438110b1427469f8c5 100644 (file)
@@ -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()