fix mscpool cleanup (fixes LCLS tests)
osmo-bsc takes a while to notice that a connected MSC is no longer connected.
Once the mscpool tests have run, the additional msc 1 and msc 2 still linger
around even though the BSSMAP link is no longer served by the bsc-tester.
The easiest way to ensure that only expected MSCs are contacted is to set
'no allow-attach' for each MSC that should not be in use.
So, the default setup is 'allow-attach' on msc 0, and 'no allow-attach' on mscs
1 and 2. In f_init(), allow attach on those MSCs indicated by the nr_msc
amount. The entire vty transaction to configure attach/no attach for all three
MSCs takes about 4 micro seconds in my test setup, so it is fine to do this
during f_init() for each BSC test.
After this, tests running after the MSC pooling tests (the LCLS tests) no
longer round-robin their subscribers across disconnected MSCs.
NOTE: it would be good to somehow detect more reliably in osmo-bsc that an MSC
is gone and not use it anymore. That is however not so trivial. To get the LCLS
tests back online, this is a workaround to avoid that complexity for now.
Change-Id: I02ad58ed7d0d0aac61e393b415e09c6c5c8a70ca
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 5bd0e4f..1040a31 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -832,6 +832,24 @@
}
}
+/* TODO: use BooleanList from COMMON/src/General_Types.ttcn */
+private type record of boolean my_BooleanList;
+
+private function f_vty_msc_allow_attach(TELNETasp_PT pt, my_BooleanList allow_attach_list)
+{
+ for (var integer msc_nr := 0; msc_nr < sizeof(allow_attach_list); msc_nr := msc_nr+1) {
+ f_vty_enter_cfg_msc(pt, msc_nr);
+ if (allow_attach_list[msc_nr]) {
+ /* strict := false: ignore if osmo-bsc does not support this config option (latest build) */
+ f_vty_transceive(pt, "allow-attach", strict := false);
+ } else {
+ f_vty_transceive(pt, "no allow-attach", strict := false);
+ }
+ f_vty_transceive(pt, "exit");
+ f_vty_transceive(pt, "exit");
+ }
+}
+
/* global initialization function
* \param nr_bts Number of BTSs we should start/bring up
* \param handler_mode Start an RSL_Emulation_CT component (true) or not (false).
@@ -854,7 +872,9 @@
f_vty_allow_osmux(allow_osmux);
}
+ var my_BooleanList allow_attach := { false, false, false };
for (bssap_idx := 0; bssap_idx < nr_msc; bssap_idx := bssap_idx+1) {
+ allow_attach[bssap_idx] := true;
/* Call a function of our 'parent component' RAN_Adapter_CT to start the
* MSC-side BSSAP emulation */
if (handler_mode) {
@@ -871,6 +891,9 @@
}
}
+ /* start the test with exactly all enabled MSCs allowed to attach */
+ f_vty_msc_allow_attach(BSCVTY, allow_attach);
+
f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);
f_init_mgcp("VirtMSC");
@@ -5850,17 +5873,13 @@
f_init(nr_bts := 3, handler_mode := true, nr_msc := 3);
f_sleep(1.0);
+ /* Mark the second MSC as offloading, round-robin should skip this MSC now. */
+ f_vty_msc_allow_attach(BSCVTY, {true, false, true});
/* Control which MSC gets chosen next by the round-robin, otherwise
* would be randomly affected by which other tests ran before this. */
f_vty_transceive(BSCVTY, "mscpool roundrobin next 0");
- /* Mark the second MSC as offloading, round-robin should skip this MSC now. */
- f_vty_enter_cfg_msc(BSCVTY, 1);
- f_vty_transceive(BSCVTY, "no allow-attach");
- f_vty_transceive(BSCVTY, "exit");
- f_vty_transceive(BSCVTY, "exit");
-
f_ctrs_msc_init();
var MSC_ConnHdlr vc_conn1;
@@ -5886,11 +5905,6 @@
vc_conn3 := f_start_handler(refers(f_tc_mscpool_compl_l3), pars3);
vc_conn3.done;
f_ctrs_msc_expect(0, "mscpool:subscr:new");
-
- f_vty_enter_cfg_msc(BSCVTY, 1);
- f_vty_transceive(BSCVTY, "allow-attach");
- f_vty_transceive(BSCVTY, "exit");
- f_vty_transceive(BSCVTY, "exit");
}
/* An MSC that has 'no allow-attach' set should still serve subscribers that are already attached according to their
@@ -5900,16 +5914,13 @@
f_init(nr_bts := 3, handler_mode := true, nr_msc := 3);
f_sleep(1.0);
+ /* Mark the second MSC as offloading, round-robin should skip this MSC now. */
+ f_vty_msc_allow_attach(BSCVTY, {true, false, true});
+
/* Control which MSC gets chosen next by the round-robin, otherwise
* would be randomly affected by which other tests ran before this. */
f_vty_transceive(BSCVTY, "mscpool roundrobin next 0");
- /* Mark the second MSC as offloading, round-robin should skip this MSC now. */
- f_vty_enter_cfg_msc(BSCVTY, 1);
- f_vty_transceive(BSCVTY, "no allow-attach");
- f_vty_transceive(BSCVTY, "exit");
- f_vty_transceive(BSCVTY, "exit");
-
f_ctrs_msc_init();
/* Round robin points at msc 0, but the valid NRI directs to msc 1, even though msc 1 has 'no allow-attach'. */
@@ -5937,11 +5948,6 @@
vc_conn3 := f_start_handler(refers(f_tc_mscpool_compl_l3), pars3);
vc_conn3.done;
f_ctrs_msc_expect(2, "mscpool:subscr:new");
-
- f_vty_enter_cfg_msc(BSCVTY, 1);
- f_vty_transceive(BSCVTY, "allow-attach");
- f_vty_transceive(BSCVTY, "exit");
- f_vty_transceive(BSCVTY, "exit");
}
/* Dyn PDCH todo: