osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bsc/+/29882 )
Change subject: tests: add test_meas_rep_multi_band.ho_vty
......................................................................
tests: add test_meas_rep_multi_band.ho_vty
Add a test that shows that the ARFCN of neighbors from the measurement
report is not parsed correctly for multi-band BSS. A follow-up patch
fixes it.
Related: OS#5717
Change-Id: Ie18e341f236bab5cf60d3a342c15c96cc848a7c2
---
M tests/handover/handover_test.c
M tests/handover/handover_tests.ok
A tests/handover/test_meas_rep_multi_band.ho_vty
3 files changed, 108 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/82/29882/1
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 6830b48..bf3ece8 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <inttypes.h>
#include <assert.h>
@@ -1433,6 +1434,59 @@
return CMD_SUCCESS;
}
+DEFUN(set_arfcn, set_arfcn_cmd,
+ "set-arfcn trx <0-255> <0-255> <0-1023>",
+ "Set the ARFCN for a BTS' TRX\n"
+ "Indicate a BTS and TRX\n" "BTS nr\n" "TRX nr\n"
+ "Absolute Radio Frequency Channel Number\n")
+{
+ enum gsm_band unused;
+ struct gsm_bts *bts = bts_by_num_str(argv[0]);
+ struct gsm_bts_trx *trx = trx_by_num_str(bts, argv[1]);
+ int arfcn = atoi(argv[2]);
+
+ if (gsm_arfcn2band_rc(arfcn, &unused) < 0) {
+ vty_out(vty, "%% Invalid arfcn %" PRIu16 " detected%s", arfcn,
VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ trx->arfcn = arfcn;
+
+ if (generate_cell_chan_alloc(trx->bts) != 0) {
+ vty_out(vty, "%% Failed to re-generate Cell Allocation%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ for (int i = 0; i < bsc_gsmnet->num_bts; i++) {
+ if (gsm_generate_si(gsm_bts_num(bsc_gsmnet, i), SYSINFO_TYPE_2) <= 0)
+ fprintf(stderr, "Error generating SI2\n");
+ }
+
+ VTY_ECHO();
+ return CMD_SUCCESS;
+}
+
+DEFUN(set_band, set_band_cmd,
+ "set-band bts <0-255> BAND",
+ "Set the frequency band for a BTS\n"
+ "Indicate a BTS\n" "BTS nr\n"
+ "Frequency band\n")
+{
+ struct gsm_bts *bts = bts_by_num_str(argv[0]);
+ int band = gsm_band_parse(argv[1]);
+
+ if (band < 0) {
+ vty_out(vty, "%% BAND %d is not a valid GSM band%s",
+ band, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ bts->band = band;
+
+ VTY_ECHO();
+ return CMD_SUCCESS;
+}
+
DEFUN(set_ts_use, set_ts_use_cmd,
"set-ts-use trx <0-255> <0-255> states" TS_USE TS_USE TS_USE
TS_USE TS_USE TS_USE TS_USE TS_USE,
"Put timeslots of a BTS' TRX into a specific state\n"
@@ -1490,6 +1544,8 @@
install_element(CONFIG_NODE, &expect_ts_use_cmd);
install_element(CONFIG_NODE, &codec_f_cmd);
install_element(CONFIG_NODE, &codec_h_cmd);
+ install_element(CONFIG_NODE, &set_arfcn_cmd);
+ install_element(CONFIG_NODE, &set_band_cmd);
install_element(CONFIG_NODE, &set_ts_use_cmd);
install_element(CONFIG_NODE, &wait_cmd);
}
diff --git a/tests/handover/handover_tests.ok b/tests/handover/handover_tests.ok
index 168ebd6..0424181 100644
--- a/tests/handover/handover_tests.ok
+++ b/tests/handover/handover_tests.ok
@@ -42,6 +42,7 @@
pass test_keep_hr_codec.ho_vty
pass test_max_handovers.ho_vty
pass test_max_ta.ho_vty
+pass test_meas_rep_multi_band.ho_vty
pass test_min_rxlev_vs_congestion.ho_vty
pass test_min_rxlev_vs_hysteresis.ho_vty
pass test_neighbor_congested.ho_vty
diff --git a/tests/handover/test_meas_rep_multi_band.ho_vty
b/tests/handover/test_meas_rep_multi_band.ho_vty
new file mode 100644
index 0000000..45bcfa3
--- /dev/null
+++ b/tests/handover/test_meas_rep_multi_band.ho_vty
@@ -0,0 +1,51 @@
+# Test ARFCN parsing from measurement report in multi-band BSS (OS#5717)
+
+create-n-bts 5
+
+set-band bts 0 1800
+set-arfcn trx 0 0 600
+
+set-band bts 1 900
+set-arfcn trx 1 0 1000
+
+set-band bts 2 850
+set-arfcn trx 2 0 200
+
+set-band bts 3 900
+set-arfcn trx 3 0 0
+
+set-band bts 4 1800
+set-arfcn trx 4 0 800
+
+# Attach MS to BTS 0, BTS 1-4 are neighbors
+create-ms bts 0 TCH/F AMR
+
+expect-ts-use trx 0 0 states * TCH/F - - - - - -
+expect-ts-use trx 1 0 states * - - - - - - -
+expect-ts-use trx 2 0 states * - - - - - - -
+expect-ts-use trx 3 0 states * - - - - - - -
+expect-ts-use trx 4 0 states * - - - - - - -
+
+# Send a measurement report where TRX with ARFCN=800 has the best rxqual. If
+# the BSC resolved the indexes in the measurement report correctly according to
+# 3GPP TS 04.08 § 10.5.2.20, then the neighbors are the following:
+# Sub list 1 (band == 1800, same band as the TRX where MS is attached):
+# IDX=0 ARFCN=800 BSIC=63 RXLEV=-75dBm (BTS 4)
+# Sub list 2 (other bands):
+# IDX=1 ARFCN=200 BSIC=63 RXLEV=-110dBm (BTS 2)
+# IDX=2 ARFCN=1000 BSIC=63 RXLEV=-110dBm (BTS 1)
+# IDX=3 ARFCN=0 BSIC=63 RXLEV=-110dBm (BTS 3; at the end because ARFCN=0)
+meas-rep lchan 0 0 1 0 rxlev 20 rxqual 0 ta 0 neighbors 35 0 0 0
+
+# If the BSC parsed the list correctly, it will request a handover to BTS 4.
+# expect-ho from lchan 0 0 1 0 to lchan 4 0 1 0
+
+# FIXME: parses IDX=0 as ARFCN=0 instead of ARFCN=800, no handover is done
+expect-no-chan
+
+# FIXME: should be on TRX 4 after handover
+expect-ts-use trx 0 0 states * TCH/F - - - - - -
+expect-ts-use trx 1 0 states * - - - - - - -
+expect-ts-use trx 2 0 states * - - - - - - -
+expect-ts-use trx 3 0 states * - - - - - - -
+expect-ts-use trx 4 0 states * - - - - - - -
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/29882
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie18e341f236bab5cf60d3a342c15c96cc848a7c2
Gerrit-Change-Number: 29882
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange