Change in osmo-ttcn3-hacks[master]: fix mscpool cleanup (fixes LCLS tests)

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Sun Aug 9 21:36:42 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19554 )


Change subject: fix mscpool cleanup (fixes LCLS tests)
......................................................................

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
---
M bsc/BSC_Tests.ttcn
1 file changed, 27 insertions(+), 22 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/19554/1

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 5bd0e4f..c35100e 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -832,6 +832,23 @@
 		}
 }
 
+/* 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]) {
+			f_vty_transceive(pt, "allow-attach");
+		} else {
+			f_vty_transceive(pt, "no allow-attach");
+		}
+		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 +871,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 +890,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 +5872,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 +5904,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 +5913,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 +5947,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:

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19554
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I02ad58ed7d0d0aac61e393b415e09c6c5c8a70ca
Gerrit-Change-Number: 19554
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200809/ac6b9dc7/attachment.htm>


More information about the gerrit-log mailing list