Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mo_smma for MO SMMA over GSUP

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 Jan 4 16:34:25 UTC 2019


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

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mo_smma for MO SMMA over GSUP
......................................................................

MSC_Tests.ttcn: introduce TC_gsup_mo_smma for MO SMMA over GSUP

The idea of this test case is to verify MO SMMA transmission
over GSUP towards HLR. The algorythm is equivalent to MO SMS.

Change-Id: I7abc95b8e416f7308d54e11be11c08586d18e6c5
Related: OS#3587
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
M msc/expected-results.xml
3 files changed, 79 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Stefan Sperling: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index bf83dd3..43a1190 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -837,6 +837,27 @@
 	}
 }
 
+/* Submit a MO RP-SMMA over an already existing DTAP connection */
+function f_mo_smma(inout SmsParameters spars)
+runs on BSC_ConnHdlr {
+	var template (value) RPDU_MS_SGSN rp_mo;
+	var template (value) PDU_ML3_MS_NW l3_mo;
+
+	var default d := activate(as_other_sms());
+
+	/* just in case this is routed to SMPP.. */
+	f_create_smpp_expect(hex2str(spars.tp.da.tP_DA_NoPad.tP_DAValue));
+
+	rp_mo := ts_RP_SMMA_MO(spars.rp.msg_ref);
+	l3_mo := ts_ML3_MO_SMS(spars.tid, c_TIF_ORIG, ts_CP_DATA_MO(rp_mo));
+	BSSAP.send(ts_PDU_DTAP_MO(l3_mo, spars.dlci, true));
+	/* receive CP-ACK for CP-DATA above */
+	BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_SMS(spars.tid, c_TIF_REPL, tr_CP_ACK_MT), spars.dlci));
+
+	deactivate(d);
+	setverdict(pass);
+}
+
 /* Submit a MO-SMS over an already existing DTAP connection */
 function f_mo_sms_submit(inout SmsParameters spars)
 runs on BSC_ConnHdlr {
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 202bce7..ef626bf 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -2098,6 +2098,62 @@
 	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
 }
 
+/* Test MO-SMMA from MS/BTS/BSC towards HLR (via GSUP) */
+private function f_tc_gsup_mo_smma(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+	var SmsParameters spars := valueof(t_SmsPars);
+	var GSUP_PDU gsup_msg_rx;
+
+	f_init_handler(pars);
+
+	/* We need to inspect GSUP activity */
+	f_create_gsup_expect(hex2str(g_pars.imsi));
+
+	/* Perform location update */
+	f_perform_lu();
+
+	/* Send CM Service Request for SMS */
+	f_establish_fully(EST_TYPE_MO_SMS);
+
+	var template GSUP_PDU mo_ReadyForSM := tr_GSUP_MO_READY_FOR_SM_REQ(
+		imsi := g_pars.imsi,
+		sm_rp_mr := spars.rp.msg_ref,
+		sm_alert_rsn := GSUP_SM_ALERT_RSN_TYPE_MEM_AVAIL
+	);
+
+	/* Submit an SMS on DTAP and expect MO-forwardSM-Req on GSUP */
+	f_mo_smma(spars);
+	alt {
+	[] GSUP.receive(mo_ReadyForSM) -> value gsup_msg_rx {
+		log("RX MO-ReadyForSM-Req");
+		log(gsup_msg_rx);
+		setverdict(pass);
+		}
+	[] GSUP.receive {
+		log("RX unexpected GSUP message");
+		setverdict(fail);
+		mtc.stop;
+		}
+	}
+
+	/* Trigger RP-ACK by sending MO-forwardSM-Res */
+	GSUP.send(valueof(ts_GSUP_MO_READY_FOR_SM_RES(
+		imsi := g_pars.imsi,
+		sm_rp_mr := spars.rp.msg_ref)));
+	/* Expect RP-ACK on DTAP */
+	f_mo_sms_wait_rp_ack(spars);
+
+	f_expect_clear();
+}
+testcase TC_gsup_mo_smma() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+	f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+	vc_conn := f_start_handler(refers(f_tc_gsup_mo_smma), 89);
+	vc_conn.done;
+	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) {
@@ -2984,6 +3040,7 @@
 	execute( TC_smpp_mt_sms() );
 
 	execute( TC_gsup_mo_sms() );
+	execute( TC_gsup_mo_smma() );
 
 	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 49ca1e3..b9c60c0 100644
--- a/msc/expected-results.xml
+++ b/msc/expected-results.xml
@@ -64,6 +64,7 @@
   <testcase classname='MSC_Tests' name='TC_smpp_mo_sms' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_smpp_mt_sms' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_gsup_mo_sms' time='MASKED'/>
+  <testcase classname='MSC_Tests' name='TC_gsup_mo_smma' 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'/>

-- 
To view, visit https://gerrit.osmocom.org/11776
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: I7abc95b8e416f7308d54e11be11c08586d18e6c5
Gerrit-Change-Number: 11776
Gerrit-PatchSet: 6
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Stefan Sperling <stsp at stsp.name>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190104/dadee9a2/attachment.htm>


More information about the gerrit-log mailing list