diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-01-09 19:55:40 +0100 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-01-12 13:11:39 +0000 |
commit | c675b6119c52d8ee9012ba6e4db800409b5b34e2 (patch) | |
tree | 3925e856378d5328962e0b20497a5c979425ac2e | |
parent | d0575c2fd816bb6a594cd21012ea1421434f3808 (diff) |
bsc: Introduce test TC_chan_rel_sccp_tiar_timeout
Verify SCCP T(iar) timeout triggers release of established channel.
Change-Id: Ic2724f62689b99c33e2e5c3a0c2fd022178a788c
-rw-r--r-- | bsc/BSC_Tests.ttcn | 34 | ||||
-rw-r--r-- | bsc/expected-results.xml | 1 | ||||
-rw-r--r-- | library/Osmocom_VTY_Functions.ttcn | 6 |
3 files changed, 41 insertions, 0 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 9c8d68d2..d020d953 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -97,6 +97,11 @@ type component test_CT extends CTRL_Adapter_CT { /* Osmux is enabled through VTY */ var boolean g_osmux_enabled := false; + /*Configure T(tias) over VTY, seconds */ + var integer g_bsc_sccp_timer_ias := 7 * 60; + /*Configure T(tiar) over VTY, seconds */ + var integer g_bsc_sccp_timer_iar := 15 * 60; + /* global test case guard timer */ timer T_guard := 30.0; @@ -332,6 +337,8 @@ function f_init_vty(charstring id := "foo") runs on test_CT { map(self:BSCVTY, system:BSCVTY); f_vty_set_prompts(BSCVTY); f_vty_transceive(BSCVTY, "enable"); + f_cs7_inst_0_cfg(BSCVTY, {"sccp-timer ias " & int2str(g_bsc_sccp_timer_ias), + "sccp-timer iar " & int2str(g_bsc_sccp_timer_iar)}); } /* global initialization function @@ -1064,6 +1071,23 @@ testcase TC_chan_rel_a_reset() runs on test_CT { setverdict(pass); } +/* Verify T(iar) triggers and releases the channel */ +testcase TC_chan_rel_sccp_tiar_timeout() runs on test_CT { + var DchanTuple dt; + + /* Set T(iar) in BSC 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_bsc_sccp_timer_ias := 2; + g_bsc_sccp_timer_iar := 5; + + f_init(1); + + dt := f_est_dchan('23'O, 23, '00010203040506'O); + f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false); + setverdict(pass); +} + /* Test behavior if RSL EST IND for non-active channel */ testcase TC_rll_est_ind_inact_lchan() runs on test_CT { timer T := 2.0; @@ -3632,6 +3656,15 @@ private function f_bts_0_cfg(Commands cmds := {}) runs on MSC_ConnHdlr f_vty_transceive(BSCVTY, "end"); } +private function f_cs7_inst_0_cfg(TELNETasp_PT pt, Commands cmds := {}) +{ + f_vty_enter_cfg_cs7_inst(pt, 0); + for (var integer i := 0; i < sizeof(cmds); i := i+1) { + f_vty_transceive(pt, cmds[i]); + } + f_vty_transceive(pt, "end"); +} + private function f_probe_for_handover(charstring log_label, charstring log_descr, charstring handover_vty_cmd, @@ -4419,6 +4452,7 @@ control { execute( TC_chan_rel_hard_rlsd() ); execute( TC_chan_rel_hard_rlsd_ms_dead() ); execute( TC_chan_rel_a_reset() ); + execute( TC_chan_rel_sccp_tiar_timeout() ); execute( TC_outbound_connect() ); diff --git a/bsc/expected-results.xml b/bsc/expected-results.xml index eb932ef1..e2666602 100644 --- a/bsc/expected-results.xml +++ b/bsc/expected-results.xml @@ -19,6 +19,7 @@ <testcase classname='BSC_Tests' name='TC_chan_rel_hard_rlsd' time='MASKED'/> <testcase classname='BSC_Tests' name='TC_chan_rel_hard_rlsd_ms_dead' time='MASKED'/> <testcase classname='BSC_Tests' name='TC_chan_rel_a_reset' time='MASKED'/> + <testcase classname='BSC_Tests' name='TC_chan_rel_sccp_tiar_timeout' time='MASKED'/> <testcase classname='BSC_Tests' name='TC_outbound_connect' time='MASKED'/> <testcase classname='BSC_Tests' name='TC_assignment_cic_only' time='MASKED'/> <testcase classname='BSC_Tests' name='TC_assignment_csd' time='MASKED'/> diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index a1724e91..823d79fb 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -102,6 +102,7 @@ module Osmocom_VTY_Functions { type integer BtsTrxNr (0..255); type integer BtsTimeslotNr (0..7); type integer MscNr (0..255); + type integer Cs7Nr (0..255); type charstring BtsGprsMode ("none", "gprs", "egrps"); @@ -135,6 +136,11 @@ module Osmocom_VTY_Functions { f_vty_transceive(pt, "msc " & int2str(msc)); } + function f_vty_enter_cfg_cs7_inst(TELNETasp_PT pt, Cs7Nr cs7_inst := 0) { + f_vty_enter_config(pt); + f_vty_transceive(pt, "cs7 instance " & int2str(cs7_inst)); + } + type record of charstring rof_charstring; function f_vty_config2(TELNETasp_PT pt, rof_charstring config_nodes, charstring cmd) { |