X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_flowprobe.py;h=9ffe84b8c2c5ae5076af37dfaab7b6f251213179;hb=b09f4d0adb8364b3516c3a64e8238715887ffec8;hp=757226b0db8bad947e44b8d06b41bc48e43dc6ae;hpb=e3a0e6e8bfe989a643f90902dd214c46ae69597e;p=vpp.git diff --git a/test/test_flowprobe.py b/test/test_flowprobe.py index 757226b0db8..9ffe84b8c2c 100644 --- a/test/test_flowprobe.py +++ b/test/test_flowprobe.py @@ -40,9 +40,11 @@ class VppCFLOW(VppObject): def add_vpp_config(self): self.enable_exporter() - self._test.vapi.ppcli("flowprobe params record %s active %s " - "passive %s" % (self._collect, self._active, - self._passive)) + 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, + active_timer=self._active, passive_timer=self._passive) self.enable_flowprobe_feature() self._test.vapi.cli("ipfix flush") self._configured = True @@ -232,7 +234,7 @@ class MethodHolder(VppTestCase): ip_layer = capture[0][IPv6] if data_set is not None: for record in data: - # skip flow if in/out gress interface is 0 + # skip flow if ingress/egress interface is 0 if int(binascii.hexlify(record[10]), 16) == 0: continue if int(binascii.hexlify(record[14]), 16) == 0: @@ -492,7 +494,7 @@ class Datapath(MethodHolder): ipfix.add_vpp_config() # template packet should arrive immediately - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() ipfix.verify_templates(timeout=3, count=1) self.collector.get_capture(1) @@ -516,7 +518,7 @@ class Datapath(MethodHolder): capture = self.send_packets() # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {2: 'packets', 256: 8}) @@ -542,7 +544,7 @@ class Datapath(MethodHolder): capture = self.send_packets() # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {2: 'packets', 4: 17, @@ -570,7 +572,7 @@ class Datapath(MethodHolder): capture = self.send_packets() # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {2: 'packets', 7: 'sport', 11: 'dport'}) @@ -590,7 +592,7 @@ class Datapath(MethodHolder): ipfix.add_vpp_config() # template packet should arrive immediately - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() ipfix.verify_templates(timeout=3, count=1) self.collector.get_capture(1) @@ -615,7 +617,7 @@ class Datapath(MethodHolder): capture = self.send_packets(src_if=self.pg3, dst_if=self.pg4) # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {2: 'packets', 256: 8}) @@ -643,7 +645,7 @@ class Datapath(MethodHolder): capture = self.send_packets(src_if=self.pg3, dst_if=self.pg4) # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {1: 'octets', 2: 'packets', @@ -672,7 +674,7 @@ class Datapath(MethodHolder): capture = self.send_packets(src_if=self.pg3, dst_if=self.pg4) # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {2: 'packets', 7: 'sport', 11: 'dport'}) @@ -717,7 +719,7 @@ class Datapath(MethodHolder): capture = self.send_packets(src_if=self.pg5, dst_if=self.pg6) # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {2: 'packets', 256: 56710}, @@ -747,7 +749,7 @@ class Datapath(MethodHolder): capture = self.send_packets(src_if=self.pg5, dst_if=self.pg6) # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {2: 'packets', @@ -778,7 +780,7 @@ class Datapath(MethodHolder): capture = self.send_packets(src_if=self.pg5, dst_if=self.pg6) # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[0]) self.verify_cflow_data_detail(ipfix_decoder, capture, cflow, {2: 'packets', 7: 'sport', 11: 'dport'}, @@ -807,7 +809,7 @@ class Datapath(MethodHolder): capture = self.send_packets() # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflow = self.wait_for_cflow_packet(self.collector, templates[1]) self.verify_cflow_data_notimer(ipfix_decoder, capture, [cflow]) self.collector.get_capture(4) @@ -826,7 +828,7 @@ class Datapath(MethodHolder): ipfix_decoder = IPFIXDecoder() # template packet should arrive immediately - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() templates = ipfix.verify_templates(ipfix_decoder) self.create_stream(packets=6) @@ -834,7 +836,7 @@ class Datapath(MethodHolder): # make sure the one packet we expect actually showed up cflows = [] - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() cflows.append(self.wait_for_cflow_packet(self.collector, templates[1])) cflows.append(self.wait_for_cflow_packet(self.collector, @@ -875,18 +877,18 @@ class DisableIPFIX(MethodHolder): self.send_packets() # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1]) self.collector.get_capture(4) - # disble IPFIX + # disable IPFIX ipfix.disable_exporter() self.pg_enable_capture([self.collector]) self.send_packets() # make sure no one packet arrived in 1 minute - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1], expected=False) self.collector.get_capture(0) @@ -925,19 +927,19 @@ class ReenableIPFIX(MethodHolder): self.send_packets() # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1]) self.collector.get_capture(4) # disable IPFIX ipfix.disable_exporter() - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.pg_enable_capture([self.collector]) self.send_packets() # make sure no one packet arrived in active timer span - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1], expected=False) self.collector.get_capture(0) @@ -992,18 +994,18 @@ class DisableFP(MethodHolder): self.send_packets() # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1]) self.collector.get_capture(4) - # disble IPFIX + # disable IPFIX ipfix.disable_flowprobe_feature() self.pg_enable_capture([self.collector]) self.send_packets() # make sure no one packet arrived in active timer span - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1], expected=False) self.collector.get_capture(0) @@ -1036,39 +1038,39 @@ class ReenableFP(MethodHolder): ipfix_decoder = IPFIXDecoder() # template packet should arrive immediately - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() templates = ipfix.verify_templates(ipfix_decoder, timeout=3) self.create_stream() self.send_packets() # make sure the one packet we expect actually showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1], 5) self.collector.get_capture(4) - # disble FPP feature + # disable FPP feature ipfix.disable_flowprobe_feature() self.pg_enable_capture([self.collector]) self.send_packets() # make sure no one packet arrived in active timer span - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1], 5, expected=False) self.collector.get_capture(0) # enable FPP feature ipfix.enable_flowprobe_feature() - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() templates = ipfix.verify_templates(ipfix_decoder, timeout=3) self.send_packets() # make sure the next packets (templates and data) we expect actually # showed up - self.vapi.cli("ipfix flush") + self.vapi.ipfix_flush() self.wait_for_cflow_packet(self.collector, templates[1], 5) self.collector.get_capture(4)