[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add new TC_attach_rau: Attach followed by RA Update

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Feb 18 09:54:30 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: sgsn: Add new TC_attach_rau: Attach followed by RA Update
......................................................................


sgsn: Add new TC_attach_rau: Attach followed by RA Update

Change-Id: I8f71bf83f4e6504f1cfbdc55a57e3ed62b3e5f25
---
M library/L3_Templates.ttcn
M sgsn/SGSN_Tests.ttcn
2 files changed, 90 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index b37ee25..5b6b481 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -1514,6 +1514,45 @@
 	}
 }
 
+template PDU_L3_SGSN_MS tr_GMM_RAU_ACCEPT(template BIT3 res := ?,
+					  template RoutingAreaIdentificationV ra := ?,
+					  template OCT4 ptmsi := *) := {
+	discriminator := '1000'B,
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		gprs_mm := {
+			routingAreaUpdateAccept := {
+				messageType := '00001001'B,
+				forceToStandby := ?,
+				updateResult := { res, ? },
+				raUpdateTimer := ?,
+				routingAreaId := ra,
+				ptmsiSignature := *,
+				allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi),
+				msIdentity := *,
+				receiveNPDUNumbers := *,
+				readyTimer := *,
+				gmmCause := *,
+				t3302 := *,
+				cellNotification := *,
+				equivalentPLMNs := *,
+				pdpContextStatus := *,
+				networkFeatureSupport := *,
+				emergencyNumberList := *,
+				mBMS_ContextStatus := *,
+				requestedMSInformation := *,
+				t3319 := *,
+				t3323 := *,
+				t3312_ExtendedValue := *,
+				additionalNetworkFeatureSupport := *,
+				t3324 := *,
+				extendedDRXParameters := *
+			}
+		}
+	}
+}
 
 template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := {
 	discriminator := '0000'B, /* overwritten */
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index a59bde3..9e00a13 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -311,6 +311,30 @@
 	/* T3302, T3319, T3323, T3312_ext, T3324 */
 }
 
+function f_process_rau_accept(PDU_GMM_RoutingAreaUpdateAccept ra) runs on BSSGP_ConnHdlr {
+	/* mandatory IE */
+	g_pars.ra := ra.routingAreaId;
+	if (ispresent(ra.allocatedPTMSI)) {
+		if (not g_pars.net.expect_ptmsi) {
+			setverdict(fail, "unexpected P-TMSI allocation");
+			self.stop;
+		}
+		f_upd_ptmsi_and_tlli(ra.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets);
+	}
+	if (ispresent(ra.msIdentity)) {
+		setverdict(fail, "unexpected TMSI allocation in non-combined attach");
+		self.stop;
+	}
+	/* P-TMSI.sig */
+	if (ispresent(ra.ptmsiSignature)) {
+		g_pars.p_tmsi_sig := ra.ptmsiSignature.valueField;
+	}
+	/* updateTimer */
+	// aa.readyTimer
+	/* T3302, T3319, T3323, T3312_ext, T3324 */
+}
+
+
 function f_random_RAI(HEX0_3n mcc := '262'H, HEX0_3n mnc := '42'H) return RoutingAreaIdentificationV {
 	return f_RAI(mcc, mnc, f_rnd_octstring(2), f_rnd_octstring(1));
 }
@@ -584,6 +608,32 @@
 	vc_conn.done;
 }
 
+private function f_TC_attach_rau(charstring id) runs on BSSGP_ConnHdlr {
+	var BssgpDecoded bd;
+
+	/* first perform regular attach */
+	f_TC_attach(id);
+
+	/* then send RAU */
+	BSSGP.send(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, g_pars.ra, false, omit, omit));
+	alt {
+	[] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_ACCEPT)) -> value bd {
+		f_process_rau_accept(bd.l3_mt.msgs.gprs_mm.routingAreaUpdateAccept);
+		setverdict(pass);
+		}
+	[] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT)) {
+		setverdict(fail, "Unexpected RAU Reject");
+		}
+	[] BSSGP.receive { repeat; }
+	}
+}
+testcase TC_attach_rau() runs on test_CT {
+	var BSSGP_ConnHdlr vc_conn;
+	f_init();
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_TC_attach_rau), testcasename(), g_gb[0], 12);
+	vc_conn.done;
+}
 
 
 
@@ -598,6 +648,7 @@
 	execute( TC_attach_accept_all() );
 	execute( TC_attach_closed() );
 	execute( TC_rau_unknown() );
+	execute( TC_attach_rau() );
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/6562
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f71bf83f4e6504f1cfbdc55a57e3ed62b3e5f25
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list