Change in osmo-ttcn3-hacks[master]: break GTP_Templates dependency on Osmo_Gb_Types, BSSGP_Types, NS_Types

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
Thu Dec 9 15:25:50 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26441 )

Change subject: break GTP_Templates dependency on Osmo_Gb_Types, BSSGP_Types, NS_Types
......................................................................

break GTP_Templates dependency on Osmo_Gb_Types, BSSGP_Types, NS_Types

The resulting set of dependencies needed just to have one simple CellId
struct is huge. That was fine for sgsn testsuite since anyway those were
being used, but it's not acceptable for other testsuites (hnodeb) which
only really require the GTP side.

After this change, GTP_Templates only requires GSM_Types, which ends up
in a much smaller subset of dependencies being pulled in.

Change-Id: Icd8234908af445b798517fe110cd0648969179a4
---
M library/GTP_Templates.ttcn
M sgsn/SGSN_Tests.ttcn
2 files changed, 36 insertions(+), 19 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn
index 1bd56e1..9c8d1b6 100644
--- a/library/GTP_Templates.ttcn
+++ b/library/GTP_Templates.ttcn
@@ -17,7 +17,17 @@
 	import from GTPU_Types all;
 	import from GTP_CodecPort all;
 	import from IPCP_Types all;
-	import from Osmocom_Gb_Types all; // BssgpCellId
+	import from GSM_Types all; // RoutingAreaIdentification, CellIdentity
+
+	type record GTP_CellId {
+		RoutingAreaIdentification	ra_id,
+		CellIdentity			cell_id
+	} with { encode "RAW" };
+
+	template (value) GTP_CellId ts_GTP_CellId(template (value) RoutingAreaIdentification rai, CellIdentity cell_id) := {
+		ra_id := rai,
+		cell_id := cell_id
+	};
 
 	/* Table 38 of 3GPP TS 29.060 */
 	type enumerated GTP_Cause {
@@ -673,7 +683,7 @@
 		 },
 		 rIMProtocolVersionNumber := int2oct(ver, 1)
 	}
-	function tr_GTPC_Cell_Identifier_V(template BssgpCellId cid) return template Cell_Identifier_V_GTPC {
+	function tr_GTPC_Cell_Identifier_V(template GTP_CellId cid) return template Cell_Identifier_V_GTPC {
 		var template Cell_Identifier_V_GTPC ret := {
 			mccDigit1 := ?,
 			mccDigit2 := ?,
@@ -713,7 +723,7 @@
 		}
 		return ret;
 	}
-	template (value) Cell_Identifier_V_GTPC ts_GTPC_Cell_Identifier_V(BssgpCellId cid) := {
+	template (value) Cell_Identifier_V_GTPC ts_GTPC_Cell_Identifier_V(GTP_CellId cid) := {
 		mccDigit1 := cid.ra_id.lai.mcc_mnc[0],
 		mccDigit2 := cid.ra_id.lai.mcc_mnc[1],
 		mccDigit3 := cid.ra_id.lai.mcc_mnc[2],
@@ -724,10 +734,10 @@
 		rac := int2oct(cid.ra_id.rac, 1),
 		cI_value := int2oct(cid.cell_id, 2)
 	}
-	template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(BssgpCellId cid) := {
+	template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(GTP_CellId cid) := {
 		 cell_Identifier := ts_GTPC_Cell_Identifier_V(cid)
 	}
-	function tr_GTPC_ENB_Identifier(template BssgpCellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier {
+	function tr_GTPC_ENB_Identifier(template GTP_CellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier {
 		var template ENB_Identifier ret := {
 			mccDigit1 := ?,
 			mccDigit2 := ?,
@@ -764,7 +774,7 @@
 
 		return ret;
 	}
-	template (value) ENB_Identifier ts_GTPC_ENB_Identifier(BssgpCellId cid, integer tac, octetstring gnbid) := {
+	template (value) ENB_Identifier ts_GTPC_ENB_Identifier(GTP_CellId cid, integer tac, octetstring gnbid) := {
 		mccDigit1 := cid.ra_id.lai.mcc_mnc[0],
 		mccDigit2 := cid.ra_id.lai.mcc_mnc[1],
 		mccDigit3 := cid.ra_id.lai.mcc_mnc[2],
@@ -774,7 +784,7 @@
 		tAC := int2oct(tac, 2),
 		globalENB_ID := gnbid
 	}
-	template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(BssgpCellId cid, integer tac, octetstring gnbid) := {
+	template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(GTP_CellId cid, integer tac, octetstring gnbid) := {
 		 eNB_Identifier := ts_GTPC_ENB_Identifier(cid, tac, gnbid)
 	}
 	template RIM_Routing_Information_GTPC
@@ -801,7 +811,7 @@
 	}
 	/* 3GPP TS 48.018 11.3.63.1.1 */
 	template RAN_Information_Request_Application_Container_NACC_GTPC
-	tr_GTPC_RAN_Information_Request_Application_Container_NACC(template BssgpCellId cid) := {
+	tr_GTPC_RAN_Information_Request_Application_Container_NACC(template GTP_CellId cid) := {
 		iEI := '4D'O,
 		ext := '1'B,
 		lengthIndicator := {
@@ -810,7 +820,7 @@
 		reporting_Cell_Identifier := tr_GTPC_Cell_Identifier_V(cid)
 	}
 	template (value) RAN_Information_Request_Application_Container_NACC_GTPC
-	ts_GTPC_RAN_Information_Request_Application_Container_NACC(BssgpCellId cid) := {
+	ts_GTPC_RAN_Information_Request_Application_Container_NACC(GTP_CellId cid) := {
 		iEI := '4D'O,
 		ext := '1'B,
 		lengthIndicator := {
@@ -820,16 +830,16 @@
 	}
 	/* 3GPP TS 48.018 11.3.63.1 */
 	template RAN_Information_Request_Application_Container_GTPC
-	tru_GTPC_RAN_Information_Request_Application_Container_NACC(template BssgpCellId cid) := {
+	tru_GTPC_RAN_Information_Request_Application_Container_NACC(template GTP_CellId cid) := {
 		nacc := tr_GTPC_RAN_Information_Request_Application_Container_NACC(cid)
 	}
 	template (value) RAN_Information_Request_Application_Container_GTPC
-	tsu_GTPC_RAN_Information_Request_Application_Container_NACC(BssgpCellId cid) := {
+	tsu_GTPC_RAN_Information_Request_Application_Container_NACC(GTP_CellId cid) := {
 		nacc := ts_GTPC_RAN_Information_Request_Application_Container_NACC(cid)
 	}
 	/* 3GPP TS 48.018 11.3.63.2.1 */
 	template RAN_Information_Application_Container_NACC_GTPC
-	tr_GTPC_RAN_Information_Application_Container_NACC(template BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
+	tr_GTPC_RAN_Information_Application_Container_NACC(template GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
 		 iEI := '4E'O,
 		 ext := '1'B,
 		 lengthIndicator := {
@@ -841,7 +851,7 @@
 		 sI_PSI := si_psi
 	}
 	template (value) RAN_Information_Application_Container_NACC_GTPC
-	ts_GTPC_RAN_Information_Application_Container_NACC(BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
+	ts_GTPC_RAN_Information_Application_Container_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
 		 iEI := '4E'O,
 		 ext := '1'B,
 		 lengthIndicator := {
@@ -892,11 +902,11 @@
 
 	/* RAN_Information */
 	template ApplContainer_or_ApplErrContainer_NACC_GTPC
-	tru_GTPC_ApplContainer_NACC(BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
+	tru_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
 		application_Container := tr_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi)
 	}
 	template (value) ApplContainer_or_ApplErrContainer_NACC_GTPC
-	tsu_GTPC_ApplContainer_NACC(BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
+	tsu_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := {
 		application_Container := ts_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi)
 	}
 	template ApplContainer_or_ApplErrContainer_GTPC
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 2461962..3386f71 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -250,6 +250,12 @@
         return ret;
 };
 
+private function f_BssgpCellId_to_GTP_CellId(in BssgpCellId cell_id) return GTP_CellId
+{
+	template (value) GTP_CellId ret := ts_GTP_CellId(cell_id.ra_id, cell_id.cell_id);
+	return valueof(ret);
+}
+
 private function f_init_gb(inout GbInstance gb, charstring id, integer offset) runs on test_CT {
 	gb.vc_NS := NS_CT.create(id & "-NS" & int2str(offset));
 	gb.vc_BSSGP := BSSGP_CT.create(id & "-BSSGP" & int2str(offset));
@@ -3373,20 +3379,21 @@
 		remName := mp_sgsn_gtp_ip,
 		remPort := GTP1C_PORT
 	}
+	var GTP_CellId gtp_ci := f_BssgpCellId_to_GTP_CellId(g_gb[1].cfg.bvc[0].cell_id);
 
 	var template (value) RIM_Routing_Address_GTPC gtpc_dst_addr, gtpc_src_addr;
 	var template (value) RAN_Information_Request_RIM_Container_GTPC gtpc_rim_req_cont;
 	var template (value) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC gtpc_bssgp_cont;
 	var template (value) Gtp1cUnitdata gtpc_pdu;
 
-	gtpc_dst_addr := t_GTPC_RIM_Routing_Address_cid(g_gb[1].cfg.bvc[0].cell_id);
-	gtpc_src_addr := t_GTPC_RIM_Routing_Address_enbid(g_gb[1].cfg.bvc[0].cell_id, tac := 3, gnbid := '12345678123456'O);
+	gtpc_dst_addr := t_GTPC_RIM_Routing_Address_cid(gtp_ci);
+	gtpc_src_addr := t_GTPC_RIM_Routing_Address_enbid(gtp_ci, tac := 3, gnbid := '12345678123456'O);
 
 	gtpc_rim_req_cont := ts_GTPC_RAN_Information_Request_RIM_Container(ts_GTPC_RIM_Application_Identity(RIM_APP_ID_NACC),
 									ts_GTPC_RIM_Sequence_Number(1),
 									ts_GTPC_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP),
 									ts_GTPC_RIM_Protocol_Version_Number(1),
-									tsu_GTPC_RAN_Information_Request_Application_Container_NACC(g_gb[1].cfg.bvc[0].cell_id),
+									tsu_GTPC_RAN_Information_Request_Application_Container_NACC(gtp_ci),
 									omit);
 	gtpc_bssgp_cont := ts_GTPC_RAN_Information_Request(ts_GTPC_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, gtpc_dst_addr),
 							   ts_GTPC_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, gtpc_src_addr),
@@ -3439,7 +3446,7 @@
 							  ts_GTPC_RIM_Sequence_Number(2),
 							  ts_GTPC_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP),
 							  ts_GTPC_RIM_Protocol_Version_Number(1),
-							  tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(tru_GTPC_ApplContainer_NACC(g_gb[1].cfg.bvc[0].cell_id, false, 3, si_default)),
+							  tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(tru_GTPC_ApplContainer_NACC(gtp_ci, false, 3, si_default)),
 							  omit);
 	gtpc_bssgp_cont_ack := tr_GTPC_RAN_Information(tr_GTPC_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, gtpc_src_addr),
 						       tr_GTPC_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, gtpc_dst_addr),

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26441
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: Icd8234908af445b798517fe110cd0648969179a4
Gerrit-Change-Number: 26441
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211209/23726337/attachment.htm>


More information about the gerrit-log mailing list