Change in osmo-ttcn3-hacks[master]: bsc: add test for CM Service Reject counter

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
Wed Nov 10 13:36:36 UTC 2021


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26143 )

Change subject: bsc: add test for CM Service Reject counter
......................................................................

bsc: add test for CM Service Reject counter

Related: I79b1261e5a281d9797eaaf9c27d90edd8e27c78b (osmo-bsc)
Related: SYS#4878
Change-Id: I0214b27da18af87eca9715ebf7eeeff945e3e12a
---
M bsc/BSC_Tests.ttcn
M library/L3_Templates.ttcn
2 files changed, 82 insertions(+), 2 deletions(-)

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



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 2fde8ae..4fdd059 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -766,8 +766,12 @@
 
 /* Convenience functions for rate counters using g_ctr_bts, always also including g_ctr_bsc. */
 
-private function f_ctrs_bsc_and_bts_init(integer bts_count := NUM_BTS, CounterNameVals counternames := counternames_bsc_bts_handover) runs on test_CT {
+private function f_ctrs_bts_init(integer bts_count := NUM_BTS, CounterNameVals counternames := counternames_bsc_bts_handover) runs on test_CT {
 	g_ctr_bts := f_counter_name_vals_get_n(IPA_CTRL, "bts", bts_count, counternames);
+}
+
+function f_ctrs_bsc_and_bts_init(integer bts_count := NUM_BTS, CounterNameVals counternames := counternames_bsc_bts_handover) runs on test_CT {
+	f_ctrs_bts_init(bts_count, counternames);
 	log("initial bts rate counters: ", g_ctr_bts);
 	f_ctrs_bsc_init(counternames);
 }
@@ -788,6 +792,10 @@
 	f_ctrs_bsc_add(countername, val);
 }
 
+function f_ctrs_bts_verify() runs on test_CT {
+	f_counter_name_vals_expect_n(IPA_CTRL, "bts", g_ctr_bts);
+}
+
 /*  f_ctrs_bsc_and_bts_init();
  *  f_do_thing(on_bts := 0);
  *  f_do_thing(on_bts := 0);
@@ -797,7 +805,7 @@
  *  f_ctrs_bsc_and_bts_verify();
  */
 private function f_ctrs_bsc_and_bts_verify() runs on test_CT {
-	f_counter_name_vals_expect_n(IPA_CTRL, "bts", g_ctr_bts);
+	f_ctrs_bts_verify();
 	f_ctrs_bsc_verify();
 }
 
@@ -10346,6 +10354,59 @@
 	f_shutdown_helper();
 }
 
+const CounterNameVals counternames_cm_serv_rej := {
+	{ "cm_serv_rej", 0 },
+	{ "cm_serv_rej:imsi_unknown_in_hlr", 0 },
+	{ "cm_serv_rej:illegal_ms", 0 },
+	{ "cm_serv_rej:imsi_unknown_in_vlr", 0 },
+	{ "cm_serv_rej:imei_not_accepted", 0 },
+	{ "cm_serv_rej:illegal_me", 0 },
+	{ "cm_serv_rej:plmn_not_allowed", 0 },
+	{ "cm_serv_rej:loc_not_allowed", 0 },
+	{ "cm_serv_rej:roaming_not_allowed", 0 },
+	{ "cm_serv_rej:network_failure", 0 },
+	{ "cm_serv_rej:synch_failure", 0 },
+	{ "cm_serv_rej:congestion", 0 },
+	{ "cm_serv_rej:srv_opt_not_supported", 0 },
+	{ "cm_serv_rej:rqd_srv_opt_not_supported", 0 },
+	{ "cm_serv_rej:srv_opt_tmp_out_of_order", 0 },
+	{ "cm_serv_rej:call_can_not_be_identified", 0 },
+	{ "cm_serv_rej:incorrect_message", 0 },
+	{ "cm_serv_rej:invalid_mandantory_inf", 0 },
+	{ "cm_serv_rej:msg_type_not_implemented", 0 },
+	{ "cm_serv_rej:msg_type_not_compatible", 0 },
+	{ "cm_serv_rej:inf_eleme_not_implemented", 0 },
+	{ "cm_serv_rej:condtional_ie_error", 0 },
+	{ "cm_serv_rej:msg_not_compatible", 0 },
+	{ "cm_serv_rej:protocol_error", 0 },
+	{ "cm_serv_rej:retry_in_new_cell", 0 }
+};
+
+private function f_TC_cm_serv_rej(charstring id) runs on MSC_ConnHdlr
+{
+	f_create_chan_and_exp();
+	BSSAP.send(ts_PDU_DTAP_MT(ts_CM_SERV_REJ('02'O), '00'O));
+	f_sleep(3.0);
+}
+testcase TC_cm_serv_rej() runs on test_CT {
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(1, true);
+	f_sleep(1.0);
+
+	f_ctrs_bts_init(1, counternames_cm_serv_rej);
+
+	vc_conn := f_start_handler(refers(f_TC_cm_serv_rej), pars);
+	vc_conn.done;
+
+	f_ctrs_bts_add(0, "cm_serv_rej", 1);
+	f_ctrs_bts_add(0, "cm_serv_rej:imsi_unknown_in_hlr", 1);
+	f_ctrs_bts_verify();
+
+	f_shutdown_helper();
+}
+
 /* Reproduce a segfault happening when the SDCCH (primary) lchan is lost in-between a TCH Channel Activ and its Channel
  * Activ Ack (SYS#5627). */
 private function f_TC_lost_sdcch_during_assignment(charstring id) runs on MSC_ConnHdlr {
@@ -10894,6 +10955,8 @@
 	execute( TC_ratectr_all_available_allocated() );
 	execute( TC_ratectr_all_available_allocated_dyn() );
 
+	execute( TC_cm_serv_rej() );
+
 	execute( TC_lost_sdcch_during_assignment() );
 }
 
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index 997b433..e6efb68 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -389,6 +389,23 @@
 	}
 }
 
+template (value) PDU_ML3_NW_MS ts_CM_SERV_REJ(OCT1 rejectCause) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		mm := {
+			cMServiceReject := {
+				messageType := '000000'B, /* overwritten */
+				nsd := '00'B,
+				rejectCause := rejectCause,
+				t3246_Value := omit
+			}
+		}
+	}
+}
+
 template (value) PDU_ML3_MS_NW ts_CM_REESTABL_REQ(MobileIdentityLV mi_lv) := {
 	discriminator := '0000'B, /* overwritten */
 	tiOrSkip := {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26143
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: I0214b27da18af87eca9715ebf7eeeff945e3e12a
Gerrit-Change-Number: 26143
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211110/517b4be5/attachment.htm>


More information about the gerrit-log mailing list