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

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

laforge gerrit-no-reply at lists.osmocom.org
Sun Jun 16 17:18:05 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14476 )

Change subject: MSC_Tests.ttcn: introduce TC_proc_ss_abort
......................................................................

MSC_Tests.ttcn: introduce TC_proc_ss_abort

This test case is aimed to verify HLR-/EUSE-initiated abort of an
active SS/USSD session according to the following scenario:

  1. (HLR/EUSE -> MSC) GSUP_PROC_SS_REQ with random facility;
  2. Network-originated connection establishment:
  2.a. (MSC -> BSC -> MS) Paging Request;
  2.b. ...
  2.c. (MS -> BSC -> MSC) Paging Response;
  3. (MSC -> MS) GSM 04.80 REGISTER with random facility;
  4. (HLR/EUSE -> MSC) GSUP_PROC_SS_ERR (abort);
  5. (MSC -> MS) GSM 04.80 RELEASE COMPLETE;
  6. Connection release.

As can be seen, HLR/EUSE initiates the session abort right after
the GSM 04.80 REGISTER message is delivered to the MS, and just
before the MS sends anything back in response.

Change-Id: I5586a88136c936441a842f49248824680603672e
Related: OS#2931
---
M msc/MSC_Tests.ttcn
1 file changed, 86 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index b5a3ba7..b0834a4 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -3608,6 +3608,91 @@
 	vc_conn.done;
 }
 
+/* MT (network-originated) USSD followed by immediate abort */
+friend function f_tc_proc_ss_abort(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+	var octetstring facility := f_rnd_octstring(23);
+	var OCT4 sid := '20000555'O;
+	timer TP := 2.0;
+
+	f_init_handler(pars);
+
+	/* Perform location update */
+	f_perform_lu();
+
+	f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O);
+	f_create_gsup_expect(hex2str(g_pars.imsi));
+
+	/* PROC_SS_REQ initiates a mobile-originated SS/USSD session */
+	var template (value) GSUP_PDU gsup_req := ts_GSUP_PROC_SS_REQ(
+		imsi := g_pars.imsi, sid := sid,
+		state := OSMO_GSUP_SESSION_STATE_BEGIN,
+		ss := facility
+	);
+
+	/* On the MS side, we expect GSM 04.80 REGISTER message */
+	var template PDU_ML3_NW_MS dtap_reg := tr_ML3_MT_SS_REGISTER(
+		tid := 0, /* Most likely, it should be 0 */
+		ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */
+		facility := facility
+	);
+
+	/* PROC_SS_ERR with SESSION_STATE_END terminates the SS/USSD session */
+	var template (value) GSUP_PDU gsup_abort := ts_GSUP_PROC_SS_ERR(
+		imsi := g_pars.imsi, sid := sid,
+		state := OSMO_GSUP_SESSION_STATE_END,
+		cause := 0 /* FIXME: introduce an enumerated type! */
+	);
+
+	/* On the MS side, we expect GSM 04.80 REGISTER message */
+	var template PDU_ML3_NW_MS dtap_rel := tr_ML3_MT_SS_RELEASE_COMPLETE(
+		tid := 0, /* Most likely, it should be 0 */
+		ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */
+		cause := *, /* FIXME: expect some specific cause value */
+		facility := omit
+	);
+
+	/* Initiate a MT USSD with random payload */
+	GSUP.send(gsup_req);
+
+	/* Expect Paging Request */
+	TP.start;
+	alt {
+	[pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) {
+		setverdict(pass);
+		}
+	[not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) {
+		setverdict(pass);
+		}
+	/* We don't expect anything else */
+	[] as_unexp_gsup_or_bssap_msg();
+	[] TP.timeout {
+		setverdict(fail, "Timeout waiting for Paging Request");
+		}
+	}
+
+	/* Send Paging Response and establish connection */
+	f_establish_fully(EST_TYPE_PAG_RESP);
+	/* Expect MT REGISTER message with random facility */
+	f_expect_mt_dtap_msg(dtap_reg);
+
+	/* HLR/EUSE decides to abort the session even
+	 * before getting any response from the MS */
+	 /* Initiate a MT USSD with random payload */
+	GSUP.send(gsup_abort);
+
+	/* Expect RELEASE COMPLETE on ths MS side */
+	f_expect_mt_dtap_msg(dtap_rel);
+
+	f_expect_clear();
+}
+testcase TC_proc_ss_abort() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+	vc_conn := f_start_handler(refers(f_tc_proc_ss_abort), 102);
+	vc_conn.done;
+}
+
 
 /* A5/1 only permitted on network side; attempt an invalid CIPHER MODE COMPLETE with A5/3 which MSC should reject. */
 private function f_tc_cipher_complete_with_invalid_cipher(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
@@ -5459,6 +5544,7 @@
 	execute( TC_mt_ussd_for_unknown_subscr() );
 	execute( TC_proc_ss_for_unknown_session() );
 	execute( TC_proc_ss_paging_fail() );
+	execute( TC_proc_ss_abort() );
 
 	execute( TC_cipher_complete_with_invalid_cipher() );
 	execute( TC_cipher_complete_1_without_cipher() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14476
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: I5586a88136c936441a842f49248824680603672e
Gerrit-Change-Number: 14476
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190616/45f0b4da/attachment.htm>


More information about the gerrit-log mailing list