From 0e6c9f5477bcc8f2e7b091046ac523e9eb13665b Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 15 Jun 2019 01:01:28 +0700 Subject: 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 --- msc/MSC_Tests.ttcn | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'msc/MSC_Tests.ttcn') diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 2c898fcb..c57328f3 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -3453,6 +3453,55 @@ testcase TC_lu_and_ss_session_timeout() runs on MTC_CT { 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 @@ control { 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() ); -- cgit v1.2.3