QoS DSCP use mod_flow instead of mod_flows

In the implementation of DSCP QoS rule, the QosOVSAgentDriver uses the
wrong method to modify br-int flows. It uses br_int.mod_flows() whilst
it should use br_int.mod_flow().

This patch fixes this and also adds verification of the updates of DSCP,
as we have for bandwidth here to trigger that code path and avoid
regressions.

Change-Id: I685ac373701ff8407fd7fbf649e17a2f7dfc0008
Closes-Bug: #1564820
This commit is contained in:
Nate Johnston 2016-04-01 15:53:20 -04:00
parent 45d1324146
commit 6b6c0421bb
2 changed files with 7 additions and 2 deletions

View File

@ -86,8 +86,8 @@ class QosOVSAgentDriver(qos.QosAgentDriver):
actions = "mod_nw_tos:" + mark + ","
actions += ','.join([act for act in acts
if "mod_nw_tos:" not in act])
self.br_int.mod_flows(reg2=0, in_port=port, table=0,
actions=actions)
self.br_int.mod_flow(reg2=0, in_port=port, table=0,
actions=actions)
def delete_dscp_marking(self, port):
port_name = port['vif_port'].port_name

View File

@ -223,14 +223,19 @@ class TestOVSAgentQosExtension(OVSAgentQoSExtensionTestFramework):
port_dicts=self.create_test_ports(amount=1,
policy_id=TEST_POLICY_ID1))
self.wait_until_ports_state(self.ports, up=True)
self._assert_dscp_marking_rule_is_set(self.ports[0],
TEST_DSCP_MARKING_RULE_1)
policy_copy = copy.deepcopy(self.qos_policies[TEST_POLICY_ID1])
policy_copy.rules[0].max_kbps = 500
policy_copy.rules[0].max_burst_kbps = 5
policy_copy.rules[1].dscp_mark = TEST_DSCP_MARK_2
consumer_reg.push(resources.QOS_POLICY, policy_copy, events.UPDATED)
self.wait_until_bandwidth_limit_rule_applied(self.ports[0],
policy_copy.rules[0])
self._assert_bandwidth_limit_rule_is_set(self.ports[0],
policy_copy.rules[0])
self._assert_dscp_marking_rule_is_set(self.ports[0],
TEST_DSCP_MARKING_RULE_2)
def test_port_qos_disassociation(self):
"""Test that qos_policy_id set to None will remove all qos rules from