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

Method test_ping_api

test/test_ping.py:181–213  ·  view source on GitHub ↗

ping api

(self)

Source from the content-addressed store, hash-verified

179 self.vapi.cli("show error")
180
181 def test_ping_api(self):
182 """ping api"""
183
184 try:
185 self.pg_enable_capture(self.pg_interfaces)
186 self.pg_start()
187
188 ret = self.vapi.want_ping_finished_events(
189 address=self.pg1.remote_ip4,
190 repeat=4,
191 interval=0.2,
192 )
193 self.logger.info(ret)
194 timeout = 1
195
196 ev = self.vapi.wait_for_event(timeout, "ping_finished_event")
197 self.logger.info(ev)
198 self.assertEqual(ev.request_count, 4)
199
200 out = self.pg1.get_capture(4)
201 icmp_id = None
202 icmp_seq = 1
203 for p in out:
204 icmp = self.verify_ping_request(
205 p, self.pg1.local_ip4, self.pg1.remote_ip4, icmp_seq
206 )
207 icmp_seq = icmp_seq + 1
208 if icmp_id is None:
209 icmp_id = icmp.id
210 else:
211 self.assertEqual(icmp.id, icmp_id)
212 finally:
213 self.vapi.cli("show error")

Callers

nothing calls this directly

Calls 6

verify_ping_requestMethod · 0.95
pg_enable_captureMethod · 0.80
pg_startMethod · 0.80
wait_for_eventMethod · 0.80
get_captureMethod · 0.45
cliMethod · 0.45

Tested by

no test coverage detected