WIP ARQ - added tests for large payload

This commit is contained in:
DJ2LS 2023-12-17 12:31:44 +01:00
parent 6f28f4ef32
commit 7b09894a4b
2 changed files with 17 additions and 4 deletions

View file

@ -116,7 +116,7 @@ class ARQSessionIRS(arq_session.ARQSession):
def process_incoming_data(self, frame):
if frame['offset'] != self.received_bytes:
self.logger.info(f"Discarding data frame due to wrong offset", frame=self.frame_received)
self.logger.info(f"Discarding data frame due to wrong offset", frame=frame)
return False
remaining_data_length = self.total_length - self.received_bytes

View file

@ -13,6 +13,7 @@ from state_manager import StateManager
from frame_dispatcher import DISPATCHER
import random
import structlog
import numpy as np
class TestModem:
def __init__(self):
@ -75,8 +76,7 @@ class TestARQSession(unittest.TestCase):
name = "IRS to ISS channel")
self.irs_to_iss_channel.start()
def testARQSession(self):
def testARQSessionSmallPayload(self):
# set Packet Error Rate (PER) / frame loss probability
self.loss_probability = 30
@ -87,6 +87,19 @@ class TestARQSession(unittest.TestCase):
}
cmd = ARQRawCommand(self.config, self.iss_state_manager, self.iss_event_queue, params)
cmd.run(self.iss_event_queue, self.iss_modem)
def testARQSessionLargePayload(self):
# set Packet Error Rate (PER) / frame loss probability
self.loss_probability = 30
self.establishChannels()
params = {
'dxcall': "DJ2LS-3",
'data': base64.b64encode(np.random.bytes(1000)),
}
cmd = ARQRawCommand(self.config, self.iss_state_manager, self.iss_event_queue, params)
cmd.run(self.iss_event_queue, self.iss_modem)
if __name__ == '__main__':
unittest.main()