summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2021-08-29 15:32:00 +0200
committerneels <nhofmeyr@sysmocom.de>2021-09-14 08:31:04 +0000
commit5ce3ae400dd14eac51128eee93b5eafcf745af38 (patch)
tree415dcfa124ad67384eb9738f11bb88b7a38395ba
parent0bc470d2066687e521f0a1069dc3d766735475ab (diff)
bsc: add TC_stat_num_bts_connected_* tests
-rw-r--r--bsc/BSC_Tests.ttcn58
1 files changed, 58 insertions, 0 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index cb28a20b..cbe6bad7 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -76,6 +76,7 @@ import from GSM_RestOctets all;
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;
@@ -2822,6 +2823,60 @@ 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);
}
+/* Verify correct stats on the number of configured and connected MSCs */
+private function f_tc_stat_num_bts_connected_msc_connhdlr(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_test_ct(void_fn tc_fn, integer nr_bts) runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+
+ f_init(nr_bts := nr_bts, handler_mode := true, nr_msc := 1);
+ 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_bts:all_trx_rsl_connected", int2str(nr_bts));
+ 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(nr_bts));
+ f_ctrl_get_exp(IPA_CTRL, "stat_item.last.bsc.0.num_trx:total", int2str(NUM_BTS_CFG));
+
+ f_shutdown_helper();
+}
+
+/* Verify that when 1 BTS is connected, that num_{bts,trx}:*_connected reports 1. */
+private function f_tc_stat_num_bts_connected_1(charstring id) runs on MSC_ConnHdlr {
+ f_tc_stat_num_bts_connected_msc_connhdlr(1);
+}
+testcase TC_stat_num_bts_connected_1() runs on test_CT {
+ f_tc_stat_num_bts_connected_test_ct(refers(f_tc_stat_num_bts_connected_1), 1);
+}
+
+/* Verify that when 2 BTS is connected, that num_{bts,trx}:*_connected reports 2. */
+private function f_tc_stat_num_bts_connected_2(charstring id) runs on MSC_ConnHdlr {
+ f_tc_stat_num_bts_connected_msc_connhdlr(2);
+}
+testcase TC_stat_num_bts_connected_2() runs on test_CT {
+ f_tc_stat_num_bts_connected_test_ct(refers(f_tc_stat_num_bts_connected_2), 2);
+}
+
+/* Verify that when 3 BTS is connected, that num_{bts,trx}:*_connected reports 3. */
+private function f_tc_stat_num_bts_connected_3(charstring id) runs on MSC_ConnHdlr {
+ f_tc_stat_num_bts_connected_msc_connhdlr(3);
+}
+testcase TC_stat_num_bts_connected_3() runs on test_CT {
+ f_tc_stat_num_bts_connected_test_ct(refers(f_tc_stat_num_bts_connected_3), 3);
+}
+
testcase TC_ctrl() runs on test_CT {
var charstring ctrl_resp;
@@ -10015,6 +10070,9 @@ control {
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() );