From c741fcb426e550711742fce20275df08fe758e8a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 2 Oct 2021 14:52:28 +0200 Subject: bsc: TC_ho_int: verify TSC in HandoverCommand For intra-BSC handovers, also verify the correct Training Sequence Code in the RR Handover Command (not only in the Channel Activation as added in previous patch). Related: SYS#4895 OS#5244 Related: Iae20df4387c3d75752301bd5daeeea7508966393 (osmo-bsc) Change-Id: I32e3553581eb17812082f1f2ee96cc978e8db668 --- bsc/BSC_Tests.ttcn | 9 ++++++--- bsc/MSC_ConnectionHandler.ttcn | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index e8bb99cf..04e895ad 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -5079,7 +5079,8 @@ private function f_tc_ho_int(charstring id) runs on MSC_ConnHdlr { var HandoverState hs := { rr_ho_cmpl_seen := false, handover_done := false, - old_chan_nr := - + old_chan_nr := -, + expect_target_tsc := BTS_TSC[1] }; /* issue hand-over command on VTY, from BTS 0 to BTS 1 */ f_vty_handover(BSCVTY, 0, 0, g_chan_nr, 1); @@ -5197,7 +5198,8 @@ private function f_tc_ho_int_radio_link_failure(charstring id) runs on MSC_ConnH var HandoverState hs := { rr_ho_cmpl_seen := false, handover_done := false, - old_chan_nr := - + old_chan_nr := -, + expect_target_tsc := BTS_TSC[1] }; /* issue hand-over command on VTY */ f_vty_handover(BSCVTY, 0, 0, g_chan_nr, 1); @@ -9347,7 +9349,8 @@ private function f_tc_ho_during_lcs_loc_req(charstring id) runs on MSC_ConnHdlr var HandoverState hs := { rr_ho_cmpl_seen := false, handover_done := false, - old_chan_nr := - + old_chan_nr := -, + expect_target_tsc := BTS_TSC[1] }; /* issue hand-over command on VTY */ f_vty_handover(BSCVTY, 0, 0, g_chan_nr, 1); diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 5f777645..2b1f7116 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -1467,7 +1467,8 @@ type record HandoverState { boolean rr_ho_cmpl_seen, integer mdcx_seen_before_ho, boolean handover_done, - RslChannelNr old_chan_nr + RslChannelNr old_chan_nr, + uint3_t expect_target_tsc optional }; altstep as_handover(inout HandoverState st) runs on MSC_ConnHdlr { @@ -1482,6 +1483,19 @@ altstep as_handover(inout HandoverState st) runs on MSC_ConnHdlr { new_chan_nr, arfcn); /* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */ + /* Verify correct TSC in handoverCommand */ + if (ispresent(st.expect_target_tsc)) { + var uint3_t got_tsc := rr_chan_desc_tsc(l3.msgs.rrm.handoverCommand.channelDescription2); + if (not match(got_tsc, st.expect_target_tsc)) { + setverdict(fail, "RR Handover Command: unexpected TSC in Channel Description: expected ", + st.expect_target_tsc, " got ", got_tsc); + mtc.stop; + } else { + log("handoverCommand: verified TSC = ", got_tsc, " (matches ", + st.expect_target_tsc, ")"); + } + } + /* register our component for this channel number at the RSL Emulation */ f_rslem_register(0, new_chan_nr, RSL1_PROC); -- cgit v1.2.3