MCPcopy Create free account
hub / github.com/FDio/vpp / send_and_expect

Method send_and_expect

test/framework.py:648–686  ·  view source on GitHub ↗
(
        self,
        intf: VppPGInterface,
        pkts,
        output: VppPGInterface,
        n_rx: int | None = None,
        worker: int | None = None,
        trace: bool = True,
        log_packets: bool = True,
        msg: str | None = None,
        stats_diff: StatsDiff | None = None,
        filter_out_fn=is_ipv6_misc,
        assert_nothing_captured=[],
    )

Source from the content-addressed store, hash-verified

646 return capture
647
648 def send_and_expect(
649 self,
650 intf: VppPGInterface,
651 pkts,
652 output: VppPGInterface,
653 n_rx: int | None = None,
654 worker: int | None = None,
655 trace: bool = True,
656 log_packets: bool = True,
657 msg: str | None = None,
658 stats_diff: StatsDiff | None = None,
659 filter_out_fn=is_ipv6_misc,
660 assert_nothing_captured=[],
661 ) -> PacketList | None:
662 send = Send(interface=intf, packets=pkts, worker=worker)
663 if n_rx is None:
664 n_rx = 1 if isinstance(pkts, Packet) else len(pkts)
665 expect = Expect(
666 interface=output, expected_count=n_rx, filter_out_fn=filter_out_fn
667 )
668
669 if stats_diff:
670 stats_snapshot = self.snapshot_stats(stats_diff)
671
672 capture = self.send_and_expect_multi(
673 [send],
674 [expect],
675 trace=trace,
676 log_packets=log_packets,
677 msg=msg,
678 stats_diff=stats_diff,
679 assert_nothing_captured=assert_nothing_captured,
680 )
681
682 if stats_diff:
683 self.compare_stats_with_snapshot(stats_diff, stats_snapshot)
684
685 self.assert_equal(len(capture), 1, "number of capture contexts")
686 return capture[0].packets
687
688 def send_and_expect_load_balancing(
689 self, input, pkts, outputs, worker=None, trace=True

Callers 15

test_groMethod · 0.80
send_and_verifyMethod · 0.80
test_tracepathMethod · 0.80
test_greMethod · 0.80
test_gre_with_keyMethod · 0.80
test_gre6Method · 0.80
test_gre_vrfMethod · 0.80
test_gre_l2Method · 0.80

Calls 6

send_and_expect_multiMethod · 0.95
SendClass · 0.85
ExpectClass · 0.85
snapshot_statsMethod · 0.45
assert_equalMethod · 0.45

Tested by 15

test_groMethod · 0.64
send_and_verifyMethod · 0.64
test_tracepathMethod · 0.64
test_greMethod · 0.64
test_gre_with_keyMethod · 0.64
test_gre6Method · 0.64
test_gre_vrfMethod · 0.64
test_gre_l2Method · 0.64