Skip to content

Commit b192bf1

Browse files
amorenozkuba-moo
authored andcommitted
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 <[email protected]> Signed-off-by: Adrian Moreno <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c7815ab commit b192bf1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/testing/selftests/net/openvswitch/ovs-dpctl.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,19 @@ def parse(self, actstr):
863863
self["attrs"].append(["OVS_ACTION_ATTR_USERSPACE", uact])
864864
parsed = True
865865

866+
elif parse_starts_block(actstr, "trunc(", False):
867+
parencount += 1
868+
actstr, val = parse_extract_field(
869+
actstr,
870+
"trunc(",
871+
r"([0-9]+)",
872+
int,
873+
False,
874+
None,
875+
)
876+
self["attrs"].append(["OVS_ACTION_ATTR_TRUNC", val])
877+
parsed = True
878+
866879
actstr = actstr[strspn(actstr, ", ") :]
867880
while parencount > 0:
868881
parencount -= 1

0 commit comments

Comments
 (0)