fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28214 )
Change subject: BSC_Tests: add TC_chan_alloc_algo_{a,de}scending ......................................................................
BSC_Tests: add TC_chan_alloc_algo_{a,de}scending
Change-Id: Ic74a9cd264320a9a17648f9331b67fb2c2404122 Related: SYS#5460 --- M bsc/BSC_Tests.ttcn 1 file changed, 56 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/14/28214/1
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 04dc806..d7b659e 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -11528,6 +11528,58 @@ f_shutdown_helper(); }
+private function f_TC_chan_alloc_algo(DchanTuple dt, BtsTrxIdx idx) +runs on test_CT { + /* MSC sends an Assignment Request */ + var PDU_BSSAP ass_cmd := f_gen_ass_req(); + ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); + ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); + BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ass_cmd)); + + /* Expect the BSC to allocate a TCH/F channel on the given BTS/TRX */ + var RSL_Message rx_rsl := f_exp_ipa_rx(tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV), idx); + var RslChannelNr chan_nr := rx_rsl.ies[0].body.chan_nr; + f_ipa_tx(ts_RSL_CHAN_ACT_ACK(chan_nr, 23 + 10), idx); + + f_perform_clear_test_ct(dt); +} + +testcase TC_chan_alloc_algo_ascending() runs on test_CT { + /* We need to access BTS2, which has 4 TRXs */ + f_init(nr_bts := 3); + + /* HACK: work around "Couldn't find Expect for CRCX" */ + vc_MGCP.stop; + + f_vty_enter_cfg_bts(BSCVTY, 2); + f_vty_transceive(BSCVTY, "channel allocator ascending"); + f_vty_transceive(BSCVTY, "end"); + + /* Expect the BSC to allocate a TCH channel on BTS2/TRX0 */ + var DchanTuple dt := f_est_dchan('23'O, 23, '00000000'O, {2, 0}); + f_TC_chan_alloc_algo(dt, {2, 0}); + + f_shutdown_helper(); +} + +testcase TC_chan_alloc_algo_descending() runs on test_CT { + /* We need to access BTS2, which has 4 TRXs */ + f_init(nr_bts := 3); + + /* HACK: work around "Couldn't find Expect for CRCX" */ + vc_MGCP.stop; + + f_vty_enter_cfg_bts(BSCVTY, 2); + f_vty_transceive(BSCVTY, "channel allocator descending"); + f_vty_transceive(BSCVTY, "end"); + + /* Expect the BSC to allocate a TCH channel on BTS2/TRX3 */ + var DchanTuple dt := f_est_dchan('23'O, 23, '00000000'O, {2, 0}); + f_TC_chan_alloc_algo(dt, {2, 3}); + + f_shutdown_helper(); +} + control { /* CTRL interface testing */ execute( TC_ctrl_msc_connection_status() ); @@ -11854,6 +11906,10 @@
execute( TC_lost_sdcch_during_assignment() );
+ /* Channel allocator */ + execute( TC_chan_alloc_algo_ascending() ); + execute( TC_chan_alloc_algo_descending() ); + /* Run TC_ho_out_of_this_bsc last, because it may trigger a segfault before osmo-bsc's patch * with change-id I5a3345ab0005a73597f5c27207480912a2f5aae6 */ execute( TC_ho_out_of_this_bsc() );