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

Method send_and_expect_only

test/framework.py:712–737  ·  view source on GitHub ↗
(
        self, intf, pkts, output, timeout=None, stats_diff=None, worker=None, trace=True
    )

Source from the content-addressed store, hash-verified

710 return rx
711
712 def send_and_expect_only(
713 self, intf, pkts, output, timeout=None, stats_diff=None, worker=None, trace=True
714 ):
715 if stats_diff:
716 stats_snapshot = self.snapshot_stats(stats_diff)
717
718 self.pg_send(intf, pkts, worker=worker)
719 rx = output.get_capture(len(pkts))
720 outputs = [output]
721
722 if timeout is not None:
723 deadline = time.time() + timeout
724
725 for i in self.pg_interfaces:
726 if i not in outputs:
727 i.assert_nothing_captured(
728 timeout=None if timeout is None else deadline - time.time()
729 )
730
731 if trace:
732 self.logger.debug(self.vapi.cli("show trace"))
733
734 if stats_diff:
735 self.compare_stats_with_snapshot(stats_diff, stats_snapshot)
736
737 return rx
738
739
740if __name__ == "__main__":

Callers 7

test_punt_udpMethod · 0.80
test_punt_udp_ip6Method · 0.80
test_ip6_load_balanceMethod · 0.80
__test_redirectMethod · 0.80
test_ip_load_balanceMethod · 0.80
test_gbp_learn_l2Method · 0.80

Calls 6

pg_sendMethod · 0.95
snapshot_statsMethod · 0.45
get_captureMethod · 0.45
cliMethod · 0.45

Tested by 7

test_punt_udpMethod · 0.64
test_punt_udp_ip6Method · 0.64
test_ip6_load_balanceMethod · 0.64
__test_redirectMethod · 0.64
test_ip_load_balanceMethod · 0.64
test_gbp_learn_l2Method · 0.64