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

Method pg_start

test/framework.py:167–194  ·  view source on GitHub ↗

Enable the PG, wait till it is done, then clean up

(cls, trace=True, traceFilter=False)

Source from the content-addressed store, hash-verified

165
166 @classmethod
167 def pg_start(cls, trace=True, traceFilter=False):
168 """Enable the PG, wait till it is done, then clean up"""
169 for intf, worker in cls._old_pcaps:
170 intf.remove_old_pcap_file(intf.get_in_path(worker))
171 cls._old_pcaps = []
172 if trace:
173 cls.vapi.cli("clear trace")
174 cls.vapi.cli("trace add pg-input 1000" + (" filter" if traceFilter else ""))
175 cls.vapi.cli("packet-generator enable")
176 # PG, when starts, runs to completion -
177 # so let's avoid a race condition,
178 # and wait a little till it's done.
179 # Then clean it up - and then be gone.
180 deadline = time.time() + 300
181 while True:
182 try:
183 if cls.vapi.cli("show packet-generator").find("Yes") == -1:
184 break
185 except vpp_papi.VPPIOError:
186 cls.logger.debug("VPP API timeout during pg_start, retrying")
187 cls.sleep(0.01) # yield
188 if time.time() > deadline:
189 cls.logger.error("Timeout waiting for pg to stop")
190 break
191 for intf, worker in cls._pcaps:
192 cls.vapi.cli("packet-generator delete %s" % intf.get_cap_name(worker))
193 cls._old_pcaps = cls._pcaps
194 cls._pcaps = []
195
196 @classmethod
197 def create_pg_interfaces_internal(

Callers 15

pg_sendMethod · 0.95
send_and_expect_multiMethod · 0.95
run_verify_testMethod · 0.80
sendMethod · 0.80
add_groupMethod · 0.80
remove_groupMethod · 0.80
test_igmp_hostMethod · 0.80
test_igmp_routerMethod · 0.80
test_srv6_usid_srhMethod · 0.80
test_srv6_usidMethod · 0.80

Calls 6

remove_old_pcap_fileMethod · 0.80
get_in_pathMethod · 0.80
get_cap_nameMethod · 0.80
cliMethod · 0.45
findMethod · 0.45
sleepMethod · 0.45

Tested by 15

run_verify_testMethod · 0.64
sendMethod · 0.64
add_groupMethod · 0.64
remove_groupMethod · 0.64
test_igmp_hostMethod · 0.64
test_igmp_routerMethod · 0.64
test_srv6_usid_srhMethod · 0.64
test_srv6_usidMethod · 0.64
test_srv6_usid_flexMethod · 0.64