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
Tue Sep 14 08:31:05 UTC 2021


neels has submitted this change. ( 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
Depends: Idace66b37492fe96b2f2e133a69cac7960ca279c (libosmocore)
Depends: If76bbf9b3adb64c68d5c31c6b526fa71a99996ae (osmo-bsc)
Change-Id: I178dcf4516606aa561d47b06061b8a416d3c40cf
---
M bsc/BSC_Tests.ttcn
1 file changed, 53 insertions(+), 0 deletions(-)

Approvals:
  neels: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 00d3d3f..cb28a20 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -2772,6 +2772,56 @@
 	f_shutdown_helper();
 }
 
+/* Verify correct stats on the number of configured and connected MSCs */
+private function f_tc_stat_num_msc_connected_msc_connhdlr(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);
+}
+
+private function f_tc_stat_num_msc_connected_test_ct(void_fn tc_fn, integer nr_msc) runs on test_CT
+{
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(nr_bts := 1, handler_mode := true, nr_msc := nr_msc);
+	f_sleep(1.0);
+	vc_conn := f_start_handler(tc_fn);
+	vc_conn.done;
+
+	/* Also verify stat exposed on CTRL interface */
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_msc:connected", int2str(nr_msc));
+	f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_msc:total", int2str(NUM_MSC));
+
+	f_shutdown_helper();
+}
+
+/* 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_msc_connhdlr(1);
+}
+testcase TC_stat_num_msc_connected_1() runs on test_CT {
+	f_tc_stat_num_msc_connected_test_ct(refers(f_tc_stat_num_msc_connected_1), 1);
+}
+
+/* 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_msc_connhdlr(2);
+}
+testcase TC_stat_num_msc_connected_2() runs on test_CT {
+	f_tc_stat_num_msc_connected_test_ct(refers(f_tc_stat_num_msc_connected_2), 2);
+}
+
+/* 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_msc_connhdlr(3);
+}
+testcase TC_stat_num_msc_connected_3() runs on test_CT {
+	f_tc_stat_num_msc_connected_test_ct(refers(f_tc_stat_num_msc_connected_3), 3);
+}
+
 testcase TC_ctrl() runs on test_CT {
 	var charstring ctrl_resp;
 
@@ -9962,6 +10012,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: 9
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210914/8901e9f2/attachment.htm>


More information about the gerrit-log mailing list