X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_pg_interface.py;h=567b81de7c08bf6f46d42edc941df662c869999f;hb=1b6b09bb514831050b23397c078933c2ace3ff36;hp=c8debff030174979b4cc4f6532c52382b661b03d;hpb=7ba9fae5540f3490cea8258cc7830138b58d2740;p=vpp.git diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py index c8debff0301..567b81de7c0 100755 --- a/test/vpp_pg_interface.py +++ b/test/vpp_pg_interface.py @@ -9,6 +9,7 @@ import scapy.compat from scapy.utils import wrpcap, rdpcap, PcapReader from scapy.plist import PacketList from vpp_interface import VppInterface +from vpp_papi import VppEnum from scapy.layers.l2 import Ether, ARP from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6ND_NA,\ @@ -111,11 +112,11 @@ class VppPGInterface(VppInterface): self._out_history_counter += 1 return v - def __init__(self, test, pg_index, gso, gso_size): + def __init__(self, test, pg_index, gso, gso_size, mode): """ Create VPP packet-generator interface """ super().__init__(test) - r = test.vapi.pg_create_interface(pg_index, gso, gso_size) + r = test.vapi.pg_create_interface_v2(pg_index, gso, gso_size, mode) self.set_sw_if_index(r.sw_if_index) self._in_history_counter = 0 @@ -132,8 +133,7 @@ class VppPGInterface(VppInterface): self._cap_name = "pcap%u-sw_if_index-%s" % ( self.pg_index, self.sw_if_index) - def rename_previous_capture_file(self, path, counter): - # if a file from a previous capture exists, rename it. + def rename_old_pcap_file(self, path, counter): filename = os.path.basename(path) try: if os.path.isfile(path): @@ -157,8 +157,7 @@ class VppPGInterface(VppInterface): """ # disable the capture to flush the capture self.disable_capture() - self.rename_previous_capture_file(self.out_path, - self.out_history_counter) + self.rename_old_pcap_file(self.out_path, self.out_history_counter) # FIXME this should be an API, but no such exists atm self.test.vapi.cli(self.capture_cli) self._pcap_reader = None @@ -186,7 +185,7 @@ class VppPGInterface(VppInterface): """ wrpcap(self.get_in_path(worker), pkts) - self.test.register_capture(self, worker) + self.test.register_pcap(self, worker) # FIXME this should be an API, but no such exists atm self.test.vapi.cli(self.get_input_cli(nb_replays, worker))