neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31711 )
Change subject: msc: detect RTP to CN failure in call tests ......................................................................
msc: detect RTP to CN failure in call tests
When CN RTP is missing, the X2 timer will fire after all other call signalling looks successful. So far we establish an MT call, wait three seconds and directly disconnect, long before X2 or X2427 can fire.
Make X2 shorter. (By means of f_vty_config() from ttcn, so that we don't need to edit various osmo-msc.cfg in various repositories. The short timer is always critical for the test to be accurate.)
Add proper function to detect premature disconnect. Otherwise we just get a cryptic message like "Couldn't find MnccExpect for incoming call" because of MNCC messaging after the unexpected release event.
Change-Id: I3ccf541360cc8440e664f0e29494b9ce7b6f8943 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 54 insertions(+), 4 deletions(-)
Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve msuraev: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index fe9187c..d96ae0b 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -1349,6 +1349,33 @@ setverdict(pass); }
+function f_call_keep_open(inout CallParameters cpars, float open_time := 5.0) +runs on BSC_ConnHdlr { + log("Hold the call for some time"); + + timer T := open_time; + T.start; + alt { + [] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref)); + [] MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref)); + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + [] BSSAP.receive(tr_BSSMAP_ClearCommand); + [] BSSAP.receive(tr_BSSMAP_ClearCommandCSFB); + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)); + + [] T.timeout { + log("Call stayed open for ", open_time, " seconds, all is well.") + setverdict(pass); + return; + } + } + + setverdict(fail, "An unexpected release event disconnected the active call prematurely"); + mtc.stop; +} + /* Reply to a received CRCX with an OK (or the reply configured in cpars), using the given parameters. * Return true when an OK reply was sent, false otherwise. * Count occurence of Osmux, include Osmux parameters in the reply if necessary. */ @@ -1797,8 +1824,7 @@
f_mt_call_establish(cpars);
- log("Hold the call for some time"); - f_sleep(3.0); + f_call_keep_open(cpars);
log("Hangup"); f_call_hangup(cpars, true); @@ -1811,8 +1837,7 @@
f_mo_call_establish(cpars);
- log("Hold the call for some time"); - f_sleep(3.0); + f_call_keep_open(cpars);
log("Hangup"); f_call_hangup(cpars, false); diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 0490901..8fc212c 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -324,6 +324,10 @@ f_vty_config(MSCVTY, "msc", "osmux off"); }
+ /* Configure the MGCP timeout so that a failure to set up all RTP streams triggers within the time that we keep + * an otherwise established call open. */ + f_vty_config(MSCVTY, "msc", "timer mgw X2 3"); + for (var integer i := 0; i < num_bsc; i := i + 1) { if (isbound(mp_bssap_cfg[i])) { var RanOps ranops := BSC_RanOps;