Verify flow entry reuse doesn't accumulate meta info
(self)
| 532 | self.logger.info("FFP_TEST_FINISH_0000") |
| 533 | |
| 534 | def test_flow_entry_reuse(self): |
| 535 | """Verify flow entry reuse doesn't accumulate meta info""" |
| 536 | self.pg_enable_capture(self.pg_interfaces) |
| 537 | self.pkts = [] |
| 538 | |
| 539 | # enable ip4 datapath for an interface |
| 540 | # set active and passive timers |
| 541 | ipfix = VppCFLOW( |
| 542 | test=self, |
| 543 | active=2, |
| 544 | passive=3, |
| 545 | intf="pg3", |
| 546 | layer="l3 l4", |
| 547 | datapath="ip4", |
| 548 | direction="rx", |
| 549 | mtu=100, |
| 550 | ) |
| 551 | ipfix.add_vpp_config() |
| 552 | |
| 553 | # template packet should arrive immediately |
| 554 | ipfix_decoder = IPFIXDecoder() |
| 555 | templates = ipfix.verify_templates(ipfix_decoder, count=1) |
| 556 | |
| 557 | # make a tcp packet |
| 558 | self.pkts = [ |
| 559 | ( |
| 560 | Ether(src=self.pg3.remote_mac, dst=self.pg3.local_mac) |
| 561 | / IP(src=self.pg3.remote_ip4, dst=self.pg4.remote_ip4) |
| 562 | / TCP(sport=1234, dport=4321) |
| 563 | / Raw(b"\xa5" * 50) |
| 564 | ) |
| 565 | ] |
| 566 | |
| 567 | # send the tcp packet two times, each time with new set of flags |
| 568 | tcp_flags = ( |
| 569 | TCP_F_SYN | TCP_F_ACK, |
| 570 | TCP_F_RST | TCP_F_PSH, |
| 571 | ) |
| 572 | for f in tcp_flags: |
| 573 | self.pkts[0][TCP].flags = f |
| 574 | capture = self.send_packets(src_if=self.pg3, dst_if=self.pg4) |
| 575 | |
| 576 | # verify meta info - packet/octet delta and tcp flags |
| 577 | cflow = self.wait_for_cflow_packet(self.collector, templates[0], timeout=6) |
| 578 | self.verify_cflow_data(ipfix_decoder, capture, cflow) |
| 579 | self.verify_cflow_data_detail( |
| 580 | ipfix_decoder, |
| 581 | capture, |
| 582 | cflow, |
| 583 | { |
| 584 | IPFIX_TCP_FLAGS_ID: f, |
| 585 | IPFIX_SRC_TRANS_PORT_ID: 1234, |
| 586 | IPFIX_DST_TRANS_PORT_ID: 4321, |
| 587 | }, |
| 588 | ) |
| 589 | |
| 590 | self.collector.get_capture(3) |
| 591 |
nothing calls this directly
no test coverage detected