Change in osmo-ttcn3-hacks[master]: start implementing the TC_paging() PCU test

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Stefan Sperling gerrit-no-reply at lists.osmocom.org
Mon Nov 19 11:10:22 UTC 2018


Stefan Sperling has submitted this change and it was merged. ( https://gerrit.osmocom.org/9374 )

Change subject: start implementing the TC_paging() PCU test
......................................................................

start implementing the TC_paging() PCU test

Implement a basic paging test for the PCU, which is passing for paging
via TMSI (but only if osmo-pcu is started after the test is started).

Previously, this test code amounted to a debugging loop which
never terminated.

Change-Id: Id0384e0742ab91983615e4f1c883bb044c1c8b18
Related: OS#2404
---
M library/L3_Templates.ttcn
M pcu/PCU_Tests.ttcn
M pcu/expected-results.xml
3 files changed, 67 insertions(+), 15 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index e109fde..3918f3d 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -303,6 +303,22 @@
 	}
 }
 
+/* Template for receiving a Paging Request Type1 message with a given TMSI in the first mobile identity. */
+template MobileL3_CommonIE_Types.MobileIdentityLV tr_PAGING_REQ1_MI1_TMSI(octetstring tmsi) := {
+	lengthIndicator := 5,
+	mobileIdentityV := {
+		typeOfIdentity := '100'B,
+		oddEvenInd_identity := {
+			tmsi_ptmsi := {
+				oddevenIndicator := '0'B,
+				fillerDigit := '1111'B,
+				octets := tmsi
+			}
+		}
+	}
+
+}
+
 template PDU_ML3_NW_MS tr_PAGING_REQ2(template TMSIP_TMSI_V mi1 := ?,
 				      template TMSIP_TMSI_V mi2 := ?,
 				      template MobileIdentityTLV mi3 := *) := {
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index adbc73e..6e8185d 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -17,6 +17,9 @@
 	import from GPRS_Context all;
 	import from GPRS_TBF all;
 	import from L1CTL_PortType all;
+	import from MobileL3_Types all;
+	import from MobileL3_CommonIE_Types all;
+	import from L3_Templates all;
 
 	modulepar {
 		BssgpConfig mp_gb_cfg := {
@@ -207,27 +210,58 @@
 		log("BSSGP successfully initialized");
 	}
 
+	function f_wait_paging_req_type1(hexstring expected_tmsi) runs on dummy_CT {
+		var LAPDm_ph_data ph_data;
+		timer T := 5.0;
+
+		T.start;
+		alt {
+			[] L1.receive(LAPDm_ph_data:{sacch:=?,sapi:=0,lapdm:={bbis:=?}}) -> value ph_data {
+				var octetstring payload := substr(ph_data.lapdm.bbis.payload, 1, lengthof(ph_data.lapdm.bbis.payload) - 1);
+				var PDU_ML3_NW_MS pdu;
+
+				if (dec_PDU_ML3_NW_MS_backtrack(payload, pdu) != 0) {
+					repeat;
+				}
+
+				if (not ischosen(pdu.msgs.rrm)) {
+					repeat;
+				}
+
+				if (match(pdu, tr_PAGING_REQ1(tr_PAGING_REQ1_MI1_TMSI(hex2oct(expected_tmsi))))) {
+					setverdict(pass);
+				} else {
+					repeat;
+				}
+			}
+			[] L1.receive { repeat; }
+			[] T.timeout { setverdict(fail); }
+		}
+	}
+
 	/* Send PS-PAGING via BSSGP to PCU, expect it to show up on L1/Um */
 	testcase TC_paging() runs on dummy_CT {
-		var GsmTmsi tmsi := hex2int('01234567'H);
+		var hexstring tmsi_hex := '01234567'H;
+		var GsmTmsi tmsi := hex2int(tmsi_hex);
+
 		g_mmctx.imsi := '262420123456789'H;
 		g_mmctx.tlli := f_random_tlli();
 		f_init();
 
-		/* Send paging on signalling BVCI 0 since osmo-pcu does not support paging on PTP yet. */
-		BSSGP_SIG[0].send(ts_BSSGP_PS_PAGING_IMSI(0, g_mmctx.imsi));
-		BSSGP_SIG[0].send(ts_BSSGP_PS_PAGING_PTMSI(0, g_mmctx.imsi, tmsi));
+		var BCCH_tune_req tune_req := { { false, 871 }, true };
+		L1.send(tune_req);
+		/* FIXME: wait for confirm */
 
-		while (true) {
-			var BssgpDecoded bd;
-			alt {
-				[] BSSGP[0].receive(tr_BD_L3_MT(?)) -> value bd {
-					log("BSSGP Rx: ", bd);
-				}
-				[] BSSGP[0].receive(t_BssgpStsInd(?, ?, BVC_S_UNBLOCKED)) { repeat; }
-				[] BSSGP[0].receive { repeat; }
-			}
-		}
+		/* Send paging on signalling BVCI 0 since osmo-pcu does not support paging on PTP yet. */
+		/*
+		TODO: Paging by IMSI does not work yet because osmo-pcu does not copy IMSI into paging requests.
+		BSSGP_SIG[0].send(ts_BSSGP_PS_PAGING_IMSI(0, g_mmctx.imsi));
+		f_wait_paging_req_type1(hex2oct(g_mmctx.imsi));
+		*/
+
+		/* Page by TMSI */
+		BSSGP_SIG[0].send(ts_BSSGP_PS_PAGING_PTMSI(0, g_mmctx.imsi, tmsi));
+		f_wait_paging_req_type1(tmsi_hex);
 	}
 
 	/* Establish an UL TBF: Tune to ARFCN, send RACH, receive AGCH, enable TBF Rx */
@@ -633,5 +667,6 @@
 		execute(TC_selftest_ns());
 		execute(TC_ul_tbf_single_llc_sizes());
 		execute(TC_ul_tbf());
+		execute(TC_paging());
 	}
 };
diff --git a/pcu/expected-results.xml b/pcu/expected-results.xml
index aec661d..e9610bd 100644
--- a/pcu/expected-results.xml
+++ b/pcu/expected-results.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0"?>
-<testsuite name='PCU_Tests' tests='3' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'>
+<testsuite name='PCU_Tests' tests='4' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'>
   <testcase classname='PCU_Tests' name='TC_ul_tbf_single_llc_sizes' time='MASKED'/>
   <testcase classname='PCU_Tests' name='TC_ul_tbf' time='MASKED'/>
   <testcase classname='PCU_Tests' name='TC_selftest_ns' time='MASKED'/>
+  <testcase classname='PCU_Tests' name='TC_paging' time='MASKED'/>
 </testsuite>

-- 
To view, visit https://gerrit.osmocom.org/9374
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id0384e0742ab91983615e4f1c883bb044c1c8b18
Gerrit-Change-Number: 9374
Gerrit-PatchSet: 7
Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-CC: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181119/10aa8734/attachment.htm>


More information about the gerrit-log mailing list