Change in osmo-ttcn3-hacks[master]: bsc: add TC_cm_reestablishment

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
Fri Jul 23 02:04:18 UTC 2021


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


Change subject: bsc: add TC_cm_reestablishment
......................................................................

bsc: add TC_cm_reestablishment

Related: SYS#5130
Change-Id: I1e7d446644f46b8a0a94688e618ffb4f23a8900e
---
M bsc/BSC_Tests.ttcn
M library/L3_Templates.ttcn
2 files changed, 149 insertions(+), 0 deletions(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 53e8133..8e9707c 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -9318,6 +9318,132 @@
 	f_shutdown_helper();
 }
 
+/* CM Re-Establishment, 3GPP TS 24.008 4.5.1.6.
+ * The MS <-> BTS loses radio connection, MS shows up on second BTS and asks for CM Re-Establishment.
+ * BSC should establish a separate A conn for the same MS, the original A conn is then cleared by
+ * the MSC as the CM Re-Establishment is handled. */
+private function f_tc_cm_reestablishment_1(charstring id) runs on MSC_ConnHdlr {
+	var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+	var PDU_BSSAP ass_cmd := f_gen_ass_req();
+
+	ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+	ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+
+	f_establish_fully(ass_cmd, exp_compl);
+
+	/* The original channel loses connection, MS attemts CM Re-Establishment on another cell, see
+	 * f_tc_cm_reestablishment_2(). This established channel stays active until MSC sends a Clear Command. The time
+	 * when exactly that happens is determined by f_tc_cm_reestablishment_2(). */
+	f_sleep(2.0);
+	COORD.send("Lost connection");
+	f_logp(BSCVTY, "f_tc_cm_reestablishment_1 sleeping");
+
+	alt {
+	[] COORD.receive("Clear");
+	[] RSL.receive(tr_RSL_DEACT_SACCH(g_chan_nr)) {
+			setverdict(fail, "Unexpected channel release");
+			mtc.stop;
+		}
+	[] RSL.receive(tr_RSL_RF_CHAN_REL(g_chan_nr)) {
+			setverdict(fail, "Unexpected channel release");
+			mtc.stop;
+		}
+	}
+	f_logp(BSCVTY, "f_tc_cm_reestablishment_1 got 'Clear'");
+	f_perform_clear()
+	f_expect_dlcx_conns();
+	COORD.send("Clear done");
+
+	f_logp(BSCVTY, "f_tc_cm_reestablishment_1 done");
+
+	COORD.receive("All done");
+}
+
+private function f_tc_cm_reestablishment_2(charstring id) runs on MSC_ConnHdlr {
+	f_MscConnHdlr_init(g_pars.media_nr, host_bts, host_mgw_mgcp, FR_AMR);
+
+	/* The MS lost the connection on the first channel, now establishes another one */
+	COORD.receive("Lost connection");
+
+	var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+	var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REESTABL_REQ(mi));
+	var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3_info);
+
+	f_create_bssmap_exp(l3_enc);
+	RSL_Emulation.f_chan_est(g_pars.ra, l3_enc, g_pars.link_id, g_pars.fn);
+	BSSAP.receive(tr_BSSMAP_ComplL3(l3_enc));
+
+	/* MSC got the CM Re-Establishment request and first off clears the previous conn. */
+	COORD.send("Clear");
+	COORD.receive("Clear done");
+
+	f_sleep(2.0);
+
+	/* Answer the CM Re-Establishment with an Assignment Command. */
+	var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+	var PDU_BSSAP ass_cmd := f_gen_ass_req();
+	ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+	ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+
+	var AssignmentState st := valueof(ts_AssignmentStateInit);
+	st.voice_call := true;
+	st.is_assignment := true;
+
+	var ExpectCriteria mgcpcrit := {
+		connid := omit,
+		endpoint := omit,
+		transid := omit
+	};
+	f_create_mgcp_expect(mgcpcrit);
+
+	f_rslem_dchan_queue_enable();
+
+	BSSAP.send(ass_cmd);
+
+	var PDU_BSSAP bssap;
+
+	alt {
+	[] as_assignment(st);
+	[] as_Media();
+	[st.assignment_done] BSSAP.receive(exp_compl) {
+			f_logp(BSCVTY, "f_tc_cm_reestablishment_2 got Assignment Complete");
+			break;
+		}
+	}
+
+	f_sleep(3.0);
+
+	f_logp(BSCVTY, "f_tc_cm_reestablishment_2 clearing");
+	f_perform_clear();
+	f_logp(BSCVTY, "f_tc_cm_reestablishment_2 cleared");
+	f_expect_dlcx_conns();
+
+	f_logp(BSCVTY, "f_tc_cm_reestablishment_2 done");
+	COORD.send("All done");
+}
+
+testcase TC_cm_reestablishment() runs on test_CT {
+	var TestHdlrParams pars1 := f_gen_test_hdlr_pars();
+	var MSC_ConnHdlr vc_conn1;
+
+	var TestHdlrParams pars2 := f_gen_test_hdlr_pars();
+	var MSC_ConnHdlr vc_conn2;
+	pars2.imsi := pars1.imsi;
+	pars2.media_nr := 2;
+
+	f_init(2, true, guard_timeout := 40.0);
+	f_sleep(1.0);
+
+	vc_conn1 := f_start_handler_create(pars1);
+	vc_conn2 := f_start_handler_create(pars2);
+	connect(vc_conn1:COORD, vc_conn2:COORD);
+	f_start_handler_run(vc_conn1, refers(f_tc_cm_reestablishment_1), pars1);
+	f_start_handler_run(vc_conn2, refers(f_tc_cm_reestablishment_2), pars2);
+	vc_conn1.done;
+	vc_conn2.done;
+
+	f_shutdown_helper();
+}
 
 control {
 	/* CTRL interface testing */
@@ -9603,6 +9729,8 @@
 	execute( TC_refuse_mode_modif_to_vamos() );
 
 	execute( TC_reassignment_fr() );
+
+	execute( TC_cm_reestablishment() );
 }
 
 }
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index 53731c0..c6ebeb4 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -372,6 +372,27 @@
 	}
 }
 
+template (value) PDU_ML3_MS_NW ts_CM_REESTABL_REQ(MobileIdentityLV mi_lv) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		mm := {
+			cMReEstablReq := {
+				messageType := '000000'B, /* overwritten */
+				nsd := '00'B,
+				cipheringKeySequenceNumber := { '000'B, '0'B },
+				spare := '0000'B,
+				mobileStationClassmark2 := ts_CM2,
+				mobileIdentityLV := mi_lv,
+				locationAreaIdentification := omit,
+				deviceProperties := omit
+			}
+		}
+	}
+}
+
 template (value) CipheringKeySequenceNumberV ts_CKSN(integer key_seq) := {
 	keySequence := int2bit(key_seq, 3),
 	spare := '0'B

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25021
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: I1e7d446644f46b8a0a94688e618ffb4f23a8900e
Gerrit-Change-Number: 25021
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/20210723/7ed09b3d/attachment.htm>


More information about the gerrit-log mailing list