From be1ff4b1773c53a7ee4ae96fd429d9c6f6d168ea Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 18 Jan 2019 15:04:13 +0700 Subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_rp_mr The idea of this test case is to verify SM-RP-MR assignment for a few MT SMS being sent over GSUP. Basically, the algorythm is the following: 1.0 send the 1st SMS using MT-ForwardSM-Req on GSUP, 1.1 expect Paging Request on RAN, 1.2 establish a RAN connection, 1.3 expect CP-DATA/RP-DATA for the 1st SMS, 2.0 send the 2nd SMS using MT-ForwardSM-Req on GSUP, 2.1 expect CP-DATA/RP-DATA for the 2nd SMS, 3.0 compare both SM-RP-MR values assigned by the MSC, 3.1 send CP-DATA/RP-ACK for both 1st and 2nd SMS messages, 3.2 expect MT-ForwardSM-Res for both 1st and 2nd SMS messages. The SM-RP-MR values for both 1st and 2nd messages shall not match. Change-Id: I3a52d44f4abde9b6b471b9108c1cee905884c9bc --- msc/MSC_Tests.ttcn | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) (limited to 'msc/MSC_Tests.ttcn') diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index a8f37bd9..fb0798ce 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2409,6 +2409,118 @@ testcase TC_gsup_mt_sms_err() runs on MTC_CT { f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } +/* Test SM-RP-MR assignment for MT-SMS over GSUP */ +private function f_tc_gsup_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + var SmsParameters spars1 := valueof(t_SmsPars); /* 1st SMS */ + var SmsParameters spars2 := valueof(t_SmsPars); /* 2nd SMS */ + + f_init_handler(pars); + + /* We need to inspect GSUP activity */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Perform location update */ + f_perform_lu(); + + /* Register an 'expect' for given IMSI (+TMSI) */ + if (isvalue(g_pars.tmsi)) { + f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + } else { + f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + } + + /* Submit the 1st MT SMS on GSUP */ + log("TX MT-forwardSM-Req for the 1st SMS"); + f_gsup_forwardSM_req(spars1); + + /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */ + BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_establish_fully(EST_TYPE_PAG_RESP); + + /* Wait for 1st MT SMS on DTAP */ + f_mt_sms_expect(spars1); + log("RX the 1st SMS on DTAP, DTAP TID is ", spars1.tid, + ", SM-RP-MR is ", spars1.rp.msg_ref); + + /* Submit the 2nd MT SMS on GSUP */ + log("TX MT-forwardSM-Req for the 2nd SMS"); + f_gsup_forwardSM_req(spars2); + + /* Wait for 2nd MT SMS on DTAP */ + f_mt_sms_expect(spars2); + log("RX the 2nd SMS on DTAP, DTAP TID is ", spars2.tid, + ", SM-RP-MR is ", spars2.rp.msg_ref); + + /* Both transaction IDs shall be different */ + if (spars1.tid == spars2.tid) { + log("Both DTAP transaction IDs shall be different"); + setverdict(fail); + } + + /* Both SM-RP-MR values shall be different */ + if (spars1.rp.msg_ref == spars2.rp.msg_ref) { + log("Both SM-RP-MR values shall be different"); + setverdict(fail); + } + + /* Both SM-RP-MR values shall be assigned */ + if (spars1.rp.msg_ref == 'FF'O) { + log("Unassigned SM-RP-MR value for the 1st SMS"); + setverdict(fail); + } + if (spars2.rp.msg_ref == 'FF'O) { + log("Unassigned SM-RP-MR value for the 2nd SMS"); + setverdict(fail); + } + + /* Send the 1st RP-ACK and expect MT-forwardSM-Res on GSUP */ + f_mt_sms_send_rp_ack(spars1); + alt { + [] GSUP.receive(tr_GSUP_MT_FORWARD_SM_RES( + imsi := g_pars.imsi, + sm_rp_mr := spars1.rp.msg_ref + )) { + log("RX MT-forwardSM-Res (RP-ACK)"); + setverdict(pass); + } + [] GSUP.receive { + log("RX unexpected GSUP message"); + setverdict(fail); + mtc.stop; + } + } + + /* Send the 2nd RP-ACK and expect MT-forwardSM-Res on GSUP */ + f_mt_sms_send_rp_ack(spars2); + alt { + [] GSUP.receive(tr_GSUP_MT_FORWARD_SM_RES( + imsi := g_pars.imsi, + sm_rp_mr := spars2.rp.msg_ref + )) { + log("RX MT-forwardSM-Res (RP-ACK)"); + setverdict(pass); + } + [] GSUP.receive { + log("RX unexpected GSUP message"); + setverdict(fail); + mtc.stop; + } + } + + f_expect_clear(); +} +testcase TC_gsup_mt_sms_rp_mr() 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"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_rp_mr), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + /* Test multi-part MT-SMS over GSUP */ private function f_tc_gsup_mt_multi_part_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -4344,6 +4456,7 @@ control { execute( TC_gsup_mo_smma() ); execute( TC_gsup_mt_sms_ack() ); execute( TC_gsup_mt_sms_err() ); + execute( TC_gsup_mt_sms_rp_mr() ); execute( TC_gsup_mt_multi_part_sms() ); execute( TC_lu_and_mo_ussd_single_request() ); -- cgit v1.2.3