summaryrefslogtreecommitdiffstats
path: root/bsc
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-09-13 13:22:34 +0700
committerfixeria <vyanitskiy@sysmocom.de>2020-09-14 10:13:39 +0000
commit1b99661d25625f2773d44967a872997770515f10 (patch)
tree002da30b3386ce7e8c5d73a0b9358ef591ddbba0 /bsc
parentbc6654a3fee91fa5f50b70d252c577d9bcb93772 (diff)
BSC_Tests/hopping: turn FHParamsTrx into a record, add ARFCN field
This record must contain not only the hopping parameters, but also ARFCN of the transceiver they belong to. Since ARFCN of the transceiver also becomes part of the Mobile Allocation, we need to take it into account in the matching functions. Change-Id: I4722dc3f758a097806811cb0b59aa4093374c74c Related: SYS#4868, OS#4545
Diffstat (limited to 'bsc')
-rw-r--r--bsc/BSC_Tests.ttcn55
1 files changed, 29 insertions, 26 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 03b3102..fcb6b26 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -6854,7 +6854,10 @@ private type record FHParamsTs {
};
/* Hopping parameters per a transceiver */
-private type record length(8) of FHParamsTs FHParamsTrx;
+private type record FHParamsTrx {
+ GsmArfcn arfcn,
+ FHParamsTs ts[8]
+};
/* Randomly generate the hopping parameters for the given timeslot numbers */
private function f_TC_fh_params_gen(template integer tr_tn := (1, 3, 5))
@@ -6863,24 +6866,24 @@ runs on test_CT return FHParamsTrx {
for (var integer tn := 0; tn < 8; tn := tn + 1) {
if (not match(tn, tr_tn)) {
- fhp[tn].enabled := false;
- fhp[tn].ma := { };
+ fhp.ts[tn].enabled := false;
+ fhp.ts[tn].ma := { };
continue;
}
/* Random HSN / MAIO values: 0..63 */
- fhp[tn].hsn := f_rnd_int(64);
- fhp[tn].maio := f_rnd_int(64);
- fhp[tn].ma := { };
+ fhp.ts[tn].hsn := f_rnd_int(64);
+ fhp.ts[tn].maio := f_rnd_int(64);
+ fhp.ts[tn].ma := { };
/* Random Mobile Allocation (hopping channels) */
var integer ma_len := 2 + f_rnd_int(9); /* 2..10 channels */
var integer step := 3 + f_rnd_int(4); /* 3..6 stepping */
for (var integer i := 1; i <= ma_len; i := i + 1) {
- fhp[tn].ma := fhp[tn].ma & { i * step };
+ fhp.ts[tn].ma := fhp.ts[tn].ma & { i * step };
}
- fhp[tn].enabled := true;
+ fhp.ts[tn].enabled := true;
}
log("f_TC_fh_params_gen(): ", fhp);
@@ -6894,8 +6897,8 @@ private function f_TC_fh_params_match_chan_desc(in FHParamsTrx fhp, in ChannelDe
var template (present) MaioHsn tr_maio_hsn;
var uint3_t tn := cd.chan_nr.tn;
- if (fhp[tn].enabled) {
- tr_maio_hsn := tr_HsnMaio(fhp[tn].hsn, fhp[tn].maio);
+ if (fhp.ts[tn].enabled) {
+ 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);
@@ -6925,7 +6928,7 @@ private function f_TC_fh_params_gen_tr_ma(in FHParamsTrx fhp, uint3_t tn,
in MobileAllocationLV ma)
return template MobileAllocationLV {
/* Mobile Allocation IE is expected to be empty if hopping is not enabled */
- if (not fhp[tn].enabled) {
+ if (not fhp.ts[tn].enabled) {
return { len := 0, ma := ''B };
}
@@ -6934,17 +6937,17 @@ return template MobileAllocationLV {
var bitstring ma_mask := ''B;
/* Compose the full bit-mask (all channels, up to 1024 entries) */
- for (var integer i := 0; i < lengthof(fhp); i := i + 1) {
- for (var integer j := 0; j < lengthof(fhp[i].ma); j := j + 1) {
- if (full_mask[fhp[i].ma[j]] == '1'B)
+ for (var integer i := 0; i < lengthof(fhp.ts); i := i + 1) {
+ for (var integer j := 0; j < lengthof(fhp.ts[i].ma); j := j + 1) {
+ if (full_mask[fhp.ts[i].ma[j]] == '1'B)
{ continue; }
- full_mask[fhp[i].ma[j]] := '1'B;
+ full_mask[fhp.ts[i].ma[j]] := '1'B;
}
}
/* Compose a bit-mask for the given timeslot number */
- for (var integer i := 0; i < lengthof(fhp[tn].ma); i := i + 1) {
- slot_mask[fhp[tn].ma[i]] := '1'B;
+ for (var integer i := 0; i < lengthof(fhp.ts[tn].ma); i := i + 1) {
+ slot_mask[fhp.ts[tn].ma[i]] := '1'B;
}
/* Finally, compose the Mobile Allocation bit-mask */
@@ -6975,22 +6978,22 @@ runs on test_CT {
/* Enter the configuration node for the given BTS/TRX numbers */
f_vty_enter_cfg_trx(BSCVTY, bts_nr, trx_nr);
- for (var integer tn := 0; tn < lengthof(fhp); tn := tn + 1) {
+ for (var integer tn := 0; tn < lengthof(fhp.ts); tn := tn + 1) {
f_vty_transceive(BSCVTY, "timeslot " & int2str(tn));
- if (not fhp[tn].enabled) {
+ if (not fhp.ts[tn].enabled) {
f_vty_transceive(BSCVTY, "hopping enabled 0");
f_vty_transceive(BSCVTY, "exit"); /* go back */
continue;
}
/* Configure HSN / MAIO values */
- f_vty_transceive(BSCVTY, "hopping sequence-number " & int2str(fhp[tn].hsn));
- f_vty_transceive(BSCVTY, "hopping maio " & int2str(fhp[tn].maio));
+ f_vty_transceive(BSCVTY, "hopping sequence-number " & int2str(fhp.ts[tn].hsn));
+ f_vty_transceive(BSCVTY, "hopping maio " & int2str(fhp.ts[tn].maio));
/* Configure the Mobile Allocation (hopping channels) */
- for (var integer i := 0; i < lengthof(fhp[tn].ma); i := i + 1) {
- f_vty_transceive(BSCVTY, "hopping arfcn add " & int2str(fhp[tn].ma[i]));
+ for (var integer i := 0; i < lengthof(fhp.ts[tn].ma); i := i + 1) {
+ f_vty_transceive(BSCVTY, "hopping arfcn add " & int2str(fhp.ts[tn].ma[i]));
}
f_vty_transceive(BSCVTY, "hopping enabled 1");
@@ -7008,12 +7011,12 @@ runs on test_CT {
/* Enter the configuration node for the given BTS/TRX numbers */
f_vty_enter_cfg_trx(BSCVTY, bts_nr, trx_nr);
- for (var integer tn := 0; tn < lengthof(fhp); tn := tn + 1) {
+ for (var integer tn := 0; tn < lengthof(fhp.ts); tn := tn + 1) {
f_vty_transceive(BSCVTY, "timeslot " & int2str(tn));
/* Delete all ARFCNs from the Mobile Allocation (if any) */
- for (var integer i := 0; i < lengthof(fhp[tn].ma); i := i + 1) {
- f_vty_transceive(BSCVTY, "hopping arfcn del " & int2str(fhp[tn].ma[i]));
+ for (var integer i := 0; i < lengthof(fhp.ts[tn].ma); i := i + 1) {
+ f_vty_transceive(BSCVTY, "hopping arfcn del " & int2str(fhp.ts[tn].ma[i]));
}
f_vty_transceive(BSCVTY, "hopping enabled 0");