From 3716a5e364545d3c022981414e15514b2bab962e Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 21 Mar 2018 15:53:35 +0100 Subject: BSC_Tests: split up f_mt_call and f_mo_call The functions f_mt_call and f_mo_call establish a call, hold it for 3 sec. and tear it down again. However, there may be test situation where one wants to establish a call and then hold it in order to perform other actions. - split up the function into an _establish and _hangup part. - add a replacement f_mt_call and f_mo_call function for the already existing testcases Change-Id: I0da9cf64d10de4036eb037ef5e491bfe3088670b --- msc/BSC_ConnectionHandler.ttcn | 95 ++++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 72e2a4e7..62eddf37 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -405,14 +405,12 @@ template (value) CallParameters t_CallParams(hexstring called, integer tid) := { mgcp_connection_id_mss := '0'H // }; - -function f_mt_call(inout CallParameters cpars) +function f_mt_call_establish(inout CallParameters cpars) runs on BSC_ConnHdlr { var MobileIdentityLV mi; var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; - var boolean respond_to_dlcx; f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); @@ -494,45 +492,10 @@ runs on BSC_ConnHdlr { BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CONNECT(cpars.transaction_id))); MNCC.receive(tr_MNCC_SETUP_cnf(cpars.mncc_callref)); - /* FIXME */ - f_sleep(3.0); - - /* Hangup by "A" side */ - MNCC.send(ts_MNCC_DISC_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); - - if (false) { - /* A-side (PLMN) Release of call */ - MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(42)))); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); - } else { - /* B-side (MS) Release of call */ - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_RELEASE(cpars.transaction_id, '1'B, '0000000'B))); - MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id))); - } - - respond_to_dlcx := not (isbound(cpars.mgw_drop_dlcx) and valueof(cpars.mgw_drop_dlcx)); - - /* clearing of radio channel */ - interleave { - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - } - [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { - if (respond_to_dlcx) { - /* TODO: For one or all connections on EP? */ - MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); - f_create_mgcp_delete_ep(cpars.mgcp_ep); - } - } - } setverdict(pass); } -function f_mo_call(inout CallParameters cpars) +function f_mo_call_establish(inout CallParameters cpars) runs on BSC_ConnHdlr { var MobileIdentityLV mi; @@ -625,16 +588,31 @@ runs on BSC_ConnHdlr { BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CONNECT(cpars.transaction_id))); BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CONNECT_ACK(cpars.transaction_id))); - f_sleep(3.0); + setverdict(pass); +} + +function f_call_hangup(inout CallParameters cpars, boolean release_by_ms) +runs on BSC_ConnHdlr { + + var MobileIdentityLV mi; + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + var boolean respond_to_dlcx; - /* Hangup by "B" side */ MNCC.send(ts_MNCC_DISC_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); - /* Release of call */ - MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(42)))); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); + if (release_by_ms) { + /* B-side (MS) Release of call */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_RELEASE(cpars.transaction_id, '1'B, '0000000'B))); + MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id))); + } else { + /* A-side (PLMN) Release of call */ + MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(42)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); + } respond_to_dlcx := not (isbound(cpars.mgw_drop_dlcx) and valueof(cpars.mgw_drop_dlcx)); @@ -652,6 +630,33 @@ runs on BSC_ConnHdlr { } } } + + setverdict(pass); +} + +function f_mt_call(inout CallParameters cpars) +runs on BSC_ConnHdlr { + + f_mt_call_establish(cpars); + + /* Hold the call for some time */ + f_sleep(3.0); + + f_call_hangup(cpars, true); + + setverdict(pass); +} + +function f_mo_call(inout CallParameters cpars) +runs on BSC_ConnHdlr { + + f_mo_call_establish(cpars); + + /* Hold the call for some time */ + f_sleep(3.0); + + f_call_hangup(cpars, false); + setverdict(pass); } -- cgit v1.2.3