From 6a955cc46db85abb60d4ceeecf0ce264cfae9f89 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 2 Oct 2021 14:53:48 +0200 Subject: bsc: verify TSC in RR HO Cmd of TC_ho_neighbor_config_* Related: SYS#4895 OS#5244 Related: Iae20df4387c3d75752301bd5daeeea7508966393 (osmo-bsc) Change-Id: I09cb07561a57527880b87147495619a3bbbceb3f --- bsc/BSC_Tests.ttcn | 24 ++++++++++++++++++------ bsc/MSC_ConnectionHandler.ttcn | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 04e895ad..cc387f64 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -6267,7 +6267,8 @@ private function f_probe_for_handover(charstring log_label, charstring log_descr, charstring handover_vty_cmd, boolean expect_handover, - boolean is_inter_bsc_handover := false) + boolean is_inter_bsc_handover := false, + template uint3_t expect_target_tsc := ?) runs on MSC_ConnHdlr { /* We're going to thwart any and all handover attempts, just be ready to handle (and ignore) handover target @@ -6299,6 +6300,17 @@ runs on MSC_ConnHdlr log("Handover to new chan ", new_chan_nr, " on ARFCN ", arfcn); log(l3.msgs.rrm.handoverCommand); + /* Verify correct TSC in handoverCommand */ + var uint3_t got_tsc := rr_chan_desc_tsc(l3.msgs.rrm.handoverCommand.channelDescription2); + if (not match(got_tsc, expect_target_tsc)) { + setverdict(fail, "RR Handover Command: unexpected TSC in Channel Description: expected ", + expect_target_tsc, " got ", got_tsc); + mtc.stop; + } else { + log("handoverCommand: verified TSC = ", got_tsc, " (matches ", + expect_target_tsc, ")"); + } + /* Need to register for new lchan on new BTS -- it's either bts 1 or bts 2. It doesn't really * matter on which BTS it really is, we're not going to follow through an entire handover * anyway. */ @@ -6407,7 +6419,7 @@ private function f_tc_ho_neighbor_config_1(charstring id) runs on MSC_ConnHdlr { f_bts_0_cfg(BSCVTY, {"no neighbors"}); f_probe_for_handover("1.a", "HO to bts 1 works, implicitly listed as neighbor (legacy behavior when none are configured)", "handover any to arfcn 871 bsic 11", - true); + true, expect_target_tsc := BTS_TSC[1]); f_probe_for_handover("1.b", "HO to unknown cell does not start", "handover any to arfcn 13 bsic 39", @@ -6419,7 +6431,7 @@ private function f_tc_ho_neighbor_config_1(charstring id) runs on MSC_ConnHdlr { f_probe_for_handover("1.d", "HO to 871-11 still works (verify that this test properly cleans up)", "handover any to arfcn 871 bsic 11", - true); + true, expect_target_tsc := BTS_TSC[1]); } testcase TC_ho_neighbor_config_1() runs on test_CT { var MSC_ConnHdlr vc_conn; @@ -6475,7 +6487,7 @@ private function f_tc_ho_neighbor_config_2(charstring id) runs on MSC_ConnHdlr { f_probe_for_handover("2.a", "HO to bts 1 works, explicitly listed as neighbor", "handover any to arfcn 871 bsic 11", - true); + true, expect_target_tsc := BTS_TSC[1]); f_probe_for_handover("2.b", "HO to bts 2 doesn't work, not listed as neighbor", "handover any to arfcn 871 bsic 12", @@ -6528,7 +6540,7 @@ private function f_tc_ho_neighbor_config_3(charstring id) runs on MSC_ConnHdlr { false); f_probe_for_handover("3.b", "HO to bts 2 works, explicitly listed as neighbor; no ambiguity because bts 3 is not listed as neighbor", "handover any to arfcn 871 bsic 12", - true); + true, expect_target_tsc := BTS_TSC[2]); } testcase TC_ho_neighbor_config_3() runs on test_CT { var MSC_ConnHdlr vc_conn; @@ -6714,7 +6726,7 @@ private function f_tc_ho_neighbor_config_7(charstring id) runs on MSC_ConnHdlr { f_probe_for_handover("7.a", "HO to 871-12 does HO to bts 2", "handover any to arfcn 871 bsic 12", - true); + true, expect_target_tsc := BTS_TSC[2]); f_probe_for_handover("7.b", "HO to 123-45 triggers inter-BSC HO", "handover any to arfcn 123 bsic 45", true, true); diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 2b1f7116..cb93bfe6 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -955,7 +955,7 @@ private function f_check_chan_act(AssignmentState st, RSL_Message chan_act) runs } -private function rr_chan_desc_tsc(ChannelDescription2_V cd2) +function rr_chan_desc_tsc(ChannelDescription2_V cd2) return uint3_t { var uint3_t tsc := oct2int(cd2.octet3); -- cgit v1.2.3