Skip to content

Commit

Permalink
fixup! tests: Initial import of congure_reno tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Feb 10, 2021
1 parent 6966bfa commit 3df7bea
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions tests/congure_reno/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,12 @@ def test_enter_fast_retransmit_check_e_not_true(self):
self.assertEqual(0, self.get_ff_calls())
self.assertNotInFastRetransmit(state)

def test_enter_fast_retransmit_all_check_true(self):
def test_enter_fast_retransmit_all_check_true_1(self):
"""
See self.test_enter_fast_retransmit_check_a_not_true()
This test checks if fast retransmit is NOT entered when condition (e)
is not true but all others are
This test checks if fast retransmit is entered all conditions are true
(in the sense that a window is advertised and the current send window
is the same)
"""
state = self.cong_state()
self.assertEqual(0, self.get_ff_calls())
Expand All @@ -584,7 +585,7 @@ def test_enter_fast_retransmit_all_check_true(self):
self.cong_report_msg_sent(52)
state = self.cong_state()
self.assertEqual(state['in_flight_size'], 52)
# make condition (e) not true
# make condition (e) true
self.set_same_wnd_adv(True)
# condition (b) ack['size'] == 0, (c) ack['clean'] == True,
# (d) ack['id'] == 15
Expand All @@ -598,6 +599,37 @@ def test_enter_fast_retransmit_all_check_true(self):
self.assertEqual(1, self.get_ff_calls())
self.assertInFastRetransmit(self.cong_state())

def test_enter_fast_retransmit_all_check_true_2(self):
"""
See self.test_enter_fast_retransmit_check_a_not_true()
This test checks if fast retransmit is entered all conditions are true
(in the sense that a window is not advertised and thus it is not
comparable to the send window)
"""
state = self.cong_state()
self.assertEqual(0, self.get_ff_calls())
self.assertNotInFastRetransmit(state)
self.assertEqual(state['in_flight_size'], 0)
self._send_msg_and_recv_ack(42, ack_id=15, ack_size=0, ack_clean=True)
# make condition (a) true
self.cong_report_msg_sent(52)
state = self.cong_state()
self.assertEqual(state['in_flight_size'], 52)
# return false for same_wnd_adv, just to make sure that `wnd == 0` is
# the condition that makes (e) go through
self.set_same_wnd_adv(False)
# condition (b) ack['size'] == 0, (c) ack['clean'] == True,
# (d) ack['id'] == 15, (e) ack['wnd'] == 0
for _ in range(3):
res = self.cong_report_msg_acked(
msg={'send_time': 1000, 'size': 42, 'resends': 0},
ack={'recv_time': 1100, 'id': 15, 'size': 0,
'clean': True, 'wnd': 0, 'delay': 0},
)
self.assertIsNone(res)
self.assertEqual(1, self.get_ff_calls())
self.assertInFastRetransmit(self.cong_state())

def test_ecn_ce(self):
"""
https://tools.ietf.org/html/rfc5681#section-3
Expand Down

0 comments on commit 3df7bea

Please sign in to comment.