Change in osmo-ttcn3-hacks[master]: msc: add tests for SMS and voice call while Paging

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

neels gerrit-no-reply at lists.osmocom.org
Wed Nov 27 22:59:41 UTC 2019


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16297 )


Change subject: msc: add tests for SMS and voice call while Paging
......................................................................

msc: add tests for SMS and voice call while Paging

Start a second
- MT SMS
- MT call
while a Paging is already ongoing.

The second trans being an SMS works.

The second trans being a call fails with current osmo-msc master; a fix is in
the related patch (s.b.).

Related: Idd4537b5f4817d17e5c87d9a93775a32aee0e7be
Change-Id: Ieeae6322d4e80893ea3408c6b74bf8e32bea8e46
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
2 files changed, 129 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/97/16297/1

diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 0846c04..aaacd06 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -1754,22 +1754,25 @@
 	f_mo_sms_wait_rp_ack(spars);
 }
 
+function f_mt_sms_expect_deliver_pdu(in SmsParameters spars)
+runs on BSC_ConnHdlr
+return template PDU_DTAP_MT {
+	var template TPDU_RP_DATA_SGSN_MS tp_mt := tr_SMS_DELIVER(?, spars.tp.ud, spars.tp.pid, spars.tp.dcs, ?);
+	var template RPDU_SGSN_MS rp_mt := tr_RP_DATA_MT(?, ?, omit, tp_mt);
+	var template PDU_ML3_NW_MS l3_mt := tr_ML3_MT_SMS(?, c_TIF_ORIG, tr_CP_DATA_MT(rp_mt));
+	return tr_PDU_DTAP_MT(l3_mt, spars.dlci);
+}
+
 /* Wait for MT SMS on an already existing DTAP connection */
 function f_mt_sms_expect(inout SmsParameters spars)
 runs on BSC_ConnHdlr {
 	var template (value) PDU_ML3_MS_NW l3_mo;
-	var template TPDU_RP_DATA_SGSN_MS tp_mt;
-	var template RPDU_SGSN_MS rp_mt;
-	var template PDU_ML3_NW_MS l3_mt;
 	var PDU_DTAP_MT dtap_mt;
 
 	var default d := activate(as_other_sms());
 
 	/* Expect CP-DATA(RP-DATA(SMS-DELIVER)) */
-	tp_mt := tr_SMS_DELIVER(?, spars.tp.ud, spars.tp.pid, spars.tp.dcs, ?);
-	rp_mt := tr_RP_DATA_MT(?, ?, omit, tp_mt);
-	l3_mt := tr_ML3_MT_SMS(?, c_TIF_ORIG, tr_CP_DATA_MT(rp_mt));
-	BSSAP.receive(tr_PDU_DTAP_MT(l3_mt, spars.dlci)) -> value dtap_mt;
+	BSSAP.receive(f_mt_sms_expect_deliver_pdu(spars)) -> value dtap_mt;
 
 	/* Extract relevant identifiers */
 	spars.tid := bit2int(dtap_mt.dtap.tiOrSkip.transactionId.tio);
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 480ec96..1b28b19 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -165,6 +165,14 @@
 	};
 }
 
+private function f_logp(charstring log_msg) runs on BSC_ConnHdlr
+{
+        // log on TTCN3 log output
+        log(log_msg);
+        // log in stderr log
+	f_vty_transceive(MSCVTY, "logp lglobal notice " & log_msg);
+}
+
 /* altstep for the global guard timer (only used when BSSAP_DIRECT
  * is used for communication */
 private altstep as_Tguard_direct() runs on MTC_CT {
@@ -1895,6 +1903,54 @@
 	vc_conn.done;
 }
 
+/* SMS added while already Paging */
+friend function f_tc_lu_and_mt_sms_already_paging(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+	var SmsParameters spars := valueof(t_SmsPars);
+	var OCT4 tmsi;
+
+	f_init_handler(pars);
+
+	/* Perform location update and call */
+	f_perform_lu();
+
+	/* register an 'expect' for given IMSI (+TMSI) */
+	if (isvalue(g_pars.tmsi)) {
+		tmsi := g_pars.tmsi;
+	} else {
+		tmsi := 'FFFFFFFF'O;
+	}
+	f_ran_register_imsi(g_pars.imsi, tmsi);
+
+	f_logp("first SMS");
+	f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS");
+
+	/* MSC->BSC: expect PAGING from MSC */
+	f_expect_paging();
+
+	f_logp("second SMS");
+	/* Now osmo-msc is in state "Paging pending", make sure that another SMS to be sent at this time just joins in
+	 * with the pending paging. Another SMS: */
+	f_vty_sms_send(hex2str(pars.imsi), "2342", "Another SMS");
+
+	/* Establish DTAP / BSSAP / SCCP connection */
+	f_establish_fully(EST_TYPE_PAG_RESP);
+
+	spars.tp.ud := 'C8329BFD064D9B53'O;
+	f_mt_sms(spars);
+
+	spars.tp.ud := '41F79B8E2ECB41D3E614'O;
+	f_mt_sms(spars);
+
+	f_expect_clear();
+}
+testcase TC_lu_and_mt_sms_already_paging() runs on MTC_CT {
+	var BSC_ConnHdlrPars pars;
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+	pars := f_init_pars(43);
+	vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms_already_paging), pars);
+	vc_conn.done;
+}
 
 /* Paging for MT SMS but no response */
 friend function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
@@ -4915,6 +4971,67 @@
 	vc_conn.done;
 }
 
+/* MT call while already Paging */
+friend function f_tc_lu_and_mt_call_already_paging(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+	var CallParameters cpars := valueof(t_CallParams('123456'H, 0));
+	var SmsParameters spars := valueof(t_SmsPars);
+	var OCT4 tmsi;
+
+	f_init_handler(pars);
+
+	/* Perform location update */
+	f_perform_lu();
+
+	/* register an 'expect' for given IMSI (+TMSI) */
+	if (isvalue(g_pars.tmsi)) {
+		tmsi := g_pars.tmsi;
+	} else {
+		tmsi := 'FFFFFFFF'O;
+	}
+	f_ran_register_imsi(g_pars.imsi, tmsi);
+
+	f_logp("start Paging by an SMS");
+	f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS");
+
+	/* MSC->BSC: expect PAGING from MSC */
+	f_expect_paging();
+
+	f_logp("MNCC signals MT call, before Paging Response");
+	f_mt_call_initate(cpars);
+	f_ran_register_imsi(g_pars.imsi, g_pars.tmsi);
+
+	f_sleep(0.5);
+	f_logp("phone answers Paging, expecting both SMS and MT call to be established");
+	f_establish_fully(EST_TYPE_PAG_RESP);
+	spars.tp.ud := 'C8329BFD064D9B53'O;
+	interleave {
+	[] BSSAP.receive(f_mt_sms_expect_deliver_pdu(spars)) {
+			f_logp("Got SMS-DELIVER");
+		};
+	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_SETUP(cpars.transaction_id, *, cpars.called_party))) {
+			f_logp("Got CC Setup");
+		};
+	}
+	setverdict(pass);
+	f_logp("success, tear down");
+	var default ccrel := activate(as_optional_cc_rel(cpars));
+	if (g_pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClearRequest(0));
+	} else {
+		BSSAP.send(ts_RANAP_IuReleaseRequest(ts_RanapCause_om_intervention));
+	}
+	f_expect_clear();
+	deactivate(ccrel);
+	f_vty_sms_clear(hex2str(g_pars.imsi));
+}
+testcase TC_lu_and_mt_call_already_paging() runs on MTC_CT {
+	var BSC_ConnHdlrPars pars;
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+	pars := f_init_pars(43);
+	vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_call_already_paging), pars);
+	vc_conn.done;
+}
 
 /* Perform a SGSAP LU and then make a CSFB call */
 private function f_tc_sgsap_lu_and_mt_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
@@ -5733,9 +5850,11 @@
 	execute( TC_reset_two() );
 
 	execute( TC_lu_and_mt_call() );
+	execute( TC_lu_and_mt_call_already_paging() );
 
 	execute( TC_lu_and_mo_sms() );
 	execute( TC_lu_and_mt_sms() );
+	execute( TC_lu_and_mt_sms_already_paging() );
 	execute( TC_lu_and_mt_sms_paging_and_nothing() );
 	execute( TC_lu_and_mt_sms_paging_repeated() );
 	execute( TC_smpp_mo_sms() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16297
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ieeae6322d4e80893ea3408c6b74bf8e32bea8e46
Gerrit-Change-Number: 16297
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191127/da8a5711/attachment.htm>


More information about the gerrit-log mailing list