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

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
Fri Oct 4 17:42:07 UTC 2019


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


Change subject: pcu: Introduce test TC_t3169
......................................................................

pcu: Introduce test TC_t3169

Change-Id: I587413a7de7956daee3423057530e4052a55ba88
---
M library/RLCMAC_Types.ttcn
M pcu/PCU_Tests_RAW.ttcn
2 files changed, 87 insertions(+), 0 deletions(-)



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

diff --git a/library/RLCMAC_Types.ttcn b/library/RLCMAC_Types.ttcn
index ad9d8f4..9bf1f6a 100644
--- a/library/RLCMAC_Types.ttcn
+++ b/library/RLCMAC_Types.ttcn
@@ -306,6 +306,28 @@
 		usf := usf
 	}
 
+	template RlcmacDlBlock tr_RLCMAC_DUMMY_CTRL := {
+		ctrl := {
+			mac_hdr := {
+				payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),
+				rrbp:= ?,
+				rrbp_valid := ?,
+				usf := ?
+			},
+			opt := *,
+			payload := {
+				msg_type := PACKET_DL_DUMMY_CTRL,
+				u := {
+					dl_dummy := {
+						page_mode := ?,
+						persistence_levels_present := ?,
+						persistence_levels := *
+					}
+				}
+			}
+		}
+	}
+
 	/* Receive Template for Downlink ACK/NACK */
 	template RlcmacDlBlock tr_RLCMAC_ACK_NACK(template uint5_t ul_tfi, template GprsTlli tlli := ?) := {
 		ctrl := {
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index e17a369..5c6b969 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -614,6 +614,26 @@
 	f_tx_pcuif_data_ind(data, lqual_cb);
 }
 
+private function f_tx_pcuif_rlcmac_ul_n_blocks(PacketUlAssign ul_tbf_ass, integer num_blocks := 1)
+runs on RAW_PCU_Test_CT {
+	var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
+		tfi := ul_tbf_ass.dynamic.tfi_assignment,
+		cv := num_blocks - 1, /* num 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 (0 .. 32 dB, step = 2 dB) */
+	for (var integer i := 0; i < num_blocks; i := i + 1) {
+		/* Prepare a new UL block (CV, random payload) */
+		ul_data.data.mac_hdr.countdown := (num_blocks - i);
+		ul_data.data.blocks := { valueof(t_RLCMAC_LLCBLOCK(f_rnd_octstring(10))) };
+		f_tx_pcuif_rlcmac_ul_block(ul_data);
+	}
+}
+
 /* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */
 private function f_rx_pcuif_rlcmac_dl_block(out RlcmacDlBlock dl_block)
 runs on RAW_PCU_Test_CT {
@@ -635,6 +655,15 @@
 	}
 }
 
+private function f_rx_pcuif_rlcmac_dl_block_exp_dummy(out RlcmacDlBlock dl_block)
+runs on RAW_PCU_Test_CT {
+	f_rx_pcuif_rlcmac_dl_block(dl_block);
+	if (not match(dl_block, tr_RLCMAC_DUMMY_CTRL)) {
+		setverdict(fail, "Failed to match Packet DUMMY DL");
+		mtc.stop;
+	}
+}
+
 testcase TC_pcuif_suspend() runs on RAW_PCU_Test_CT {
 	var octetstring ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.cell_id.ra_id);
 	var GprsTlli tlli := 'FFFFFFFF'O;
@@ -947,6 +976,41 @@
 	}
 }
 
+/* Verify PCU drops TBF after some time of inactivity. */
+testcase TC_t3169() runs on RAW_PCU_Test_CT {
+	var PCUIF_info_ind info_ind;
+	var PacketUlAssign ul_tbf_ass;
+	var RlcmacDlBlock dl_block;
+	var PCUIF_Message pcu_msg;
+	var octetstring data;
+	var boolean ok;
+
+	info_ind := f_default_pcuif_info_ind();
+	/* Set timer to 1 sec (default 5) to speedup test: */
+	info_ind.t3169 := 1;
+
+	/* Initialize the PCU interface abstraction */
+	f_init_raw(testcasename(), info_ind);
+
+	/* Establish an Uplink TBF */
+	ok := f_establish_tbf_ul(ul_tbf_ass);
+	if (not ok) {
+		setverdict(fail, "Failed to establish an Uplink TBF");
+		mtc.stop;
+	}
+
+	/* Send one UL block and make sure it is ACKED fine */
+	f_tx_pcuif_rlcmac_ul_n_blocks(ul_tbf_ass, 1);
+	f_rx_pcuif_rlcmac_dl_block_exp_ack_nack(dl_block);
+
+	/* Wait until T3169 fires (plus 1 extra sec to make sure) */
+	f_sleep(int2float(info_ind.t3169) + 1.0);
+
+	/* Send an UL block once again, the TBF should be gone by now so no ACK */
+	f_tx_pcuif_rlcmac_ul_n_blocks(ul_tbf_ass, 1);
+	f_rx_pcuif_rlcmac_dl_block_exp_dummy(dl_block);
+}
+
 
 control {
 	execute( TC_ns_reset() );
@@ -963,6 +1027,7 @@
 	execute( TC_ta_rach_imm_ass() );
 	execute( TC_ta_ptcch_ul_multi_tbf() );
 	execute( TC_cs_lqual_ul_tbf() );
+	execute( TC_t3169() );
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15676
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: I587413a7de7956daee3423057530e4052a55ba88
Gerrit-Change-Number: 15676
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/20191004/2bf75665/attachment.htm>


More information about the gerrit-log mailing list