Change in osmo-ttcn3-hacks[master]: bts: Add TC_pcu_rr_suspend() to test forwarding of RR SUSPEND via PCU...

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon May 27 10:00:07 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14192 )

Change subject: bts: Add TC_pcu_rr_suspend() to test forwarding of RR SUSPEND via PCU socket
......................................................................

bts: Add TC_pcu_rr_suspend() to test forwarding of RR SUSPEND via PCU socket

This test opens a SDCCH and sends a RR SUSPEND message from the
simulated MS.  It then expects the BTS to pick that up and forward
it to the PCU socket rather than via RSL to the BSC.

Change-Id: I4da6e9d7c5dfbd0e017d2a63c6474da700c38e52
Related: OS#2249
Related: OS#4023
---
M bts/BTS_Tests.ttcn
M library/PCUIF_Types.ttcn
2 files changed, 77 insertions(+), 1 deletion(-)

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



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index d9e989c..21e5634 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -32,6 +32,8 @@
 import from MobileL3_RRM_Types all;
 import from MobileL3_Types all;
 import from L3_Templates all;
+import from L3_Common all;
+import from MobileL3_GMM_SM_Types all;
 
 import from Osmocom_VTY_Functions all;
 import from TELNETasp_PortType all;
@@ -3799,6 +3801,77 @@
 	setverdict(pass);
 }
 
+template (value) PDU_ML3_MS_NW ts_RRM_GprsSuspReq(template (value) OCT4 tlli,
+						  template (value) RoutingAreaIdentificationV rai,
+						  template (value) OCT1 cause) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+	skipIndicator := '0000'B
+	},
+	msgs := {
+		rrm := {
+			gPRS_suspensionRequest := {
+				messageType := '00110100'B,
+				tLLI := tlli,
+				routingAreaIdentification := rai,
+				suspensionCause := cause,
+				service_Support := omit
+			}
+		}
+	}
+}
+
+/* test for forwarding of RR SUSPEND from CS lchan to PCU via PCU socket */
+private function f_TC_rr_suspend_req(charstring id) runs on ConnHdlr {
+	var PCUIF_Message first_info;
+	var integer pcu_conn_id := -1;
+	var RslLinkId link_id := valueof(ts_RslLinkID_DCCH(0));
+	var RoutingAreaIdentificationV rai := f_RAI('262'H, '42F'H, '2342'O, '55'O);
+	var OCT4 tlli := '01020304'O;
+	var OCT1 cause := '23'O;
+	timer T := 5.0;
+
+	f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+	f_l1_tune(L1CTL);
+	RSL.clear;
+
+	f_est_dchan();
+	L1CTL.clear;
+
+	f_est_rll_mo(link_id.sapi, link_id, '23420815'O);
+
+	var PDU_ML3_MS_NW susp_req := valueof(ts_RRM_GprsSuspReq(tlli, rai, cause));
+	var octetstring l3 := enc_PDU_ML3_MS_NW(susp_req);
+	f_tx_lapdm(ts_LAPDm_I(link_id.sapi, cr_MO_CMD, true, 1, 0, l3), link_id);
+
+	/* ConnHdlr has terminated after sending the RR SUSP REQ over a dedicaed channel */
+	T.start;
+	alt {
+	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_SUSP_REQ(0, tlli, ?, oct2int(cause)))) {
+		setverdict(pass);
+		}
+	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_SUSP_REQ(?, ?, ?, ?))) {
+		setverdict(fail, "Received unexpected PCUIF SUSPE REQ: ");
+		}
+	[] PCU.receive {
+		repeat;
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for SUSP REQ on PCUIF");
+		}
+	}
+}
+testcase TC_pcu_rr_suspend() runs on test_CT {
+	var ConnHdlrPars pars;
+	var ConnHdlr vc_conn;
+
+	f_init();
+
+	pars := valueof(t_Pars(t_RslChanNr_SDCCH4(0,3), ts_RSL_ChanMode_SIGN));
+	vc_conn := f_start_handler(refers(f_TC_rr_suspend_req), pars, true);
+	vc_conn.done;
+}
 
 
 /***********************************************************************
@@ -5107,6 +5180,7 @@
 		execute( TC_pcu_time_ind() );
 		execute( TC_pcu_rts_req() );
 		execute( TC_pcu_oml_alert() );
+		execute( TC_pcu_rr_suspend() );
 	} else {
 		log("PCU socket path not available, skipping PCU tests");
 	}
diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 750e0b4..455082a 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -193,7 +193,9 @@
 	OCT4		tlli,
 	OCT6		ra_id,
 	uint8_t		cause
-} with { variant "" };
+} with {
+	variant (tlli) "BYTEORDER(last)"
+};
 
 
 type union PCUIF_MsgUnion {

-- 
To view, visit https://gerrit.osmocom.org/14192
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: I4da6e9d7c5dfbd0e017d2a63c6474da700c38e52
Gerrit-Change-Number: 14192
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190527/b2c53be7/attachment.html>


More information about the gerrit-log mailing list