Change in osmo-ttcn3-hacks[master]: pcu: Introduce test TC_dl_multislot_tbf

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
Wed Oct 28 20:31:56 UTC 2020


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


Change subject: pcu: Introduce test TC_dl_multislot_tbf
......................................................................

pcu: Introduce test TC_dl_multislot_tbf

Some helper functions are introduced to be able to submit and expect
messages on a given TRX+TS, which is required for setups with several
TRX and PDCH-enabled TS different than the default.

Change-Id: I417953a4c89dec82500b3b66f08ed648d266d813
---
M pcu/GPRS_Components.ttcn
M pcu/PCU_Tests.ttcn
2 files changed, 125 insertions(+), 1 deletion(-)



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

diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index ec62671..16870fa 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -330,12 +330,48 @@
 	return dl_tbf;
 }
 
+function f_dltbf_num_slots(inout DlTbf dl_tbf)
+runs on MS_BTS_IFACE_CT return uint3_t  {
+	var uint3_t n := 0;
+	for (var integer i := 0; i < lengthof(dl_tbf.ts_mask); i := i + 1) {
+		if (dl_tbf.ts_mask[i] == '1'B) {
+			n := n + 1;
+		}
+	}
+	return n;
+}
+
 function f_ultbf_inc_bsn(inout UlTbf ul_tbf)
 runs on MS_BTS_IFACE_CT {
 	ul_tbf.bsn := ul_tbf.bsn + 1;
 	ul_tbf.bsn := ul_tbf.bsn mod 128; /* FIXME: EGPRS SNS: 2048 */
 }
 
+function f_ultbf_next_ts(inout UlTbf ul_tbf)
+runs on MS_BTS_IFACE_CT return uint3_t {
+	/* FIXME: in the future we probably want to store last used internally
+	/* and continue from there */
+	for (var integer i := 0; i < lengthof(ul_tbf.ts_mask); i := i + 1) {
+		if (ul_tbf.ts_mask[i] == '1'B) {
+			return i;
+		}
+	}
+	setverdict(fail, "No TS available for tx!");
+	f_shutdown(__BFILE__, __LINE__);
+	return 0;
+}
+
+function f_ultbf_num_slots(inout UlTbf ul_tbf)
+runs on MS_BTS_IFACE_CT return uint3_t  {
+	var uint3_t n := 0;
+	for (var integer i := 0; i < lengthof(ul_tbf.ts_mask); i := i + 1) {
+		if (ul_tbf.ts_mask[i] == '1'B) {
+			n := n + 1;
+		}
+	}
+	return n;
+}
+
 function f_ms_use_ra(inout GprsMS ms, uint16_t ra, uint8_t ra_is_11bit := 0)
 runs on MS_BTS_IFACE_CT {
 	ms.ra_is_11bit := ra_is_11bit;
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 67d4484..67d7f82 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -148,6 +148,8 @@
 	var boolean g_egprs_only := false;
 	var boolean g_force_two_phase_access := false;
 
+	var PCUIF_info_ind g_info_ind;
+
 	/* Guard timeout */
 	timer g_T_guard := 60.0;
 };
@@ -159,6 +161,32 @@
 		}
 }
 
+private function f_arfcn2trxnr(uint10_t arfcn) runs on RAW_PCU_Test_CT return uint3_t {
+	if (PCUIF_Types.mp_pcuif_version >= 10) {
+		for (var integer i := 0; i < lengthof(g_info_ind.trx.v10); i := i + 1) {
+			if (g_info_ind.trx.v10[i].arfcn == arfcn) {
+				return i;
+			}
+		}
+	} else {
+		for (var integer i := 0; i < lengthof(g_info_ind.trx.v09); i := i + 1) {
+			if (g_info_ind.trx.v09[i].arfcn == arfcn) {
+				return i;
+			}
+		}
+	}
+	setverdict(fail, "Unable to find TRX NR for arfcn ", arfcn);
+	f_shutdown(__BFILE__, __LINE__);
+	return 0;
+}
+
+private function f_ms_tx_TsTrxBtsNum(inout GprsMS ms)
+runs on RAW_PCU_Test_CT return TsTrxBtsNum {
+	var uint3_t ts_nr := f_ultbf_next_ts(ms.ul_tbf);
+	var uint3_t trx_nr := f_arfcn2trxnr(ms.ul_tbf.arfcn);
+	return valueof(ts_TsTrxBtsNum(ts_nr, trx_nr));
+}
+
 private function f_pcuvty_set_allowed_cs_mcs() runs on RAW_PCU_Test_CT {
 	f_vty_config2(PCUVTY, {"pcu"}, "cs " & int2str(g_cs_initial_dl) & " " & int2str(g_cs_initial_ul));
 	f_vty_config2(PCUVTY, {"pcu"}, "cs max " & int2str(g_cs_max_dl) & " " & int2str(g_cs_max_ul));
@@ -210,6 +238,7 @@
 
 function f_init_raw(charstring id, template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default)
 runs on RAW_PCU_Test_CT {
+	g_info_ind := valueof(info_ind);
 	/* Start the guard timer */
 	g_T_guard.start;
 	activate(as_Tguard_RAW());
@@ -232,7 +261,7 @@
 	connect(self:STATSD_PROC, vc_STATSD:STATSD_PROC);
 
 	vc_PCUIF.start(f_PCUIF_CT_handler(mp_pcu_sock_path));
-	vc_BTS.start(f_BTS_CT_handler(0, valueof(info_ind)));
+	vc_BTS.start(f_BTS_CT_handler(0, valueof(g_info_ind)));
 
 	/* Wait until the BTS is ready (SI13 negotiated) */
 	BTS.receive(tr_RAW_PCU_EV(BTS_EV_SI13_NEGO));
@@ -1636,6 +1665,64 @@
 	f_shutdown(__BFILE__, __LINE__, final := true);
 }
 
+/* Verify allocation and use of multislot tbf. SYS#5131 */
+testcase TC_dl_multislot_tbf() runs on RAW_PCU_Test_CT {
+	var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default);
+	var octetstring data := f_rnd_octstring(10);
+	var PacketDlAssign dl_tbf_ass;
+	var RlcmacDlBlock dl_block;
+	var uint32_t poll_fn;
+	var uint32_t sched_fn;
+	var GprsMS ms;
+	timer T := 5.0;
+
+	/* Initialize NS/BSSGP side */
+	f_init_bssgp();
+	/* Initialize GPRS MS side */
+	f_init_gprs_ms();
+	ms := g_ms[0]; /* We only use first MS in this test */
+
+	/* Only 1 TRX with 8 PDCH */
+	for (var integer i := 0; i < lengthof(info_ind.trx.v10); i := i + 1) {
+		info_ind.trx.v10[i].pdch_mask := '00000000'B;
+	}
+	info_ind.trx.v10[0].pdch_mask := '11111111'B;
+
+	/* Initialize the PCU interface abstraction */
+	f_init_raw(testcasename(), info_ind);
+
+	/* Establish BSSGP connection to the PCU */
+	f_bssgp_establish();
+	f_bssgp_client_llgmm_assign('FFFFFFFF'O, ms.tlli);
+
+	/* Establish an Uplink TBF, this way the PCU can send DL Assignment
+	  through PDCH (no multiblock assignment possible through PCH) */
+	f_ms_establish_ul_tbf(ms);
+
+	/* Send one UL block (with TLLI since we are in One-Phase Access
+	   contention resoultion) and make sure it is ACKED fine */
+	f_ms_tx_ul_data_block(ms, data, with_tlli := true, nr := f_ms_tx_TsTrxBtsNum(ms));
+	/* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */
+	f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, poll_fn, nr := f_ms_tx_TsTrxBtsNum(ms));
+	//f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), poll_fn, nr := f_ms_tx_TsTrxBtsNum(ms));
+
+	/* SGSN sends some DL data, PCU will page on CCCH (PCH) */
+	var MultislotCap_GPRS_BSSGP mscap_gprs := {
+		gprsmultislotclass := '10010'B, /* MS class 18, supports 8 DL and 8 UL */
+		gprsextendeddynalloccap := '0'B
+	};
+	var MSRadioAccessCapabilityV_BSSGP ms_racap := { valueof(ts_RaCapRec_BSSGP('0001'B /* E-GSM */, mscap_gprs, omit)) };
+	BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, ms_racap));
+	dl_block := f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS, nr := f_ms_tx_TsTrxBtsNum(ms));
+	if (f_dltbf_num_slots(ms.dl_tbf) != 4) {
+		setverdict(fail, "Expected 4 PDCH slot allocated but got ", f_dltbf_num_slots(ms.dl_tbf));
+		f_shutdown(__BFILE__, __LINE__);
+	}
+	f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn, nr := f_ms_tx_TsTrxBtsNum(ms));
+
+	f_shutdown(__BFILE__, __LINE__, final := true);
+}
+
 /* Test scenario where MS wants to request a new TBF once the current one is
  * ending, by means of sending a Packet Resource Request on ul slot provided by
  * last Pkt Ul ACK's RRBP.
@@ -2571,6 +2658,7 @@
 		execute( TC_pcuif_fh_pkt_ass_ul() );
 		execute( TC_pcuif_fh_pkt_ass_dl() );
 		execute( TC_multitrx_multims_alloc() );
+		execute( TC_dl_multislot_tbf() );
 	}
 
 	execute( TC_pcuif_info_ind_subsequent() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20947
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: I417953a4c89dec82500b3b66f08ed648d266d813
Gerrit-Change-Number: 20947
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201028/b3de5c3b/attachment.htm>


More information about the gerrit-log mailing list