From 0e392dd81b6a015a4511fa9db34cffadf526ba9e Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 29 Nov 2018 00:47:54 +0700 Subject: MSC_Tests.ttcn: introduce TC_lu_and_ss_session_timeout The idea of this test case is to verify SS session termination due to expiry of its guard timeout. The timeout value is intentionally set to a few seconds in order to speedup test case execution (we don't want to wait 2 minutes). We expect OsmoMSC to inform both session entities (MS and EUSE) about timeout expiry before releasing the transaction. The MS should receive GSM 04.80 RELEASE COMPLETE message with optional cause, while the EUSE should receive OSMO_GSUP_MSGT_PROC_SS_ERROR. At the moment, it's not clean which cause values should be used: - for GSM 04.80 RELEASE COMPLETE the cause IE is optional, and possible values are defined in GSM TS 04.08, annex G-H. The H.6.7 Cause No. 102 "recovery on timer expiry" seems to be suitable; - for OSMO_GSUP_MSGT_PROC_SS_ERROR the generic cause IE could be used, but actually this IE is not generic at all, and limited by 'gsm48_gmm_cause' enum; so we temporarily expect arbitrary cause values in both messages. Change-Id: I3e1791773d56617172ae27a46889a1ae4d400e2f Depends-on: (OsmoMSC) Icf4d87c45e90324764073e8230e0fb9cb96dd9cb Related: OS#3655 --- msc/MSC_Tests.ttcn | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ msc/expected-results.xml | 1 + 2 files changed, 74 insertions(+) diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 2a6c0341..a0ace4e5 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2694,6 +2694,78 @@ testcase TC_lu_and_mo_ussd_mo_release() runs on MTC_CT { vc_conn.done; } +/* LU followed by MO USSD request and MT Release due to timeout */ +private function f_tc_lu_and_ss_session_timeout(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + f_init_handler(pars); + + /* Perform location update */ + f_perform_lu(); + + /* Send CM Service Request for SS/USSD */ + f_establish_fully(EST_TYPE_SS_ACT); + + /* We need to inspect GSUP activity */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + var template OCTN facility_ms_req := f_USSD_FACILITY_IE_INVOKE( + invoke_id := 1, + op_code := SS_OP_CODE_PROCESS_USS_REQ, + ussd_string := "#release_me"); + + /* Compose MO SS/REGISTER message with request */ + var template (value) PDU_ML3_MS_NW ussd_ms_req := ts_ML3_MO_SS_REGISTER( + tid := 1, /* An arbitrary transaction identifier */ + ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ + facility := valueof(facility_ms_req)); + + /* Compose expected MSC -> HLR message */ + var template GSUP_PDU gsup_ms_req := tr_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + state := OSMO_GSUP_SESSION_STATE_BEGIN, + ss := valueof(facility_ms_req)); + + /* To be used for sending response with correct session ID */ + var GSUP_PDU gsup_ms_req_complete; + + /* Initiate a new SS transaction */ + BSSAP.send(ts_PDU_DTAP_MO(ussd_ms_req)); + /* Expect GSUP request with original Facility IE */ + gsup_ms_req_complete := f_expect_gsup_msg(gsup_ms_req); + + /* Don't respond, wait for timeout */ + f_sleep(3.0); + + var template PDU_ML3_NW_MS dtap_rel := tr_ML3_MT_SS_RELEASE_COMPLETE( + tid := 1, /* Should match the request's tid */ + ti_flag := c_TIF_REPL, /* Sent to the side that originates the TI */ + cause := *, /* TODO: expect some specific value */ + facility := omit); + + var template GSUP_PDU gsup_rel := tr_GSUP_PROC_SS_ERR( + imsi := g_pars.imsi, + sid := gsup_ms_req_complete.ies[1].val.session_id, + state := OSMO_GSUP_SESSION_STATE_END, + cause := ?); /* TODO: expect some specific value */ + + /* Expect release on both interfaces */ + interleave { + [] BSSAP.receive(tr_PDU_DTAP_MT(dtap_rel)) { }; + [] GSUP.receive(gsup_rel) { }; + } + + f_expect_clear(); + setverdict(pass); +} +testcase TC_lu_and_ss_session_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "msc", "ss-guard-timeout 3"); + vc_conn := f_start_handler(refers(f_tc_lu_and_ss_session_timeout), 51); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "ss-guard-timeout 0"); +} + /* TODO (SMS): * different user data lengths * SMPP transaction mode with unsuccessful delivery @@ -2780,6 +2852,7 @@ control { execute( TC_lu_and_mo_ussd_during_mt_call() ); execute( TC_lu_and_mt_ussd_during_mt_call() ); execute( TC_lu_and_mo_ussd_mo_release() ); + execute( TC_lu_and_ss_session_timeout() ); /* Run this last: at the time of writing this test crashes the MSC */ execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); diff --git a/msc/expected-results.xml b/msc/expected-results.xml index 8d9180f8..4a9529e8 100644 --- a/msc/expected-results.xml +++ b/msc/expected-results.xml @@ -68,6 +68,7 @@ + -- cgit v1.2.3