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
diff --git a/sysmocom/suites/4g/rrc_idle_mo_ping.py b/sysmocom/suites/4g/rrc_idle_mo_ping.py
index ced798d..389e5a2 100755
--- a/sysmocom/suites/4g/rrc_idle_mo_ping.py
+++ b/sysmocom/suites/4g/rrc_idle_mo_ping.py
@@ -31,9 +31,16 @@
 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 dcabe21..bdebb26 100755
--- a/sysmocom/suites/4g/rrc_idle_mt_ping.py
+++ b/sysmocom/suites/4g/rrc_idle_mt_ping.py
@@ -26,7 +26,7 @@
 # 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 @@
     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)