Commit b192bf12 authored by Adrian Moreno's avatar Adrian Moreno Committed by Jakub Kicinski

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: default avatarAaron Conole <aconole@redhat.com>
Signed-off-by: default avatarAdrian Moreno <amorenoz@redhat.com>
Link: https://patch.msgid.link/20240704085710.353845-10-amorenoz@redhat.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c7815abb
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment