bsc: test RR Channel Release EARFCNs

Add a DCHAN and release to recently added SI2quater tests (because these tests
already configure various amounts of EARFCNs in osmo-bsc).

Verify that the RR Channel Release for CSFB contains all configured EARFCNs.

In GSM_RR_Types.ttcn, add coding for "Cell selection indicator after release of
all TCH and SDCCH IE".

In f_expect_chan_rel(), add optional arg csfb_expect_cells, and, if present,
decode the RR Channel Release message's L3 part, and in turn the Cell Selection
Indicator Value contained. Match against csfb_expect_cells.

In f_tc_si2quater_n_earfcns(), also compose a list of EARFCNs as found in the
RR Channel Release, and pass to f_expect_chan_rel().

Depends: I59e427e4ebb1c6af99b27a15c40fed82457ac8ab (osmo-bsc)
Change-Id: I882c5e1f70bcc4833fc837a95c900ce291919cc5
This commit is contained in:
Neels Hofmeyr 2020-07-10 17:33:24 +02:00 committed by laforge
parent 606f07d113
commit 0edf4ac242
2 changed files with 170 additions and 4 deletions

View File

@ -1498,13 +1498,15 @@ function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr,
boolean expect_rr_chan_rel := true,
boolean expect_rll_rel_req := true,
boolean handle_rll_rel := true,
boolean is_csfb := false
boolean is_csfb := false,
template CellSelIndValue csfb_expect_cells := omit
) runs on test_CT {
var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0));
var boolean got_deact_sacch := false;
var boolean got_rr_chan_rel := false;
var boolean got_rll_rel_req := false;
var ASP_RSL_Unitdata ud;
log("f_expect_chan_rel() expecting: expect_deact_sacch=", expect_deact_sacch, " expect_rr_chan_rel=", expect_rr_chan_rel,
" expect_rll_rel_req=", expect_rll_rel_req);
alt {
@ -1512,8 +1514,27 @@ function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr,
got_deact_sacch := true;
repeat;
}
[is_csfb] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE_CSFB))) {
[is_csfb] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE_CSFB))) -> value ud {
got_rr_chan_rel := true;
if (not istemplatekind(csfb_expect_cells, "omit")) {
var RSL_IE_Body l3_ie;
if (f_rsl_find_ie(ud.rsl, RSL_IE_L3_INFO, l3_ie) == false) {
setverdict(fail, "cannot find L3");
mtc.stop;
}
var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(l3_ie.l3_info.payload);
var CellSelIndValue cells := dec_CellSelIndValue(
l3.msgs.rrm.channelRelease.cellSelectionIndicator.cellSelectionIndicatorValue);
log("GOT RR CHANNEL RELEASE CSFB CELLS: ", cells);
if (match(cells, csfb_expect_cells)) {
setverdict(pass);
} else {
log("EXPECTED CSFB CELLS: ", csfb_expect_cells);
setverdict(fail, "Received CSFB cells list on RR Channel Release does not match expectations");
}
}
repeat;
}
[not is_csfb] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE))) {
@ -1792,7 +1813,8 @@ private function f_test_si2quater_earfcn_by_idx(integer earfcn_index) return uin
}
}
function f_test_si2quater(integer total_earfcns, template SystemInformationConfig expect_si) runs on test_CT {
function f_test_si2quater(integer total_earfcns, template SystemInformationConfig expect_si,
template CellSelIndValue expect_cells := omit) runs on test_CT {
f_init(0);
@ -1804,6 +1826,30 @@ function f_test_si2quater(integer total_earfcns, template SystemInformationConfi
f_init_bts_and_check_sysinfo(0, expect_si := expect_si);
f_init(1);
if (not istemplatekind(expect_cells, "omit")) {
/* Also check that RR Channel Release contains these EARFCNs.
* (copied code from TC_chan_rel_hard_clear_csfb) */
var BSSAP_N_DATA_ind rx_di;
var DchanTuple dt;
dt := f_est_dchan('23'O, 23, '00010203040506'O);
/* Instruct BSC to clear channel */
var BssmapCause cause := 0;
BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommandCSFB(cause)));
/* expect Clear Complete from BSC on A */
BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)) {
/* release the SCCP connection */
BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
}
f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false, is_csfb := true,
csfb_expect_cells := expect_cells);
}
for (var integer i := 1; i < total_earfcns; i := i + 1) {
f_bts_0_cfg(BSCVTY, {"si2quater neighbor-list del earfcn " & int2str(f_test_si2quater_earfcn_by_idx(i))});
}
@ -1827,11 +1873,24 @@ private function f_tr_si2quater_earfcns(integer count) return template SI2quater
return si2quater;
}
private function f_tr_rr_chan_rel_earfcns(integer count) return template CellSelIndValue
{
var template CellSelIndValue_EUTRAN_Descrs cells := {};
for (var integer i := 0; i < count; i := i + 1) {
var integer earfcn := f_test_si2quater_earfcn_by_idx(i);
cells[i] := tr_CellSelIndValue_EUTRAN_Descr(earfcn, meas_bw_presence := '0'B, meas_bw := omit);
}
return tr_CellSelIndValue_EUTRAN(cells);
}
private function f_tc_si2quater_n_earfcns(integer n) runs on test_CT
{
var template SystemInformationConfig sic := SystemInformationConfig_default;
sic.si2quater := f_tr_si2quater_earfcns(n);
f_test_si2quater(n, sic);
var template CellSelIndValue cells := f_tr_rr_chan_rel_earfcns(n);
f_test_si2quater(n, sic, cells);
}
testcase TC_si2quater_2_earfcns() runs on test_CT {

View File

@ -1106,4 +1106,111 @@ module GSM_RR_Types {
maio_hsn := maio_hsn
}
/* Templates for the RR Channel Release message's "Cell selection indicator after release of all TCH and SDCCH" IE.
* See 3GPP TS 44.018 9.1.7 and 10.5.2.1e */
/* 3GPP TS 44.018 10.5.2.1e, Cell Selection Indicator after release of all TCH and SDCCH value part */
type record CellSelIndValue {
BIT3 discr,
CellSelIndValueEnum value_list,
BIT1 value_list_term ('0'B)
} with {
variant (value_list) "CROSSTAG(
gsm, discr='000'B;
utran_fdd, discr='001'B;
utran_tdd, discr='010'B;
eutran, discr='011'B;
)"
};
/* 3GPP TS 44.018 10.5.2.1e, Cell Selection Indicator after release of all TCH and SDCCH value part */
private type union CellSelIndValueEnum {
CellSelIndValue_GSM_Descrs gsm,
CellSelIndValue_UTRAN_Descrs utran_fdd,
CellSelIndValue_UTRAN_Descrs utran_tdd,
CellSelIndValue_EUTRAN_Descrs eutran
} with { variant "" };
type record of CellSelIndValue_GSM_Descr CellSelIndValue_GSM_Descrs;
/* 3GPP TS 44.018 10.5.2.1e, GSM Description struct */
type record CellSelIndValue_GSM_Descr {
BIT1 item_ind ('1'B),
BIT1 band_indicator,
uint10_t arfcn,
uint6_t bsic
} with {
variant "PRESENCE(item_ind = '1'B)"
};
type record of CellSelIndValue_UTRAN_Descr CellSelIndValue_UTRAN_Descrs;
/* 3GPP TS 44.018 10.5.2.1e, UTRAN {FDD,TDD} Description struct */
type record CellSelIndValue_UTRAN_Descr {
BIT1 item_ind ('1'B),
BIT1 bandwidth_presence,
uint3_t bandwidth optional,
uint14_t arfcn,
BIT1 cell_info_presence,
UTRAN_CellInfo cell_info optional
} with {
variant "PRESENCE(item_ind = '1'B)"
variant (bandwidth) "PRESENCE(bandwidth_presence = '1'B)"
variant (cell_info) "PRESENCE(cell_info_presence = '1'B)"
};
type record UTRAN_CellInfo {
BIT1 indic0,
uint5_t nr_of_cells,
// TODO: define cell_information_field
octetstring cell_information_field
} with { variant "" };
type record of CellSelIndValue_EUTRAN_Descr CellSelIndValue_EUTRAN_Descrs;
/* 3GPP TS 44.018 10.5.2.1e, E-UTRAN Description struct */
type record CellSelIndValue_EUTRAN_Descr {
BIT1 item_ind ('1'B),
uint16_t earfcn,
BIT1 meas_bw_presence,
uint3_t meas_bw optional,
BIT1 not_allowed_cells_presence,
// define not_allowed_cells
octetstring not_allowed_cells optional,
BIT1 target_pcid_presence,
uint9_t target_pcid optional
} with {
variant "PRESENCE(item_ind = '1'B)"
variant (meas_bw) "PRESENCE(meas_bw_presence = '1'B)"
variant (not_allowed_cells) "PRESENCE(not_allowed_cells_presence = '1'B)"
variant (target_pcid) "PRESENCE(target_pcid_presence = '1'B)"
};
template CellSelIndValue tr_CellSelIndValue_EUTRAN(
template CellSelIndValue_EUTRAN_Descrs cells := {})
:= {
discr := '011'B,
value_list := {
eutran := cells
},
value_list_term := '0'B
};
template CellSelIndValue_EUTRAN_Descr tr_CellSelIndValue_EUTRAN_Descr(
template (present) uint16_t earfcn,
template (present) BIT1 meas_bw_presence := ?,
template uint3_t meas_bw := *)
:= {
item_ind := '1'B,
earfcn := earfcn,
meas_bw_presence := meas_bw_presence,
meas_bw := meas_bw,
not_allowed_cells_presence := '0'B,
not_allowed_cells := omit,
target_pcid_presence := '0'B,
target_pcid := omit
};
external function enc_CellSelIndValue(in CellSelIndValue ro) return octetstring
with { extension "prototype(convert) encode(RAW)" };
external function dec_CellSelIndValue(in octetstring stream) return CellSelIndValue
with { extension "prototype(convert) decode(RAW)" };
} with { encode "RAW" ; variant "FIELDORDER(msb)" }