aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-01-10 18:03:28 +0100
committerlaforge <laforge@osmocom.org>2020-01-12 13:11:39 +0000
commita42745c93bfe5678303390ea4efe45464db341f4 (patch)
treecbe35a0c200d5be91804515589e1cb40639cb08c
parentc675b6119c52d8ee9012ba6e4db800409b5b34e2 (diff)
msc: Introduce test TC_(iu_)chan_rel_sccp_tiar_timeout
Verify SCCP T(iar) timeout triggers release of established channel. Related: OS#4343 Change-Id: Id6488a262e656f5c8fabb4e81f4797b305eb09e2
-rw-r--r--msc/MSC_Tests.ttcn47
-rw-r--r--msc/MSC_Tests_Iu.ttcn16
-rw-r--r--msc/expected-results.xml1
3 files changed, 64 insertions, 0 deletions
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 177c2f8e..bf7f7489 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -113,6 +113,11 @@ type component MTC_CT extends CTRL_Adapter_CT {
* handler is not active, which means that also no guard timer is
* set up. The following timer will serve as a replacement */
timer Tguard_direct := 60.0;
+
+ /* Configure T(tias) over VTY, seconds */
+ var integer g_msc_sccp_timer_ias := 7 * 60;
+ /* Configure T(tiar) over VTY, seconds */
+ var integer g_msc_sccp_timer_iar := 15 * 60;
}
modulepar {
@@ -337,6 +342,8 @@ function f_init(integer num_bsc := 1, boolean sgsap := false, boolean gsup := tr
f_vty_config(MSCVTY, "msc", "assign-tmsi");
f_vty_config(MSCVTY, "msc", "check-imei-rqd 0");
f_vty_config(MSCVTY, "network", "encryption a5 0");
+ f_vty_config(MSCVTY, "cs7 instance 0", "sccp-timer ias " & int2str(g_msc_sccp_timer_ias));
+ f_vty_config(MSCVTY, "cs7 instance 0", "sccp-timer iar " & int2str(g_msc_sccp_timer_iar));
if (mp_enable_osmux_test) {
if (osmux) {
f_vty_config(MSCVTY, "msc", "osmux on");
@@ -676,6 +683,45 @@ testcase TC_lu_and_mo_call() runs on MTC_CT {
vc_conn.done;
}
+/* Verify T(iar) triggers and releases the channel */
+friend function f_lu_and_mo_call_sccp_tiar_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+ timer T_wait_iar := int2float(5 + 1); /* g_msc_sccp_timer_iar + Give extra time (+1 sec) */
+ f_init_handler(pars);
+ var CallParameters cpars := valueof(t_CallParams);
+ f_perform_lu();
+ f_mo_call_establish(cpars);
+
+ /* Expect the channel cleared upon T(iar) triggered: */
+ T_wait_iar.start;
+ alt {
+ [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {
+ T_wait_iar.stop
+ setverdict(pass);
+ }
+ [] MGCP.receive(tr_DLCX(?)) { repeat; }
+ [] T_wait_iar.timeout {
+ setverdict(fail, "Timeout waiting for T(iar) triggered SCCP RSLD");
+ mtc.stop;
+ }
+ }
+
+ setverdict(pass);
+}
+testcase TC_lu_and_mo_call_sccp_tiar_timeout() runs on MTC_CT {
+ var BSC_ConnHdlr vc_conn;
+
+ /* Set T(iar) in MSC low enough that it will trigger before other side
+ has time to keep alive with a T(ias). Keep recommended ratio of
+ T(iar) >= T(ias)*2 */
+ g_msc_sccp_timer_ias := 2;
+ g_msc_sccp_timer_iar := 5;
+
+ f_init();
+
+ vc_conn := f_start_handler(refers(f_lu_and_mo_call_sccp_tiar_timeout), 89);
+ vc_conn.done;
+}
+
/* Test LU (with authentication enabled), where HLR times out sending SAI response */
friend function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
@@ -5816,6 +5862,7 @@ control {
execute( TC_lu_imsi_timeout_tmsi_realloc() );
execute( TC_cmserv_imsi_unknown() );
execute( TC_lu_and_mo_call() );
+ execute( TC_lu_and_mo_call_sccp_tiar_timeout() );
execute( TC_lu_auth_sai_timeout() );
execute( TC_lu_auth_sai_err() );
execute( TC_lu_clear_request() );
diff --git a/msc/MSC_Tests_Iu.ttcn b/msc/MSC_Tests_Iu.ttcn
index b6b09831..e8945980 100644
--- a/msc/MSC_Tests_Iu.ttcn
+++ b/msc/MSC_Tests_Iu.ttcn
@@ -80,6 +80,21 @@ testcase TC_iu_lu_and_mo_call() runs on MTC_CT {
vc_conn.done;
}
+testcase TC_iu_lu_and_mo_call_sccp_tiar_timeout() runs on MTC_CT {
+ var BSC_ConnHdlr vc_conn;
+
+ /* Set T(iar) in MSC low enough that it will trigger before other side
+ has time to keep alive with a T(ias). Keep recommended ratio of
+ T(iar) >= T(ias)*2 */
+ g_msc_sccp_timer_ias := 2;
+ g_msc_sccp_timer_iar := 5;
+
+ f_init(3);
+
+ vc_conn := f_start_handler(refers(f_lu_and_mo_call_sccp_tiar_timeout), 1019, ran_idx := 2, ran_is_geran := false);
+ vc_conn.done;
+}
+
testcase TC_iu_lu_auth_sai_timeout() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
f_init(3);
@@ -515,6 +530,7 @@ control {
execute( TC_iu_lu_imsi_timeout_tmsi_realloc() );
execute( TC_iu_cmserv_imsi_unknown() );
execute( TC_iu_lu_and_mo_call() );
+ execute( TC_iu_lu_and_mo_call_sccp_tiar_timeout() );
execute( TC_iu_lu_auth_sai_timeout() );
execute( TC_iu_lu_auth_sai_err() );
execute( TC_iu_lu_release_request() );
diff --git a/msc/expected-results.xml b/msc/expected-results.xml
index 074eeb11..e2cca455 100644
--- a/msc/expected-results.xml
+++ b/msc/expected-results.xml
@@ -14,6 +14,7 @@
</testcase>
<testcase classname='MSC_Tests' name='TC_cmserv_imsi_unknown' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_lu_and_mo_call' time='MASKED'/>
+ <testcase classname='MSC_Tests' name='TC_lu_and_mo_call_sccp_tiar_timeout' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_lu_auth_sai_timeout' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_lu_auth_sai_err' time='MASKED'/>
<testcase classname='MSC_Tests' name='TC_lu_clear_request' time='MASKED'/>