Change in osmo-ttcn3-hacks[master]: pcu: Introduce tests to check UL CS initial and max

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/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Dec 2 11:14:50 UTC 2019


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

Change subject: pcu: Introduce tests to check UL CS initial and max
......................................................................

pcu: Introduce tests to check UL CS initial and max

Related: OS#4286
Change-Id: I3aa654e6f678698e5b8cb4914f1ca5b39fc08568
---
M pcu/PCU_Tests_RAW.ttcn
1 file changed, 151 insertions(+), 1 deletion(-)

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



diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 5bb5fa7..24187b7 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -1058,7 +1058,7 @@
 
 	var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
 		tfi := ul_tbf_ass.dynamic.tfi_assignment,
-		cv := 15, /* 15 UL blocks to be sent (to be overridden in loop) */
+		cv := 15, /* 16 UL blocks to be sent (to be overridden in loop) */
 		bsn := 0, /* TODO: what should be here? */
 		blocks := { /* To be generated in loop */ });
 
@@ -1111,6 +1111,154 @@
 	}
 }
 
+/* Test the max UL CS set by VTY works fine */
+testcase TC_cs_initial_ul() runs on RAW_PCU_Test_CT {
+	var GsmRrMessage rr_imm_ass;
+	var PacketUlAssign ul_tbf_ass;
+	var RlcmacDlBlock dl_block;
+	var boolean ok;
+	var integer lqual_cb;
+	var ChCodingCommand last_ch_coding;
+
+	/* Initialize the PCU interface abstraction */
+	f_init_raw(testcasename());
+
+	/* Set initial UL CS to 3 */
+	g_cs_initial_ul := 3;
+	f_pcuvty_set_allowed_cs_mcs();
+	f_pcuvty_set_link_quality_ranges();
+
+	/* Take lqual (dB->cB) so that we stay in that CS */
+	lqual_cb := g_cs_lqual_ranges[2].low * 10;
+
+	/* Establish an Uplink TBF */
+	ok := f_establish_tbf(rr_imm_ass);
+	if (not ok) {
+		setverdict(fail, "Failed to establish TBF");
+		mtc.stop;
+	}
+
+	ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
+	if (not ok) {
+		setverdict(fail, "Immediate Assignment not an Uplink TBF");
+		mtc.stop;
+	}
+
+	var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
+		tfi := ul_tbf_ass.dynamic.tfi_assignment,
+		cv := 3, /* 8 UL blocks to be sent (to be overridden in loop) */
+		bsn := 0, /* TODO: what should be here? */
+		blocks := { /* To be generated in loop */ });
+
+	/* HACK: patch missing TLLI; otherwise OsmoPCU rejects DATA.req */
+	ul_data.data.tlli := '00000001'O;
+
+	/* 3 UL blocks, check we are in same initial CS: */
+	for (var integer i := 0; i < 3; i := i + 1) {
+		/* Prepare a new UL block (CV, random payload) */
+		ul_data.data.mac_hdr.countdown := (7 - i);
+		ul_data.data.blocks := { valueof(t_RLCMAC_LLCBLOCK(f_rnd_octstring(10))) };
+
+		/* Enqueue DATA.ind (both TDMA frame and block numbers to be patched) */
+		f_tx_rlcmac_ul_block(ul_data, lqual_cb);
+
+		/* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */
+		f_rx_rlcmac_dl_block_exp_ack_nack(dl_block);
+		last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd;
+	}
+
+	if (last_ch_coding != CH_CODING_CS3) {
+		setverdict(fail, "Channel Coding does not match our expectations (CS-3): ", last_ch_coding);
+		mtc.stop;
+	}
+
+	setverdict(pass);
+
+	/* Remaining UL blocks are used to make sure regardless of initial
+	/* lqual, we can go lower at any time */
+
+	/* 5 UL blocks, check we are in same initial CS: */
+	for (var integer i := 3; i < 8; i := i + 1) {
+		/* Prepare a new UL block (CV, random payload) */
+		ul_data.data.mac_hdr.countdown := (7 - i);
+		ul_data.data.blocks := { valueof(t_RLCMAC_LLCBLOCK(f_rnd_octstring(10))) };
+
+		/* Enqueue DATA.ind (both TDMA frame and block numbers to be patched) */
+		f_tx_rlcmac_ul_block(ul_data, 0); /* 0 dB, make sure we downgrade CS */
+
+		/* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */
+		f_rx_rlcmac_dl_block_exp_ack_nack(dl_block);
+
+		last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd;
+	}
+
+	if (last_ch_coding != CH_CODING_CS1) {
+		setverdict(fail, "Channel Coding does not match our expectations (CS-1): ", last_ch_coding);
+	} else {
+		setverdict(pass);
+	}
+}
+
+/* Test the max UL CS set by VTY works fine */
+testcase TC_cs_max_ul() runs on RAW_PCU_Test_CT {
+	var GsmRrMessage rr_imm_ass;
+	var PacketUlAssign ul_tbf_ass;
+	var RlcmacDlBlock dl_block;
+	var boolean ok;
+	var ChCodingCommand last_ch_coding;
+
+	/* Initialize the PCU interface abstraction */
+	f_init_raw(testcasename());
+
+	/* Set maximum allowed UL CS to 3 */
+	g_cs_max_ul := 3;
+	f_pcuvty_set_allowed_cs_mcs();
+	f_pcuvty_set_link_quality_ranges();
+
+	/* Establish an Uplink TBF */
+	ok := f_establish_tbf(rr_imm_ass);
+	if (not ok) {
+		setverdict(fail, "Failed to establish TBF");
+		mtc.stop;
+	}
+
+	ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
+	if (not ok) {
+		setverdict(fail, "Immediate Assignment not an Uplink TBF");
+		mtc.stop;
+	}
+
+	var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
+		tfi := ul_tbf_ass.dynamic.tfi_assignment,
+		cv := 15, /* 16 UL blocks to be sent (to be overridden in loop) */
+		bsn := 0, /* TODO: what should be here? */
+		blocks := { /* To be generated in loop */ });
+
+	/* HACK: patch missing TLLI; otherwise OsmoPCU rejects DATA.req */
+	ul_data.data.tlli := '00000001'O;
+
+	/* 16 UL blocks */
+	for (var integer i := 0; i < 16; i := i + 1) {
+		/* Prepare a new UL block (CV, random payload) */
+		ul_data.data.mac_hdr.countdown := (15 - i);
+		ul_data.data.blocks := { valueof(t_RLCMAC_LLCBLOCK(f_rnd_octstring(10))) };
+
+		/* Enqueue DATA.ind (both TDMA frame and block numbers to be patched) */
+		f_tx_rlcmac_ul_block(ul_data, 40*10); /* 40 dB */
+
+		/* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */
+		f_rx_rlcmac_dl_block_exp_ack_nack(dl_block);
+
+		last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd;
+	}
+
+	if (last_ch_coding != CH_CODING_CS3) {
+		setverdict(fail, "Channel Coding does not match our expectations (CS-3): ", last_ch_coding);
+	} else {
+		setverdict(pass);
+	}
+}
+
 /* Verify PCU drops TBF after some time of inactivity. */
 testcase TC_t3169() runs on RAW_PCU_Test_CT {
 	var PCUIF_info_ind info_ind;
@@ -1233,6 +1381,8 @@
 	execute( TC_ta_rach_imm_ass() );
 	execute( TC_ta_ptcch_ul_multi_tbf() );
 	execute( TC_cs_lqual_ul_tbf() );
+	execute( TC_cs_initial_ul() );
+	execute( TC_cs_max_ul() );
 	execute( TC_t3169() );
 	execute( TC_mo_ping_pong() );
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16337
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: I3aa654e6f678698e5b8cb4914f1ca5b39fc08568
Gerrit-Change-Number: 16337
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
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/20191202/05608dd6/attachment.htm>


More information about the gerrit-log mailing list