Change in osmo-ttcn3-hacks[master]: pcu: Adapt tests to pass with new idle blocks from PCU

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 Sep 22 14:01:09 UTC 2021


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


Change subject: pcu: Adapt tests to pass with new idle blocks from PCU
......................................................................

pcu: Adapt tests to pass with new idle blocks from PCU

Change-Id: I6e96a7569640695ccfaa94b471384fa301bccd62
---
M pcu/PCU_Tests.ttcn
1 file changed, 61 insertions(+), 28 deletions(-)



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

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 0324439..32dae1f 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -397,6 +397,7 @@
 /* Make sure TBF is released and no data is sent for in after reciving a Suspend Request from that MS. See OS#4761 */
 testcase TC_pcuif_suspend_active_tbf() runs on RAW_PCU_Test_CT {
 	var octetstring ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.bvc[0].cell_id.ra_id);
+	var BTS_PDTCH_Block data_msg;
 	var RlcmacDlBlock dl_block;
 	var octetstring data := f_rnd_octstring(10);
 	var uint32_t sched_fn;
@@ -454,9 +455,17 @@
 
 	/* Make sure we don't receive data for that TBF since it was released
 	 * before. Also check our TBF is not polled for UL. */
-	f_rx_rlcmac_dl_block_exp_dummy(dl_block);
-	if (dl_block.ctrl.mac_hdr.usf != USF_UNUSED) {
-		setverdict(fail, "Unexpected USF ", dl_block.ctrl.mac_hdr.usf);
+	f_pcuif_rx_data_req_pdtch(data_msg);
+	if (data_msg.dl_block == omit) {
+		/* IDLE block, expected on new PCU versions */
+	} else if (match(data_msg.dl_block, tr_RLCMAC_DUMMY_CTRL())) {
+		/* Dummy RLCMAC block, expected on older PCU versions */
+		if (data_msg.dl_block.ctrl.mac_hdr.usf != USF_UNUSED) {
+			setverdict(fail, "Unexpected USF ", data_msg.dl_block.ctrl.mac_hdr.usf);
+			f_shutdown(__BFILE__, __LINE__);
+		}
+	} else {
+		setverdict(fail, "Unexpected dl_block", data_msg.dl_block);
 		f_shutdown(__BFILE__, __LINE__);
 	}
 
@@ -583,7 +592,7 @@
 	f_shutdown(__BFILE__, __LINE__, final := true);
 }
 
-/* Verify that the PCU generates valid PTCCH/D messages
+/* Verify that the PCU generates empty blocks in PTCCH/D
  * while neither Uplink nor Downlink TBF is established. */
 testcase TC_ta_ptcch_idle() runs on RAW_PCU_Test_CT {
 	var BTS_PTCCH_Block pcu_msg;
@@ -599,9 +608,15 @@
 
 	T.start(5.0);
 	alt {
-	/* Make sure the message is encoded correctly
-	 * TODO: do we expect all TA values to be equal '1111111'B? */
-	[] as_rx_ptcch(pcu_msg, tr_PTCCHDownlinkMsg);
+	[] BTS.receive(tr_PCUIF_DATA_PTCCH(0,
+					   tr_PCUIF_DATA(0, 7, sapi := PCU_IF_SAPI_PTCCH),
+					   omit)) {
+		setverdict(pass);
+	}
+	[] as_rx_ptcch(pcu_msg, tr_PTCCHDownlinkMsg) {
+		       setverdict(fail, "Expected IDLE block instead of PTCCH/D block");
+		       f_shutdown(__BFILE__, __LINE__);
+	}
 
 	[] BTS.receive(PCUIF_Message:?) { repeat; }
 	[] T.timeout {
@@ -1947,7 +1962,7 @@
 		repeat;
 	}
 	/* At this point in time (N3105_MAX reached), PCU already moved TBF to
-	 * RELEASE state so no data for it is tx'ed, hence the dummy blocks:
+	 * RELEASE state so no data for it is tx'ed, hence the dummy/idle blocks:
 	 */
 	[N3105 == N3105_MAX] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr,
 					   tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH),
@@ -1964,13 +1979,25 @@
 					  block_nr := nr.blk_nr));
 		repeat;
 	}
+	[N3105 == N3105_MAX] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr,
+					   tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH),
+					   omit)) -> value data_msg {
+		/* We may already receive idle blocks before our own TTCN3 timer
+		 * triggers due to the TBF being released. Keep going until our T_3195 triggers. */
+		nr := ts_TsTrxBtsNum;
+		BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
+					  sapi := PCU_IF_SAPI_PDTCH, fn := 0,
+					  arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)),
+					  block_nr := nr.blk_nr));
+		repeat;
+	}
 	[T_3195.running] T_3195.timeout {
 		log("T_3195 timeout");
 		/* Done in alt, wait for pending RTS initiated previously in
 		 * above case before continuing (expect /* Dummy block): */
 		BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr,
 						tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH),
-						tr_RLCMAC_DUMMY_CTRL));
+						omit));
 		}
 	[] BTS.receive {
 		setverdict(fail, "Unexpected BTS message");
@@ -5968,12 +5995,13 @@
 	f_shutdown(__BFILE__, __LINE__, final := true);
 }
 
-/* Verify TRX!=C0 don't schedule rlcmac blocks if no TBF attached to it. See OS#4772, SYS#4919 */
+/* Verify PCU schedule idle blocks (len=0) if no TBF attached to it. See OS#4772, SYS#4919 */
 testcase TC_pdch_energy_saving() runs on RAW_PCU_Test_CT {
 	var PCUIF_info_ind info_ind;
 	var template (value) TsTrxBtsNum nr;
 	var RlcmacDlBlock dl_block;
 	var BTS_PDTCH_Block data_msg;
+	var integer ts;
 	timer T;
 
 	/* Initialize NS/BSSGP side */
@@ -5991,25 +6019,30 @@
 	/* Establish BSSGP connection to the PCU */
 	f_bssgp_establish();
 
-	/* Verify C0 gets always dummy blocks: */
-	nr := ts_TsTrxBtsNum(ts_nr := 7, trx_nr := 0, bts_nr := 0, blk_nr := 0);
-	f_rx_rlcmac_dl_block_exp_dummy(dl_block, nr := nr);
+	for (ts := 0; ts < 2; ts := ts + 1) {
+		nr := ts_TsTrxBtsNum(ts_nr := 7, trx_nr := ts, bts_nr := 0, blk_nr := 0);
 
-	/* TRX1 doesn't send dummy blocks when not needed, in order to honour energy saving: */
-	nr.trx_nr := 1;
-	BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
-				  sapi := PCU_IF_SAPI_PDTCH, fn := 0,
-				  arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), block_nr := nr.blk_nr));
-	T.start(0.5);
-	alt {
-	[] as_rx_fail_dummy(nr);
-	[] BTS.receive {
-		setverdict(fail, "Unexpected block from BTS");
-		f_shutdown(__BFILE__, __LINE__);
-	}
-	[] T.timeout {
-		setverdict(pass);
-	}
+		BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
+					  sapi := PCU_IF_SAPI_PDTCH, fn := 0,
+					  arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), block_nr := nr.blk_nr));
+		T.start(0.5);
+		alt {
+		[] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr,
+						   tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH),
+						   omit)) -> value data_msg {
+			setverdict(pass);
+			T.stop;
+		}
+		[] as_rx_fail_dummy(nr);
+		[] BTS.receive {
+			setverdict(fail, "Unexpected block from BTS");
+			f_shutdown(__BFILE__, __LINE__);
+		}
+		[] T.timeout {
+			setverdict(fail, "Expected IDLE block from BTS");
+			f_shutdown(__BFILE__, __LINE__);
+		}
+		}
 	}
 
 	f_shutdown(__BFILE__, __LINE__, final := true);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25537
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: I6e96a7569640695ccfaa94b471384fa301bccd62
Gerrit-Change-Number: 25537
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/20210922/6c696073/attachment.htm>


More information about the gerrit-log mailing list