diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index ee4dac21b..ad8f666b5 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -8439,7 +8439,7 @@ private type record FHParamsTs { /* Hopping parameters per a transceiver */ private type record FHParamsTrx { - GsmArfcn arfcn, + GsmBandArfcn arfcn, FHParamsTs ts[8] }; @@ -8448,8 +8448,10 @@ private function f_TC_fh_params_gen(template integer tr_tn := (1, 3, 5)) runs on test_CT return FHParamsTrx { var FHParamsTrx fhp; - /* Generate a random ARFCN, including ARFCN 0 */ - fhp.arfcn := f_rnd_int(3); + /* Generate a random ARFCN in the range of 0 - 3. This ARFCN will + * fall in the GSM900 band. */ + fhp.arfcn.arfcn := f_rnd_int(3); + fhp.arfcn.pcs := false; for (var integer tn := 0; tn < 8; tn := tn + 1) { if (not match(tn, tr_tn)) { @@ -8488,7 +8490,7 @@ private function f_TC_fh_params_match_chan_desc(in FHParamsTrx fhp, in ChannelDe tr_maio_hsn := tr_HsnMaio(fhp.ts[tn].hsn, fhp.ts[tn].maio); tr_cd := tr_ChanDescH1(cd.chan_nr, tr_maio_hsn); } else { - tr_cd := tr_ChanDescH0(cd.chan_nr, fhp.arfcn); + tr_cd := tr_ChanDescH0(cd.chan_nr, fhp.arfcn.arfcn); } if (not match(cd, tr_cd)) { @@ -8533,7 +8535,7 @@ return template MobileAllocationLV { } /* Take ARFCN of the TRX itself into account */ - full_mask[fhp.arfcn] := '1'B; + full_mask[fhp.arfcn.arfcn] := '1'B; /* Compose a bit-mask for the given timeslot number */ for (var integer i := 0; i < lengthof(fhp.ts[tn].ma); i := i + 1) { @@ -8570,15 +8572,41 @@ return template MobileAllocationLV { return { len := ma_mask_len, ma := ma_mask }; } +/* Configure the appropriate band for a given arfcn, exc */ +private function f_TC_set_band_by_arfcn(integer bts_nr, GsmBandArfcn arfcn) runs on test_CT +{ + var charstring band; + var GsmBandArfcn arfcn_ := valueof(ts_GsmBandArfcn(arfcn.arfcn, arfcn.pcs, false)); + + select (arfcn_) { + case (tr_GsmBandArfcn((259..293), false, ?)) { band := "GSM450"; } + case (tr_GsmBandArfcn((306..340), false, ?)) { band := "GSM480"; } + case (tr_GsmBandArfcn((438..511), false, ?)) { band := "GSM750"; } + case (tr_GsmBandArfcn((128..251), false, ?)) { band := "GSM850"; } + case (tr_GsmBandArfcn((0..124), false, ?)) { band := "GSM900"; } + case (tr_GsmBandArfcn((955..1023), false, ?)) { band := "GSM900"; } + case (tr_GsmBandArfcn((512..885), false, ?)) { band := "DCS1800"; } + case (tr_GsmBandArfcn((512..810), true, ?)) { band := "PCS1900"; } + case else { return; } + } + + f_vty_enter_cfg_bts(BSCVTY, bts_nr); + f_vty_transceive(BSCVTY, "band " & band); + f_vty_transceive(BSCVTY, "end"); +} + /* Configure the hopping parameters in accordance with the given record */ private function f_TC_fh_params_set(in FHParamsTrx fhp, uint8_t bts_nr := 0, uint8_t trx_nr := 0) runs on test_CT { + + f_TC_set_band_by_arfcn(bts_nr, fhp.arfcn); + /* Enter the configuration node for the given BTS/TRX numbers */ f_vty_enter_cfg_trx(BSCVTY, bts_nr, trx_nr); - f_vty_transceive(BSCVTY, "arfcn " & int2str(fhp.arfcn)); + f_vty_transceive(BSCVTY, "arfcn " & int2str(fhp.arfcn.arfcn)); for (var integer tn := 0; tn < lengthof(fhp.ts); tn := tn + 1) { f_vty_transceive(BSCVTY, "timeslot " & int2str(tn)); @@ -8609,12 +8637,15 @@ runs on test_CT { private function f_TC_fh_params_unset(in FHParamsTrx fhp, uint8_t bts_nr := 0, uint8_t trx_nr := 0, - GsmArfcn arfcn := 871) + GsmBandArfcn arfcn := {pcs := false, arfcn := 871}) runs on test_CT { + + f_TC_set_band_by_arfcn(bts_nr, arfcn); + /* Enter the configuration node for the given BTS/TRX numbers */ f_vty_enter_cfg_trx(BSCVTY, bts_nr, trx_nr); - f_vty_transceive(BSCVTY, "arfcn " & int2str(arfcn)); + f_vty_transceive(BSCVTY, "arfcn " & int2str(arfcn.arfcn)); for (var integer tn := 0; tn < lengthof(fhp.ts); tn := tn + 1) { f_vty_transceive(BSCVTY, "timeslot " & int2str(tn));