msc: add TC_gsup_mt_sms_lu_delay for X36 (LU delay) timer
Change-Id: I74fa174ea649adb2112c8e471c0e339a2197a08d
Related: osmo-msc.git Ic519cab55d65e47b2636124427dab1a1d80fab78
Related: SYS#6913
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 658923e..056a3c0 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -833,7 +833,8 @@
}
}
-function f_perform_lu(template (omit) MobileIdentityLV use_mi := omit)
+function f_perform_lu(template (omit) MobileIdentityLV use_mi := omit,
+ boolean expect_clear := true)
runs on BSC_ConnHdlr {
var MobileIdentityLV mi;
if (istemplatekind(use_mi, "omit")) {
@@ -866,8 +867,11 @@
f_msc_lu_hlr();
f_mm_imei();
as_accept_reject_lu(g_pars.net.expect_attach_success);
- /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */
- f_expect_clear(verify_vlr_cell_id := g_pars.net.expect_attach_success);
+
+ /* there could be pending SMS or other common procedures by the MSC */
+ if (expect_clear) {
+ f_expect_clear(verify_vlr_cell_id := g_pars.net.expect_attach_success);
+ }
setverdict(pass);
}
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 09004e8..3c707d1 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -3282,6 +3282,65 @@
f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
}
+/* Test X36 (LU delay) timer allowing to deliver MT SMS over the same connection */
+friend function f_TC_gsup_mt_sms_lu_delay(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+ var SmsParameters spars := valueof(t_SmsPars);
+
+ f_init_handler(pars);
+
+ /* We need to inspect GSUP activity */
+ f_create_gsup_expect(hex2str(g_pars.imsi));
+
+ /* Perform location update */
+ f_perform_lu(expect_clear := false);
+
+ /* Register an 'expect' for given IMSI (+TMSI) */
+ f_ran_register_imsi(g_pars.imsi, g_pars.tmsi);
+
+ var template GSUP_PDU mt_forwardSM_res := tr_GSUP_MT_FORWARD_SM_RES(
+ imsi := g_pars.imsi,
+ /* NOTE: MSC should assign RP-MR itself */
+ sm_rp_mr := ?
+ );
+
+ /* Some delay to make sure the connection remains alive */
+ f_sleep(0.5);
+
+ /* Submit a MT SMS on GSUP */
+ f_gsup_forwardSM_req(spars);
+
+ /* Wait for MT SMS on DTAP */
+ f_mt_sms_expect(spars);
+
+ /* Send RP-ACK and expect MT-forwardSM-Res on GSUP */
+ f_mt_sms_send_rp_ack(spars);
+ alt {
+ [] GSUP.receive(mt_forwardSM_res) {
+ log("RX MT-forwardSM-Res (RP-ACK)");
+ setverdict(pass);
+ }
+ [] GSUP.receive {
+ setverdict(fail, "Rx unexpected GSUP message");
+ mtc.stop;
+ }
+ }
+
+ f_expect_clear();
+}
+testcase TC_gsup_mt_sms_lu_delay() runs on MTC_CT {
+ var BSC_ConnHdlrPars pars;
+ var BSC_ConnHdlr vc_conn;
+ f_init();
+ pars := f_init_pars(92);
+ f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+ f_vty_config(MSCVTY, "msc", "timer geran X36 2500"); /* 2.5s */
+ vc_conn := f_start_handler_with_pars(refers(f_TC_gsup_mt_sms_lu_delay), pars);
+ vc_conn.done;
+ f_vty_config(MSCVTY, "msc", "timer geran X36 0");
+ f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
/* convert GSM L3 TON to SMPP_TON enum */
function f_sm_ton_from_gsm(BIT3 ton) return SMPP_TON {
select (ton) {
@@ -7434,6 +7493,7 @@
execute( TC_gsup_mt_sms_rp_mr() );
execute( TC_gsup_mo_mt_sms_rp_mr() );
execute( TC_gsup_mt_multi_part_sms() );
+ execute( TC_gsup_mt_sms_lu_delay() );
execute( TC_lu_and_mo_ussd_single_request() );
execute( TC_lu_and_mt_ussd_notification() );
diff --git a/msc/expected-results.xml b/msc/expected-results.xml
index aad96a7..4b46eca 100644
--- a/msc/expected-results.xml
+++ b/msc/expected-results.xml
@@ -80,6 +80,7 @@
<testcase classname='MSC_Tests' name='TC_gsup_mt_sms_rp_mr' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_gsup_mo_mt_sms_rp_mr' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_gsup_mt_multi_part_sms' time='MASKED'/>
+ <testcase classname='MSC_Tests' name='TC_gsup_mt_sms_lu_delay' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_lu_and_mo_ussd_single_request' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_lu_and_mt_ussd_notification' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_lu_and_mo_ussd_during_mt_call' time='MASKED'/>