Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_rp_mr

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Fri Feb 1 18:55:29 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/12627 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_rp_mr
......................................................................

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
---
M msc/MSC_Tests.ttcn
M msc/expected-results.xml
2 files changed, 114 insertions(+), 0 deletions(-)

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



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index a8f37bd..fb0798c 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -2409,6 +2409,118 @@
 	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 @@
 	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() );
diff --git a/msc/expected-results.xml b/msc/expected-results.xml
index aeb2d24..84df264 100644
--- a/msc/expected-results.xml
+++ b/msc/expected-results.xml
@@ -58,6 +58,7 @@
   <testcase classname='MSC_Tests' name='TC_gsup_mo_smma' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_gsup_mt_sms_ack' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_gsup_mt_sms_err' time='MASKED'/>
+  <testcase classname='MSC_Tests' name='TC_gsup_mt_sms_rp_mr' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_gsup_mt_multi_part_sms' time='MASKED'>
     <failure type='fail-verdict'>Tguard timeout
       MSC_Tests.ttcn:MASKED MSC_Tests control part

-- 
To view, visit https://gerrit.osmocom.org/12627
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: I3a52d44f4abde9b6b471b9108c1cee905884c9bc
Gerrit-Change-Number: 12627
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190201/5b1a0fd7/attachment.htm>


More information about the gerrit-log mailing list