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

laforge gerrit-no-reply at lists.osmocom.org
Fri Jun 14 21:49:58 UTC 2019


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

Change subject: MSC_Tests.ttcn: introduce TC_mt_ussd_for_unknown_subscr
......................................................................

MSC_Tests.ttcn: introduce TC_mt_ussd_for_unknown_subscr

The idea of this test case is to check that OsmoMSC properly
rejects SS/USSD requests for unknown subscribers.

Running this test case against the current OsmoMSC helped
to discover several problems:

  - OsmoMSC doesn't print anything in such cases;
  - IMSI in the response error message is empty;
  - both session state and ID IEs are omited;

which are going to be fixed soon.

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

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



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 2c898fc..c57328f 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -3453,6 +3453,55 @@
 	f_vty_config(MSCVTY, "msc", "ncss guard-timeout 0");
 }
 
+/* MT (network-originated) USSD for unknown subscriber */
+friend function f_tc_mt_ussd_for_unknown_subscr(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+	var hexstring imsi := '000000000000000'H; /* Some unknown IMSI */
+	var OCT4 sid := '20000222'O;
+	timer T := 2.0;
+
+	f_init_handler(pars);
+	f_ran_register_imsi(imsi, 'FFFFFFFF'O);
+	f_create_gsup_expect(hex2str(imsi));
+
+	var template (value) GSUP_PDU gsup_req := ts_GSUP_PROC_SS_REQ(
+		imsi := imsi,
+		sid := sid,
+		state := OSMO_GSUP_SESSION_STATE_BEGIN,
+		ss := f_rnd_octstring(23)
+	);
+
+	/* Error with cause GMM_CAUSE_IMSI_UNKNOWN */
+	var template GSUP_PDU gsup_rsp := tr_GSUP_PROC_SS_ERR(
+		imsi := imsi,
+		sid := sid,
+		state := OSMO_GSUP_SESSION_STATE_END,
+		cause := 2 /* FIXME: introduce an enumerated type! */
+	);
+
+	/* Initiate a MT USSD notification */
+	GSUP.send(gsup_req);
+
+	/* Expect GSUP PROC_SS_ERROR message */
+	T.start;
+	alt {
+	[] GSUP.receive(gsup_rsp) {
+		setverdict(pass);
+		};
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for GSUP PROC_SS_ERROR message");
+		}
+	/* We don't expect anything else */
+	[] as_unexp_gsup_or_bssap_msg();
+	}
+}
+testcase TC_mt_ussd_for_unknown_subscr() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+	vc_conn := f_start_handler(refers(f_tc_mt_ussd_for_unknown_subscr), 0);
+	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 {
@@ -5301,6 +5350,8 @@
 	execute( TC_lu_and_mo_ussd_mo_release() );
 	execute( TC_lu_and_ss_session_timeout() );
 
+	execute( TC_mt_ussd_for_unknown_subscr() );
+
 	execute( TC_cipher_complete_with_invalid_cipher() );
 	execute( TC_cipher_complete_1_without_cipher() );
 	execute( TC_cipher_complete_3_without_cipher() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14450
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: Id35cd3ec15d1bab15260312d7bbb41e2d10349fe
Gerrit-Change-Number: 14450
Gerrit-PatchSet: 3
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/20190614/3c09fb04/attachment.html>


More information about the gerrit-log mailing list