summaryrefslogtreecommitdiff
path: root/python/ovs/tests
Commit message (Collapse)AuthorAgeFilesLines
* odp: Add SRv6 tunnel actions.Nobuhiro MIKI2023-03-291-0/+16
| | | | | | | This patch adds ODP actions for SRv6 and its tests. Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Interpret free keys as output in clone.Adrian Moreno2022-12-211-0/+13
| | | | | | | clone-like actions can also output to ports by specifying the port name. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Fix output=CONTROLLER action.Adrian Moreno2022-12-211-1/+9
| | | | | | | | | When CONTROLLER is used as free key, it means output=CONTROLLER which is handled by decode_controller. However, it must output the KV in the right format: "output": {"format": "CONTROLLER"}. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Support case-insensitive OpenFlow actions.Adrian Moreno2022-12-211-0/+15
| | | | | | | | OpenFlow actions names can be capitalized so in order to support this, support case-insensitive KVDecoders and use it in Openflow actions. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Return list of actions for odp action clone.Adrian Moreno2022-12-211-11/+27
| | | | | | | | | | | | | Sometimes we don't want to return the result of a nested key-value decoding as a dictionary but as a list of dictionaries. This happens when we parse actions where keys can be repeated. Refactor code that already takes that into account from ofp_act.py to kv.py and use it for datapath action "clone". Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Acked-by: Mike Pattrick <mkp@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Make key-value matching strict by default.Adrian Moreno2022-12-212-11/+37
| | | | | | | | | | | | | | | | | | | | Currently, if a key is not found in the decoder information, we use the default decoder which typically returns a string. This not only means we can go out of sync with the C code without noticing but it's also error prone as malformed flows could be parsed without warning. Make KeyValue parsing strict, raising an error if a decoder is not found for a key. This behaviour can be turned off globally by running 'KVDecoders.strict = False' but it's generally not recommended. Also, if a KVDecoder does need this default behavior, it can be explicitly configured specifying it's default decoder. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Acked-by: Mike Pattrick <mkp@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Add explicit decoders for all ofp actions.Adrian Moreno2022-12-211-3/+3
| | | | | | | | | | | | | | | We were silently relying on some ofp actions to be decoded by the default decoder which would yield decent string values. In order to be more safe and robust, add an explicit decoder for all missing actions. This patch also reworks the learn action decoding to make it more explicit and verify all the fields specified in the learn action are actually valid fields. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Add unit tests for filtering engine.Adrian Moreno2022-07-151-0/+221
| | | | | | | | Add unit test for OFFilter class. Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Add unit tests to datapath parsing.Adrian Moreno2022-07-151-0/+527
| | | | | | | | Add unit tests to datapath flow parsing. Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Add unit tests for openflow parsing.Adrian Moreno2022-07-152-0/+664
| | | | | | | | Add unit tests for OFPFlow class and ip-port range decoder Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Add unit tests for ListParser.Adrian Moreno2022-07-151-0/+66
| | | | | | | | Add unit tests for ListParser class. Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* python: Introduce unit tests.Adrian Moreno2022-07-151-0/+76
Use pytest to run unit tests as part of the standard testsuite. Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>