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

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 30 16:10:59 UTC 2019


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


Change subject: pcu: Introduce test TC_rach_egprs_only
......................................................................

pcu: Introduce test TC_rach_egprs_only

Change-Id: I96e0d28bed749ef657f0b68d0beee3f8471ab3e0
---
M library/GSM_RR_Types.ttcn
M pcu/PCU_Tests_RAW.ttcn
2 files changed, 74 insertions(+), 4 deletions(-)



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

diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn
index f5eeda5..4c2874a 100644
--- a/library/GSM_RR_Types.ttcn
+++ b/library/GSM_RR_Types.ttcn
@@ -911,6 +911,26 @@
 		}
 	};
 
+	template GsmRrMessage tr_IMM_ASS_REJ(template uint8_t ra := ?, template GsmFrameNumber fn := ?) := {
+		header := t_RrHeader(IMMEDIATE_ASSIGNMENT_REJECT, ?),
+		payload := {
+			imm_ass_rej := {
+				feature_ind :=  {
+						spare := '00'B,
+						cs_ir := false,
+						ps_ir := true
+						},
+				page_mode := PAGE_MODE_NORMAL,
+				payload := {
+						{req_ref := tr_compute_ReqRef(ra, fn), wait_ind := ?},
+						?,
+						?,
+						?
+					}
+			}
+		}
+	};
+
 	template GsmRrMessage tr_PAG_REQ1(template MobileIdentityLV mi1 := ?) := {
 		header := t_RrHeader(PAGING_REQUEST_TYPE_1, ?),
 		payload := {
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index d19093c..d2c4e2a 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -170,13 +170,19 @@
 	f_vty_config2(PCUVTY, {"pcu"}, cmd);
 }
 
-private function f_init_vty(charstring id) runs on RAW_PCU_Test_CT {
+private function f_init_vty(charstring id, boolean egprs_only := false) runs on RAW_PCU_Test_CT {
 	map(self:PCUVTY, system:PCUVTY);
 	f_vty_set_prompts(PCUVTY);
 	f_vty_transceive(PCUVTY, "enable");
+
+	if (egprs_only) {
+		f_vty_config2(PCUVTY, {"pcu"}, "egprs only");
+	} else {
+		f_vty_config2(PCUVTY, {"pcu"}, "no egprs");
+	}
 }
 
-private function f_init_raw(charstring id, template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default)
+private function f_init_raw(charstring id, boolean egprs_only := false, template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default)
 runs on RAW_PCU_Test_CT {
 	var RAW_PCUIF_CT vc_PCUIF;
 	var RAW_PCU_BTS_CT vc_BTS;
@@ -195,7 +201,7 @@
 	connect(vc_BTS:PCUIF, vc_PCUIF:BTS);
 	connect(vc_BTS:TC, self:BTS);
 
-	f_init_vty(id);
+	f_init_vty(id, egprs_only);
 
 	vc_PCUIF.start(f_PCUIF_CT_handler(mp_pcu_sock_path));
 	vc_BTS.start(f_BTS_CT_handler(0, valueof(info_ind)));
@@ -1041,7 +1047,7 @@
 	info_ind.t3169 := 1;
 
 	/* Initialize the PCU interface abstraction */
-	f_init_raw(testcasename(), info_ind);
+	f_init_raw(testcasename(), false, info_ind);
 
 	/* Establish BSSGP connection to the PCU */
 	f_bssgp_establish();
@@ -1400,6 +1406,48 @@
 	f_tc_paging_ps_from_sgsn(mp_gb_cfg.bvci);
 }
 
+/* Reproduce osmo-pcu rejects 8-bit RACH req when in "egprs only" mode. */
+testcase TC_rach_egprs_only() runs on RAW_PCU_Test_CT {
+	var PCUIF_Message pcu_msg;
+	var GsmRrMessage rr_imm_ass_rej;
+	var uint32_t fn;
+	var uint16_t ra := oct2int('3A'O);
+	timer T;
+
+	/* Initialize the PCU interface abstraction with EGPRS-only */
+	f_init_raw(testcasename(), egprs_only := true);
+
+	/* FIXME: ask the BTS component to give us the current TDMA fn */
+	fn := 1337;
+
+	/* Send RACH.ind (8 bit) */
+	BTS.send(ts_PCUIF_RACH_IND(bts_nr := 0, trx_nr := 0, ts_nr := 0,
+				   ra := ra, is_11bit := 0,
+				   burst_type := BURST_TYPE_0,
+				   fn := fn, arfcn := 871,
+				   qta := 0));
+
+	/* Expect Immediate (TBF) Assignment Reject on TS0/AGCH */
+	T.start(2.0);
+	alt {
+	[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 0,
+					 sapi := PCU_IF_SAPI_AGCH, data := ?))
+					-> value pcu_msg {
+		rr_imm_ass_rej := dec_GsmRrMessage(pcu_msg.u.data_req.data);
+		log("Rx Immediate Assignment Reject: ", rr_imm_ass_rej);
+
+		if (match(rr_imm_ass_rej, tr_IMM_ASS_REJ(ra, fn))) {
+			setverdict(pass);
+		} else {
+			setverdict(fail, "IMM ASS REJ didn't match");
+		}
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for Immediate Assignment Reject");
+		}
+	}
+}
+
 control {
 	execute( TC_pcuif_suspend() );
 	execute( TC_ta_ptcch_idle() );
@@ -1417,6 +1465,8 @@
 	execute (TC_paging_cs_from_sgsn_ptp() );
 	execute (TC_paging_ps_from_sgsn_sign() );
 	execute (TC_paging_ps_from_sgsn_ptp() );
+
+	execute( TC_rach_egprs_only() );
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16687
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: I96e0d28bed749ef657f0b68d0beee3f8471ab3e0
Gerrit-Change-Number: 16687
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/20191230/9e12bb27/attachment.htm>


More information about the gerrit-log mailing list