Review at https://gerrit.osmocom.org/8110
bsc: f_establish_fully(): Support non-assignment cases If it's a pure signalling procedure (like LU), the MSC will never even send a BSSMAP ASSIGNMENT CMD. Our test suite should be able to produce this kind of behavior by passing "omit" as assignment comamnd to the f_establish_fully() function. Change-Id: I9bb5c8c19518905cf1ce121aa0b433886ec594d5 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 19 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/10/8110/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index fe524dc..991a693 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -675,8 +675,25 @@ } /* establish a channel fully, expecting an assignment matching 'exp' */ -function f_establish_fully_ret(PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl) -runs on MSC_ConnHdlr return PDU_BSSAP { +function f_establish_fully(template (omit) PDU_BSSAP ass_tpl, template PDU_BSSAP exp_ass_cpl) +runs on MSC_ConnHdlr { + f_MscConnHdlr_init(1, "127.0.0.2", "127.0.0.3"); + + f_create_chan_and_exp(); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + /* start ciphering, if requested */ + if (ispresent(g_pars.encr)) { + f_cipher_mode(g_pars.encr.enc_alg, g_pars.encr.enc_key); + } + + /* bail out early if no assignment requested */ + if (istemplatekind(ass_tpl, "omit")) { + return; + } + + var PDU_BSSAP ass_cmd := valueof(ass_tpl); var PDU_BSSAP bssap; timer T := 10.0; var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); @@ -694,17 +711,6 @@ /* determine if the current channel can support the given service or not */ if (not f_channel_compatible(ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr)) { st.is_assignment := true; - } - - f_MscConnHdlr_init(1, "127.0.0.2", "127.0.0.3"); - - f_create_chan_and_exp(); - /* we should now have a COMPL_L3 at the MSC */ - BSSAP.receive(tr_BSSMAP_ComplL3); - - /* start ciphering, if requested */ - if (ispresent(g_pars.encr)) { - f_cipher_mode(g_pars.encr.enc_alg, g_pars.encr.enc_key); } f_create_mgcp_expect(mgcpcrit); @@ -751,12 +757,6 @@ if (not isbound(bssap)) { self.stop; } - return bssap; -} - -function f_establish_fully(PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl) -runs on MSC_ConnHdlr { - var PDU_BSSAP unused := f_establish_fully_ret(ass_cmd, exp_ass_cpl); } type record HandoverState { -- To view, visit https://gerrit.osmocom.org/8110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bb5c8c19518905cf1ce121aa0b433886ec594d5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>