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

neels gerrit-no-reply at lists.osmocom.org
Tue Aug 17 22:06:57 UTC 2021


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

Change subject: bsc: add TC_imm_ass_pre_chan_ack
......................................................................

bsc: add TC_imm_ass_pre_chan_ack

Add tests for the new early IMM ASS feature in osmo-bsc:
  'immediate-assignment (post-chan-ack|pre-chan-ack)'

Related: 0b44493d3de03d2750527e224df67b473fe39f93 (osmo-bsc)
Related: SYS#5559
Change-Id: If71f4562d532b6c5faf55f5fd073449a8a137ebf
---
M bsc/BSC_Tests.ttcn
M library/GSM_RR_Types.ttcn
2 files changed, 136 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 0a11a48..87dce4d 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -9574,6 +9574,136 @@
 	f_shutdown_helper();
 }
 
+function f_exp_ipa_rx_nonfatal(integer bts_nr, template (present) RSL_Message t_rx, float t_secs := 2.0,
+			       IpaStreamId sid := IPAC_PROTO_RSL_TRX0, boolean ignore_other_rx := true)
+runs on test_CT return template (omit) RSL_Message {
+	var ASP_RSL_Unitdata rx_rsl_ud;
+	timer T := t_secs;
+
+	T.start;
+	alt {
+	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(t_rx, sid)) -> value rx_rsl_ud {
+		T.stop;
+		}
+	[ignore_other_rx] IPA_RSL[bts_nr].receive { repeat; }
+	[not ignore_other_rx] IPA_RSL[bts_nr].receive {
+			log("f_exp_ipa_rx_nonfatal(): Got different message than ", t_rx);
+			T.stop;
+			return omit;
+		}
+	[] T.timeout {
+			return omit;
+		}
+	}
+	return rx_rsl_ud.rsl;
+}
+
+private function f_vty_set_imm_ass(TELNETasp_PT pt, BtsNr bts_nr := 0, charstring imm_ass_setting := "post-chan-ack") {
+	f_vty_enter_cfg_bts(pt, bts_nr);
+	f_vty_transceive(pt, "immediate-assignment " & imm_ass_setting);
+	f_vty_transceive(pt, "exit");
+	f_vty_transceive(pt, "exit");
+	f_vty_transceive(pt, "exit");
+}
+
+private function f_verify_imm_ass(RSL_Message imm_ass, template uint8_t ra := ?, template GsmFrameNumber fn := ?,
+				  template RslChannelNr chan_nr := ?)
+{
+	var RSL_IE_Body full_imm_ass_info;
+	if (not f_rsl_find_ie(imm_ass, RSL_IE_FULL_IMM_ASS_INFO, full_imm_ass_info)) {
+		setverdict(fail, "RSL Full Immediate Assign Info IE is absent");
+		mtc.stop;
+	}
+
+	var GsmRrMessage rr_imm_ass := dec_GsmRrMessage(full_imm_ass_info.full_imm_ass_info.payload);
+	var template GsmRrMessage expect_imm_ass := tr_IMM_ASS(ra := ra,
+							       fn := fn,
+							       ch_desc := tr_ChanDescH0(chan_nr),
+							       page_mode := ?);
+	if (not match(rr_imm_ass, expect_imm_ass)) {
+		log("Error: expected ", expect_imm_ass, " got ", rr_imm_ass);
+		setverdict(fail, "Failed to match Immediate Assignment");
+		mtc.stop;
+	}
+}
+
+testcase TC_imm_ass_post_chan_ack() runs on test_CT {
+	var RSL_Message chan_act;
+	var RSL_Message imm_ass;
+
+	f_init(1, false);
+	f_sleep(1.0);
+
+	/* (should be the default anyway, just to make things clear) */
+	f_vty_set_imm_ass(BSCVTY, 0, "post-chan-ack");
+
+	/* RA containing reason=LU */
+	var GsmFrameNumber fn := 2342;
+	var uint8_t ra := 2;
+	f_ipa_tx(0, ts_RSL_CHAN_RQD(int2oct(ra, 1), fn));
+
+	chan_act := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
+
+	/* First send the Chan Act ACK */
+	var RslChannelNr chan_nr := chan_act.ies[0].body.chan_nr;
+	f_ipa_tx(0, ts_RSL_CHAN_ACT_ACK(chan_nr, fn + 10));
+
+	/* Then expect the Immediate Assignment, after we ACKed the chan act */
+	imm_ass := f_exp_ipa_rx(0, tr_RSL_IMM_ASSIGN(0));
+
+	f_verify_imm_ass(imm_ass, ra, fn, chan_nr);
+
+	/* Check that the lchan is working */
+	var octetstring l3 := '00010203040506'O;
+	f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3));
+
+	var BSSAP_N_CONNECT_ind rx_c_ind;
+	BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) -> value rx_c_ind;
+	BSSAP.send(ts_BSSAP_CONNECT_res(rx_c_ind.connectionId));
+
+	f_sleep(1.0);
+	f_shutdown_helper();
+}
+
+testcase TC_imm_ass_pre_chan_ack() runs on test_CT {
+	var RSL_Message chan_act;
+	var RSL_Message imm_ass;
+
+	f_init(1, false);
+	f_sleep(1.0);
+
+	f_vty_set_imm_ass(BSCVTY, 0, "pre-chan-ack");
+
+	/* RA containing reason=LU */
+	var GsmFrameNumber fn := 2342;
+	var uint8_t ra := 2;
+	f_ipa_tx(0, ts_RSL_CHAN_RQD(int2oct(ra, 1), fn));
+
+	/* (set bts 0 cfg back to default) */
+	f_vty_set_imm_ass(BSCVTY);
+
+	chan_act := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
+	var RslChannelNr chan_nr := chan_act.ies[0].body.chan_nr;
+
+	/* *FIRST* expect the Immediate Assignment, before we ACK the chan act */
+	imm_ass := f_exp_ipa_rx(0, tr_RSL_IMM_ASSIGN(0));
+	f_verify_imm_ass(imm_ass, ra, fn, chan_nr);
+
+	/* Only now send the Chan Act ACK */
+	f_ipa_tx(0, ts_RSL_CHAN_ACT_ACK(chan_nr, fn+10));
+
+	/* Check that the lchan is working */
+	var octetstring l3 := '00010203040506'O;
+	f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3));
+
+	var BSSAP_N_CONNECT_ind rx_c_ind;
+	BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) -> value rx_c_ind;
+	BSSAP.send(ts_BSSAP_CONNECT_res(rx_c_ind.connectionId));
+
+	f_sleep(1.0);
+	f_shutdown_helper();
+}
+
 control {
 	/* CTRL interface testing */
 	execute( TC_ctrl_msc_connection_status() );
@@ -9863,6 +9993,9 @@
 	execute( TC_reassignment_fr() );
 
 	execute( TC_cm_reestablishment() );
+
+	execute( TC_imm_ass_post_chan_ack() );
+	execute( TC_imm_ass_pre_chan_ack() );
 }
 
 }
diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn
index 78db7a5..f7b00e1 100644
--- a/library/GSM_RR_Types.ttcn
+++ b/library/GSM_RR_Types.ttcn
@@ -1038,7 +1038,8 @@
 	template GsmRrMessage tr_IMM_ASS(template uint8_t ra := ?, template GsmFrameNumber fn := ?,
 					 template TimingAdvance ta := ?,
 					 template ChannelDescription ch_desc := ?,
-					 template MobileAllocationLV ma := ?) := {
+					 template MobileAllocationLV ma := ?,
+					 template PageMode page_mode := PAGE_MODE_NORMAL) := {
 		header := t_RrHeader(IMMEDIATE_ASSIGNMENT, ?),
 		payload := {
 			imm_ass := {
@@ -1048,7 +1049,7 @@
 					downlink := false,
 					tbf := false
 				},
-				page_mode := PAGE_MODE_NORMAL,
+				page_mode := page_mode,
 				chan_desc := ch_desc,
 				pkt_chan_desc := omit,
 				req_ref := tr_compute_ReqRef(ra, fn),

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25168
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: If71f4562d532b6c5faf55f5fd073449a8a137ebf
Gerrit-Change-Number: 25168
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210817/5cf4ea25/attachment.htm>


More information about the gerrit-log mailing list