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
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 {