From 29263b7389520ec2269d6852a09f96ef8da79573 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 5 Jan 2021 14:18:52 +0100 Subject: [PATCH] 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 --- sysmocom/suites/4g/rrc_idle_mo_ping.py | 11 +++++++++-- sysmocom/suites/4g/rrc_idle_mt_ping.py | 13 ++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/sysmocom/suites/4g/rrc_idle_mo_ping.py b/sysmocom/suites/4g/rrc_idle_mo_ping.py index ced798d2..389e5a2e 100755 --- a/sysmocom/suites/4g/rrc_idle_mo_ping.py +++ b/sysmocom/suites/4g/rrc_idle_mo_ping.py @@ -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) diff --git a/sysmocom/suites/4g/rrc_idle_mt_ping.py b/sysmocom/suites/4g/rrc_idle_mt_ping.py index dcabe21f..bdebb26e 100755 --- a/sysmocom/suites/4g/rrc_idle_mt_ping.py +++ b/sysmocom/suites/4g/rrc_idle_mt_ping.py @@ -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)