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
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);
@@ -696,17 +713,6 @@
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);
BSSAP.send(ass_cmd);
@@ -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 {