Change in osmo-ttcn3-hacks[master]: bsc: add TC_stat_num_bts_connected_* tests

neels gerrit-no-reply at lists.osmocom.org
Sun Aug 29 13:53:22 UTC 2021


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


Change subject: bsc: add TC_stat_num_bts_connected_* tests
......................................................................

bsc: add TC_stat_num_bts_connected_* tests

Related: SYS#5542
Related: I2057a798e681a169cc03243a09b3d6449734c010 (osmo-bsc)
Change-Id: Ic1b35b7406547f92818afe399a2383d154576409
---
M bsc/BSC_Tests.ttcn
1 file changed, 78 insertions(+), 0 deletions(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index c8cc3de..e820a22 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -76,6 +76,7 @@
 import from TCCConversion_Functions all;
 
 const integer NUM_BTS := 3;
+const integer NUM_BTS_CFG := 4; /* we have 4 BTS in the osmo-bsc.cfg (for inter-BSC HO tests) but use only 3 */
 const integer NUM_MSC := 3;
 const float T3101_MAX := 12.0;
 
@@ -2837,6 +2838,80 @@
 	f_shutdown_helper();
 }
 
+/* Verify correct stats on the number of configured and connected MSCs */
+private function f_tc_stat_num_bts_connected(integer expect_num_bts_connected) runs on MSC_ConnHdlr {
+	g_pars := f_gen_test_hdlr_pars();
+	var StatsDExpects expect := {
+		{ name := "TTCN3.bsc.0.num_bts.oml_connected", mtype := "g", min := expect_num_bts_connected, max := NUM_BTS_CFG },
+		{ name := "TTCN3.bsc.0.num_bts.all_trx_rsl_connected", mtype := "g", min := expect_num_bts_connected, max := expect_num_bts_connected },
+		{ name := "TTCN3.bsc.0.num_bts.total", mtype := "g", min := NUM_BTS_CFG, max := NUM_BTS_CFG },
+		{ name := "TTCN3.bsc.0.num_trx.rsl_connected", mtype := "g", min := expect_num_bts_connected, max := expect_num_bts_connected },
+		{ name := "TTCN3.bsc.0.num_trx.total", mtype := "g", min := NUM_BTS_CFG, max := NUM_BTS_CFG }
+	};
+	f_statsd_expect(expect);
+}
+
+private function f_tc_stat_num_bts_connected_ctrl(integer expect_num_bts_connected) runs on test_CT {
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_bts:all_trx_rsl_connected", int2str(expect_num_bts_connected));
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_bts:total", int2str(NUM_BTS_CFG));
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_trx:rsl_connected", int2str(expect_num_bts_connected));
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_trx:total", int2str(NUM_BTS_CFG));
+}
+
+/* Verify that when 1 MSC is active, that num_bts:connected reports 1. */
+private function f_tc_stat_num_bts_connected_1(charstring id) runs on MSC_ConnHdlr {
+	f_tc_stat_num_bts_connected(1);
+}
+testcase TC_stat_num_bts_connected_1() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(nr_bts := 1, handler_mode := true, nr_msc := 1);
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_tc_stat_num_bts_connected_1));
+	vc_conn.done;
+
+	/* Also verify stat exposed on CTRL interface */
+	f_tc_stat_num_bts_connected_ctrl(1);
+
+	f_shutdown_helper();
+}
+
+/* Verify that when 2 MSCs are active, that num_bts:connected reports 2. */
+private function f_tc_stat_num_bts_connected_2(charstring id) runs on MSC_ConnHdlr {
+	f_tc_stat_num_bts_connected(2);
+}
+testcase TC_stat_num_bts_connected_2() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(nr_bts := 2, handler_mode := true, nr_msc := 1);
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_tc_stat_num_bts_connected_2));
+	vc_conn.done;
+
+	/* Also verify stat exposed on CTRL interface */
+	f_tc_stat_num_bts_connected_ctrl(2);
+
+	f_shutdown_helper();
+}
+
+/* Verify that when 3 MSCs are active, that num_bts:connected reports 3. */
+private function f_tc_stat_num_bts_connected_3(charstring id) runs on MSC_ConnHdlr {
+	f_tc_stat_num_bts_connected(3);
+}
+testcase TC_stat_num_bts_connected_3() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(nr_bts := 3, handler_mode := true, nr_msc := 1);
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_tc_stat_num_bts_connected_3));
+	vc_conn.done;
+
+	/* Also verify stat exposed on CTRL interface */
+	f_tc_stat_num_bts_connected_ctrl(3);
+
+	f_shutdown_helper();
+}
+
 testcase TC_ctrl() runs on test_CT {
 	var charstring ctrl_resp;
 
@@ -9958,6 +10033,9 @@
 	execute( TC_stat_num_msc_connected_1() );
 	execute( TC_stat_num_msc_connected_2() );
 	execute( TC_stat_num_msc_connected_3() );
+	execute( TC_stat_num_bts_connected_1() );
+	execute( TC_stat_num_bts_connected_2() );
+	execute( TC_stat_num_bts_connected_3() );
 	execute( TC_ctrl() );
 	if (mp_bssap_cfg[0].transport == BSSAP_TRANSPORT_SCCPlite_SERVER) {
 		execute( TC_ctrl_location() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25272
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: Ic1b35b7406547f92818afe399a2383d154576409
Gerrit-Change-Number: 25272
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/20210829/b418c740/attachment.htm>


More information about the gerrit-log mailing list