diff options
author | Adrian Moreno <amorenoz@redhat.com> | 2024-07-04 10:57:00 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-07-05 17:45:48 -0700 |
commit | b192bf12dbb015d37bb904d61751cad431ceb578 (patch) | |
tree | 2b2666b5836952cdbc72924f41404a8171c02748 /tools | |
parent | c7815abbea457afa2a1ab3ded46d29c19da377d2 (diff) |
selftests: openvswitch: parse trunc action
The trunc action was supported decode-able but not parse-able. Add
support for parsing the action string.
Reviewed-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Link: https://patch.msgid.link/20240704085710.353845-10-amorenoz@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/net/openvswitch/ovs-dpctl.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py index 4ccf26f96327..e8dc9af10d4d 100644 --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py @@ -863,6 +863,19 @@ class ovsactions(nla): self["attrs"].append(["OVS_ACTION_ATTR_USERSPACE", uact]) parsed = True + elif parse_starts_block(actstr, "trunc(", False): + parencount += 1 + actstr, val = parse_extract_field( + actstr, + "trunc(", + r"([0-9]+)", + int, + False, + None, + ) + self["attrs"].append(["OVS_ACTION_ATTR_TRUNC", val]) + parsed = True + actstr = actstr[strspn(actstr, ", ") :] while parencount > 0: parencount -= 1 |