diff mbox series

[ovs-dev,v3,8/8] python: ovs: flow: Add meter_id to controller.

Message ID 20240105114702.443465-9-amorenoz@redhat.com
State Changes Requested
Delegated to: Simon Horman
Headers show
Series python: Miscelaneous flow parsing fixes. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Adrian Moreno Jan. 5, 2024, 11:47 a.m. UTC
Add missing option to controller action.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
---
 python/ovs/flow/ofp_act.py   |  1 +
 python/ovs/tests/test_ofp.py | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

Comments

Simon Horman Jan. 5, 2024, 3:25 p.m. UTC | #1
On Fri, Jan 05, 2024 at 12:47:00PM +0100, Adrian Moreno wrote:
> Add missing option to controller action.
> 
> Signed-off-by: Adrian Moreno <amorenoz@redhat.com>

Acked-by: Simon Horman <horms@ovn.org>
diff mbox series

Patch

diff --git a/python/ovs/flow/ofp_act.py b/python/ovs/flow/ofp_act.py
index c540443ea..2c85076a3 100644
--- a/python/ovs/flow/ofp_act.py
+++ b/python/ovs/flow/ofp_act.py
@@ -54,6 +54,7 @@  def decode_controller(value):
                     "id": decode_int,
                     "userdata": decode_default,
                     "pause": decode_flag,
+                    "meter_id": decode_int,
                 }
             )
         )(value)
diff --git a/python/ovs/tests/test_ofp.py b/python/ovs/tests/test_ofp.py
index 4bcbf9cdf..59eab8c3a 100644
--- a/python/ovs/tests/test_ofp.py
+++ b/python/ovs/tests/test_ofp.py
@@ -50,6 +50,21 @@  def do_test_section(input_string, section, expected):
                 KeyValue("controller", {"max_len": 200}),
             ],
         ),
+        (
+            "actions=controller(max_len=123,reason=no_match,id=456,userdata=00.00.00.12.00.00.00.00,meter_id=12)",   # noqa: E501
+            [
+                KeyValue(
+                    "controller",
+                    {
+                        "max_len": 123,
+                        "reason": "no_match",
+                        "id": 456,
+                        "userdata": "00.00.00.12.00.00.00.00",
+                        "meter_id": 12,
+                    }
+                ),
+            ],
+        ),
         (
             "actions=enqueue(foo,42),enqueue:foo:42,enqueue(bar,4242)",
             [