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

Function create_stream

test/test_nsim.py:14–34  ·  view source on GitHub ↗
(self, src_if, dst_if, count)

Source from the content-addressed store, hash-verified

12
13
14def create_stream(self, src_if, dst_if, count):
15 packets = []
16 for i in range(count):
17 # create packet info stored in the test case instance
18 info = self.create_packet_info(src_if, dst_if)
19 # convert the info into packet payload
20 payload = self.info_to_payload(info)
21 # create the packet itself
22 p = (
23 Ether(dst=src_if.local_mac, src=src_if.remote_mac)
24 / IP(src=src_if.remote_ip4, dst=dst_if.remote_ip4)
25 / UDP(sport=randint(49152, 65535), dport=5678)
26 / Raw(payload)
27 )
28 # store a copy of the packet in the packet info
29 info.data = p.copy()
30 # append the packet to the list
31 packets.append(p)
32
33 # return the created packet list
34 return packets
35
36
37def verify_capture(self, src_if, dst_if, capture, reply):

Callers 4

test_nsim_delayMethod · 0.70
test_nsim_dropMethod · 0.70
test_nsim_delayMethod · 0.70
test_nsim_dropMethod · 0.70

Calls 4

create_packet_infoMethod · 0.80
info_to_payloadMethod · 0.80
copyMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected