+ This makes a problem. It would be better to have ENUMS
in code as everywhere else
Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: I90f8e7c0177cb6a76eef5d4444f0ec22f57236c4
from resources.libraries.python.ssh import exec_cmd_no_error
from resources.libraries.python.PapiExecutor import PapiSocketExecutor
from resources.libraries.python.ssh import exec_cmd_no_error
from resources.libraries.python.PapiExecutor import PapiSocketExecutor
-from vpp_papi import VppEnum
-
class FlowUtil:
"""Utilities for flow configuration."""
class FlowUtil:
"""Utilities for flow configuration."""
:returns: flow_index.
:rtype: int
"""
:returns: flow_index.
:rtype: int
"""
+ from vpp_papi import VppEnum
+
flow = u"ip4_n_tuple"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4_N_TUPLE
flow = u"ip4_n_tuple"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4_N_TUPLE
:returns: flow_index.
:rtype: int
"""
:returns: flow_index.
:rtype: int
"""
+ from vpp_papi import VppEnum
+
flow = u"ip6_n_tuple"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP6_N_TUPLE
flow = u"ip6_n_tuple"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP6_N_TUPLE
:returns: flow_index.
:rtype: int
"""
:returns: flow_index.
:rtype: int
"""
+ from vpp_papi import VppEnum
+
flow = u"ip4"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4
flow = u"ip4"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4
:returns: flow_index.
:rtype: int
"""
:returns: flow_index.
:rtype: int
"""
+ from vpp_papi import VppEnum
+
flow = u"ip6"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP6
flow = u"ip6"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP6
:returns: flow_index.
:rtype: int
"""
:returns: flow_index.
:rtype: int
"""
+ from vpp_papi import VppEnum
+
flow = u"ip4_gtpu"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4_GTPU
flow_proto = VppEnum.vl_api_ip_proto_t.IP_API_PROTO_UDP
flow = u"ip4_gtpu"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4_GTPU
flow_proto = VppEnum.vl_api_ip_proto_t.IP_API_PROTO_UDP
:returns: flow_index.
:rtype: int
"""
:returns: flow_index.
:rtype: int
"""
+ from vpp_papi import VppEnum
+
if proto == u"ESP":
flow = u"ip4_ipsec_esp"
flow_proto = VppEnum.vl_api_ip_proto_t.IP_API_PROTO_ESP
if proto == u"ESP":
flow = u"ip4_ipsec_esp"
flow_proto = VppEnum.vl_api_ip_proto_t.IP_API_PROTO_ESP
:returns: flow_index.
:rtype: int
"""
:returns: flow_index.
:rtype: int
"""
+ from vpp_papi import VppEnum
+
flow = u"ip4_l2tpv3oip"
flow_proto = 115 # IP_API_PROTO_L2TP
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4_L2TPV3OIP
flow = u"ip4_l2tpv3oip"
flow_proto = 115 # IP_API_PROTO_L2TP
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4_L2TPV3OIP
:type value: int
:returns: flow_index.
"""
:type value: int
:returns: flow_index.
"""
+ from vpp_papi import VppEnum
+
flow = u"ip4_vxlan"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4_VXLAN
flow_proto = VppEnum.vl_api_ip_proto_t.IP_API_PROTO_UDP
flow = u"ip4_vxlan"
flow_type = VppEnum.vl_api_flow_type_t.FLOW_TYPE_IP4_VXLAN
flow_proto = VppEnum.vl_api_ip_proto_t.IP_API_PROTO_UDP
:rtype: int
:raises ValueError: If action type is not supported.
"""
:rtype: int
:raises ValueError: If action type is not supported.
"""
+ from vpp_papi import VppEnum
+
cmd = u"flow_add"
if action == u"redirect-to-queue":
cmd = u"flow_add"
if action == u"redirect-to-queue":
:type flow_index: int
:returns: Nothing.
"""
:type flow_index: int
:returns: Nothing.
"""
+ from vpp_papi import VppEnum
+
cmd = u"flow_enable"
sw_if_index = Topology.get_interface_sw_index(node, interface)
args = dict(
cmd = u"flow_enable"
sw_if_index = Topology.get_interface_sw_index(node, interface)
args = dict(
:type flow_index: int
:returns: Nothing.
"""
:type flow_index: int
:returns: Nothing.
"""
+ from vpp_papi import VppEnum
+
cmd = u"flow_disable"
sw_if_index = Topology.get_interface_sw_index(node, interface)
args = dict(
cmd = u"flow_disable"
sw_if_index = Topology.get_interface_sw_index(node, interface)
args = dict(
:type flow_index: int
:returns: Nothing.
"""
:type flow_index: int
:returns: Nothing.
"""
+ from vpp_papi import VppEnum
+
cmd = u"flow_del"
args = dict(
flow_index=int(flow_index)
cmd = u"flow_del"
args = dict(
flow_index=int(flow_index)
:returns: flow entry.
:rtype: str
"""
:returns: flow entry.
:rtype: str
"""
+ from vpp_papi import VppEnum
+
cmd = u"vppctl show flow entry"
err_msg = u"Failed to show flow on host {node[u'host']}"
cmd = u"vppctl show flow entry"
err_msg = u"Failed to show flow on host {node[u'host']}"
:raises RuntimeError: If the verification of flow action fails.
:raises ValueError: If action type is not supported.
"""
:raises RuntimeError: If the verification of flow action fails.
:raises ValueError: If action type is not supported.
"""
+ from vpp_papi import VppEnum
+
err_msg = f"Failed to show trace on host {node[u'host']}"
cmd = u"vppctl show trace"
stdout, _ = exec_cmd_no_error(
err_msg = f"Failed to show trace on host {node[u'host']}"
cmd = u"vppctl show trace"
stdout, _ = exec_cmd_no_error(