ping api
(self)
| 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") |
nothing calls this directly
no test coverage detected