aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/flowprobe/test
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-12-09 15:51:44 +0100
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-10 04:08:58 +0000
commit3013e69884ce99aa27049947408286e16905f302 (patch)
tree38b2dd6e8c9e20843a3b213bd4d9ff0400d59ac4 /src/plugins/flowprobe/test
parent39d69112fcec114fde34955ceb41555221d3ba11 (diff)
flowprobe: use explicit types in api
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I4f1cccca7de0c07cee472bde80cd6b0ef60046bd
Diffstat (limited to 'src/plugins/flowprobe/test')
-rw-r--r--src/plugins/flowprobe/test/test_flowprobe.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/flowprobe/test/test_flowprobe.py b/src/plugins/flowprobe/test/test_flowprobe.py
index 70b3acbd723..092e8d3951d 100644
--- a/src/plugins/flowprobe/test/test_flowprobe.py
+++ b/src/plugins/flowprobe/test/test_flowprobe.py
@@ -20,6 +20,7 @@ from ipfix import IPFIX, Set, Template, Data, IPFIXDecoder
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_papi.macaddress import mac_ntop
from socket import inet_ntop
+from vpp_papi import VppEnum
class VppCFLOW(VppObject):
@@ -42,10 +43,20 @@ class VppCFLOW(VppObject):
def add_vpp_config(self):
self.enable_exporter()
+ l2_flag = 0
+ l3_flag = 0
+ l4_flag = 0
+ if 'l2' in self._collect.lower():
+ l2_flag = (VppEnum.vl_api_flowprobe_record_flags_t.
+ FLOWPROBE_RECORD_FLAG_L2)
+ if 'l3' in self._collect.lower():
+ l3_flag = (VppEnum.vl_api_flowprobe_record_flags_t.
+ FLOWPROBE_RECORD_FLAG_L3)
+ if 'l4' in self._collect.lower():
+ l4_flag = (VppEnum.vl_api_flowprobe_record_flags_t.
+ FLOWPROBE_RECORD_FLAG_L4)
self._test.vapi.flowprobe_params(
- record_l2=1 if 'l2' in self._collect.lower() else 0,
- record_l3=1 if 'l3' in self._collect.lower() else 0,
- record_l4=1 if 'l4' in self._collect.lower() else 0,
+ record_flags=(l2_flag | l3_flag | l4_flag),
active_timer=self._active, passive_timer=self._passive)
self.enable_flowprobe_feature()
self._test.vapi.cli("ipfix flush")