diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-12-14 17:50:30 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-12-14 18:30:53 +0100 |
commit | 799c97bb9d473f0873294fe14cd8913043dfd8d9 (patch) | |
tree | 3b08cf20a9df4aef58427ac46b423099f79d67eb /bsc | |
parent | 618ef6457434a11b0e736024e5a5224c9b26c28c (diff) |
BSC_Tests: Add TC_chan_exhaustion to test for channel exhaustion
We ensure that all channels are allocated, and that the first allocation
beyond the avialable channels will fail and generate an IMM_ASS_REJ.
WE also verify that the related counters are incremented as expected.
Change-Id: Iade77321588190cec89cfcd9c18d84a7144e0198
Diffstat (limited to 'bsc')
-rw-r--r-- | bsc/BSC_Tests.ttcn | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 9cdfe273..5988b282 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -25,6 +25,9 @@ import from RSL_Tests all; const integer NUM_BTS := 3; const float T3101_MAX := 12.0; +/* make sure to sync this with the osmo-bts.cfg you're using */ +const integer NUM_TCHF_PER_BTS := 5; + /* BSC specific CTRL helper functions */ function f_ctrl_get_bts(IPA_CTRL_PT pt, integer bts_nr, charstring suffix) return CtrlValue { @@ -331,6 +334,53 @@ testcase TC_chan_act_nack() runs on test_CT { setverdict(pass); } +/* Test for channel exhaustion due to RACH overload */ +testcase TC_chan_exhaustion() runs on test_CT { + var ASP_RSL_Unitdata rsl_ud; + var integer i; + var integer chreq_total, chreq_nochan; + + f_init(); + f_bssap_reset(); + + chreq_total := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total"); + chreq_nochan := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel"); + + /* expect 5xTCH/F to succeed */ + for (i := 0; i < NUM_TCHF_PER_BTS; i := i+1) { + f_chreq_act_ack('23'O, i); + } + + IPA_RSL[0].clear; + + f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", chreq_total+NUM_TCHF_PER_BTS); + + /* now expect additional channel activations to fail */ + f_ipa_tx(0, ts_RSL_CHAN_RQD('42'O, 42)); + + alt { + [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, + tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) { + setverdict(fail, "Received CHAN ACT ACK without resources?!?"); + } + [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_IMM_ASSIGN(?))) -> value rsl_ud { + var GsmRrMessage rr; + /* match on IMM ASS REJ */ + rr := dec_GsmRrMessage(rsl_ud.rsl.ies[1].body.full_imm_ass_info.payload); + if (rr.header.message_type == IMMEDIATE_ASSIGNMENT_REJECT) { + f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", + chreq_total+NUM_TCHF_PER_BTS+1); + f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel", + chreq_nochan+1); + setverdict(pass); + } else { + repeat; + } + } + [] IPA_RSL[0].receive { repeat; } + } +} + type record DchanTuple { integer sccp_conn_id, @@ -1012,6 +1062,7 @@ control { execute( TC_chan_act_ack_est_ind_noreply() ); execute( TC_chan_act_ack_est_ind_refused() ); execute( TC_chan_act_nack() ); + execute( TC_chan_exhaustion() ); execute( TC_chan_rel_rll_rel_ind() ); execute( TC_chan_rel_conn_fail() ); execute( TC_chan_rel_hard_clear() ); |