4g: add checks for received PRACHs for ping tests

the tests already check for sent PRACHs, this will
also check for received PRACHs on the eNB to make
sure we don't detect any fake PRACHs during the tests.

Change-Id: Ib23056b1ad4b18a7dde6cd0c997f5114ac2acb61
This commit is contained in:
Andre Puschmann 2021-01-05 14:18:52 +01:00
parent f249a026a0
commit 29263b7389
2 changed files with 19 additions and 5 deletions

View File

@ -31,9 +31,16 @@ proc = ue.run_netns_wait('ping', ('ping', '-c', '1', epc.tun_addr()))
output = proc.get_stdout()
# Check PRACH transmissions
num_prachs = 2
num_prach_sent = ue.get_counter('prach_sent')
if num_prach_sent != 2:
raise Exception("Expected to have sent exactly 2 PRACHs, but in fact sent {}".format(num_prach_sent))
if num_prach_sent != num_prachs:
raise Exception("Expected to have sent exactly {} PRACHs, but in fact sent {}".format(num_prachs, num_prach_sent))
# Check PRACH receptions
num_prach_received = enb.get_counter('prach_received')
if num_prach_sent != num_prachs:
raise Exception("Expected to have received exactly {} PRACHs, but in fact received {}".format(num_prachs, num_prach_received))
output += "\nnum_prach_sent={}\nnum_prach_received={}\n".format(num_prach_sent, num_prach_received)
print(output)
test.set_report_stdout(output)

View File

@ -26,7 +26,7 @@ print('UE is RRC idle')
# Wait a bit
sleep(5)
# Generate MO traffic, send single ping
# Generate MT traffic, send single ping
proc = epc.prepare_process('ping', ('ping', '-c', '1', ue.get_assigned_addr()))
proc.launch_sync()
output = proc.get_stdout()
@ -37,9 +37,16 @@ if num_paging_received != 1:
raise Exception("Expected to receive exactly 1 paging message, but in fact received {}".format(num_paging_received))
# Check PRACH transmissions
num_prachs = 2
num_prach_sent = ue.get_counter('prach_sent')
if num_prach_sent != 2:
raise Exception("Expected to have sent exactly 2 PRACHs, but in fact sent {}".format(num_prach_sent))
if num_prach_sent != num_prachs:
raise Exception("Expected to have sent exactly {} PRACHs, but in fact sent {}".format(num_prachs, num_prach_sent))
# Check PRACH receptions
num_prach_received = enb.get_counter('prach_received')
if num_prach_sent != num_prachs:
raise Exception("Expected to have received exactly {} PRACHs, but in fact received {}".format(num_prachs, num_prach_received))
output += "\nnum_prach_sent={}\nnum_prach_received={}\n".format(num_prach_sent, num_prach_received)
print(output)
test.set_report_stdout(output)