Change in osmo-ttcn3-hacks[master]: bsc: add TC_stat_num_msc_connected* 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
Mon Aug 23 22:23:59 UTC 2021


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


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

bsc: add TC_stat_num_msc_connected* tests

Verify MSC connection count stats.

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



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 75a9d93..fb9d4e2 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -2728,6 +2728,73 @@
 	f_shutdown_helper();
 }
 
+/* Verify correct stats on the number of configured and connected MSCs */
+private function f_tc_stat_num_msc_connected(integer expect_num_msc_connected) runs on MSC_ConnHdlr {
+	g_pars := f_gen_test_hdlr_pars();
+	var StatsDExpects expect := {
+		{ name := "TTCN3.bsc.0.num_msc.connected", mtype := "g", min := expect_num_msc_connected, max := expect_num_msc_connected },
+		{ name := "TTCN3.bsc.0.num_msc.total", mtype := "g", min := NUM_MSC, max := NUM_MSC }
+	};
+	f_statsd_expect(expect);
+}
+
+/* Verify that when 1 MSC is active, that num_msc:connected reports 1. */
+private function f_tc_stat_num_msc_connected_1(charstring id) runs on MSC_ConnHdlr {
+	f_tc_stat_num_msc_connected(1);
+}
+testcase TC_stat_num_msc_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_msc_connected_1));
+	vc_conn.done;
+
+	/* Also verify stat exposed on CTRL interface */
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_msc:connected", "1");
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_msc:total", int2str(NUM_MSC));
+
+	f_shutdown_helper();
+}
+
+/* Verify that when 2 MSCs are active, that num_msc:connected reports 2. */
+private function f_tc_stat_num_msc_connected_2(charstring id) runs on MSC_ConnHdlr {
+	f_tc_stat_num_msc_connected(2);
+}
+testcase TC_stat_num_msc_connected_2() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(nr_bts := 1, handler_mode := true, nr_msc := 2);
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_tc_stat_num_msc_connected_2));
+	vc_conn.done;
+
+	/* Also verify stat exposed on CTRL interface */
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_msc:connected", "2");
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_msc:total", int2str(NUM_MSC));
+
+	f_shutdown_helper();
+}
+
+/* Verify that when 3 MSCs are active, that num_msc:connected reports 3. */
+private function f_tc_stat_num_msc_connected_3(charstring id) runs on MSC_ConnHdlr {
+	f_tc_stat_num_msc_connected(3);
+}
+testcase TC_stat_num_msc_connected_3() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(nr_bts := 1, handler_mode := true, nr_msc := 3);
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_tc_stat_num_msc_connected_3));
+	vc_conn.done;
+
+	/* Also verify stat exposed on CTRL interface */
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_msc:connected", "3");
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_msc:total", int2str(NUM_MSC));
+
+	f_shutdown_helper();
+}
+
 testcase TC_ctrl() runs on test_CT {
 	var charstring ctrl_resp;
 
@@ -9846,6 +9913,9 @@
 	/* CTRL interface testing */
 	execute( TC_ctrl_msc_connection_status() );
 	execute( TC_ctrl_msc0_connection_status() );
+	execute( TC_stat_num_msc_connected_1() );
+	execute( TC_stat_num_msc_connected_2() );
+	execute( TC_stat_num_msc_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/+/25228
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: I178dcf4516606aa561d47b06061b8a416d3c40cf
Gerrit-Change-Number: 25228
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/20210823/87e147be/attachment.htm>


More information about the gerrit-log mailing list