diff mbox series

[ovs-dev,v4,7/8] python: ovs: flow: Make check_pkt_len action a list.

Message ID 20240117111902.1607239-8-amorenoz@redhat.com
State Accepted
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
ovsrobot/intel-ovs-compilation fail test: fail

Commit Message

Adrian Moreno Jan. 17, 2024, 11:18 a.m. UTC
In general, most actions must be lists since the keys can be repeated.

Acked-by: Simon Horman <horms@ovn.org>
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
---
 python/ovs/flow/odp.py       |  6 ++++--
 python/ovs/tests/test_odp.py | 12 ++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/python/ovs/flow/odp.py b/python/ovs/flow/odp.py
index 46697a1bc..7d9b165d4 100644
--- a/python/ovs/flow/odp.py
+++ b/python/ovs/flow/odp.py
@@ -375,13 +375,15 @@  class ODPFlow(Flow):
                             KVDecoders(
                                 decoders=_decoders,
                                 default_free=decode_free_output,
-                            )
+                            ),
+                            is_list=True,
                         ),
                         "le": nested_kv_decoder(
                             KVDecoders(
                                 decoders=_decoders,
                                 default_free=decode_free_output,
-                            )
+                            ),
+                            is_list=True,
                         ),
                     }
                 )
diff --git a/python/ovs/tests/test_odp.py b/python/ovs/tests/test_odp.py
index 401e16b7a..f19ec386e 100644
--- a/python/ovs/tests/test_odp.py
+++ b/python/ovs/tests/test_odp.py
@@ -519,24 +519,24 @@  def test_odp_fields(input_string, expected):
                     "check_pkt_len",
                     {
                         "size": 200,
-                        "gt": {"output": {"port": 4}},
-                        "le": {"output": {"port": 5}},
+                        "gt": [{"output": {"port": 4}}],
+                        "le": [{"output": {"port": 5}}],
                     },
                 ),
                 KeyValue(
                     "check_pkt_len",
                     {
                         "size": 200,
-                        "gt": {"drop": True},
-                        "le": {"output": {"port": 5}},
+                        "gt": [{"drop": True}],
+                        "le": [{"output": {"port": 5}}],
                     },
                 ),
                 KeyValue(
                     "check_pkt_len",
                     {
                         "size": 200,
-                        "gt": {"ct": {"nat": True}},
-                        "le": {"drop": True},
+                        "gt": [{"ct": {"nat": True}}],
+                        "le": [{"drop": True}],
                     },
                 ),
             ],