X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVPPUtil.py;fp=resources%2Flibraries%2Fpython%2FVPPUtil.py;h=a7ec44c97410f3cac1f26b0aa95c4764da67550c;hp=c7354942824fee608334d8487a3b9ea8dbeceafa;hb=a9f54ca5080aeef17686f300a6807bf9b46b7c90;hpb=70b633f637f6923d1e266473389ddbba02ca37f1 diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py index c735494282..a7ec44c974 100644 --- a/resources/libraries/python/VPPUtil.py +++ b/resources/libraries/python/VPPUtil.py @@ -361,3 +361,26 @@ class VPPUtil: logger.trace(f"show threads:\n{threads_data}") return threads_data + + @staticmethod + def vpp_add_graph_node_next(node, graph_node_name, graph_next_name): + """Set the next node for a given node. + + :param node: Node to run command on. + :param graph_node_name: Graph node to add the next node on. + :param graph_next_name: Graph node to add as the next node. + :type node: dict + :type graph_node_name: str + :type graph_next_name: str + :returns: The index of the next node. + :rtype: int + """ + cmd = u"add_node_next" + args = dict( + node_name=graph_node_name, + next_name=graph_next_name + ) + with PapiSocketExecutor(node) as papi_exec: + reply = papi_exec.add(cmd, **args).get_reply() + + return reply[u"next_index"]