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

Method test_modify_req_min_rx_double

test/test_bfd.py:1356–1384  ·  view source on GitHub ↗

modify session - double required min rx

(self)

Source from the content-addressed store, hash-verified

1354 reference_packet = p
1355
1356 def test_modify_req_min_rx_double(self):
1357 """modify session - double required min rx"""
1358 bfd_session_up(self)
1359 p = wait_for_bfd_packet(self)
1360 self.test_session.update(desired_min_tx=10000, required_min_rx=10000)
1361 self.test_session.send_packet()
1362 # double required min rx
1363 self.vpp_session.modify_parameters(
1364 required_min_rx=2 * self.vpp_session.required_min_rx
1365 )
1366 p = wait_for_bfd_packet(self, pcap_time_min=time.time() - self.vpp_clock_offset)
1367 # poll bit needs to be set
1368 self.assertIn("P", p.sprintf("%BFD.flags%"), "Poll bit not set in BFD packet")
1369 # finish poll sequence with final packet
1370 final = self.test_session.create_packet()
1371 final[BFD].flags = "F"
1372 timeout = (
1373 self.test_session.detect_mult
1374 * max(self.test_session.desired_min_tx, self.vpp_session.required_min_rx)
1375 / USEC_IN_SEC
1376 )
1377 self.test_session.send_packet(final)
1378 time_mark = time.time()
1379 e = self.vapi.wait_for_event(2 * timeout, "bfd_udp_session_event")
1380 verify_event(self, e, expected_state=BFDState.down)
1381 time_to_event = time.time() - time_mark
1382 self.assert_in_range(
1383 time_to_event, 0.9 * timeout, 1.1 * timeout, "session timeout"
1384 )
1385
1386 def test_modify_req_min_rx_halve(self):
1387 """modify session - halve required min rx"""

Callers

nothing calls this directly

Calls 9

bfd_session_upFunction · 0.85
wait_for_bfd_packetFunction · 0.85
verify_eventFunction · 0.85
modify_parametersMethod · 0.80
wait_for_eventMethod · 0.80
updateMethod · 0.45
send_packetMethod · 0.45
create_packetMethod · 0.45
assert_in_rangeMethod · 0.45

Tested by

no test coverage detected