Change in osmo-ttcn3-hacks[master]: gbproxy: Set configuration in a more dynamic way

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

laforge gerrit-no-reply at lists.osmocom.org
Sun Nov 15 21:40:36 UTC 2020


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


Change subject: gbproxy: Set configuration in a more dynamic way
......................................................................

gbproxy: Set configuration in a more dynamic way

Let's generalize the data types a bit, and move the gb (bssgp) config
into a module parameter.  That parameter then is used for both the PCUs
as well as (concatenated) for the SGSN side.

This allows the configuration file to have more control over the number
of BVC within each NSE.

Change-Id: I43a3a8e133cf0f0e377b64d1b385e88285246957
---
M gbproxy/GBProxy_Tests.ttcn
1 file changed, 87 insertions(+), 109 deletions(-)



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

diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 8de16d2..ff11624 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -37,9 +37,12 @@
 
 import from GSM_RR_Types all;
 
+/* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */
+const BcdMccMnc c_mcc_mnc := '262F42'H;
+
 modulepar {
 	/* IP/port on which we run our internal GSUP/HLR emulation */
-	NSConfigurations_SGSN mp_nsconfig_sgsn := {
+	NSConfigurations mp_nsconfig_sgsn := {
 		{
 			nsei := 101,
 			role_sgsn := true,
@@ -60,7 +63,7 @@
 			}
 		}
 	};
-	NSConfigurations_PCU mp_nsconfig_pcu := {
+	NSConfigurations mp_nsconfig_pcu := {
 		{
 			nsei := 96,
 			role_sgsn := false,
@@ -119,6 +122,69 @@
 			}
 		}
 	};
+	BssgpConfigs mp_gbconfigs := {
+		{
+			nsei := 96,
+			sgsn_role := false,
+			bvc := {
+				{
+					bvci := 196,
+					cell_id := {
+						ra_id := {
+							lai := {
+								mcc_mnc := c_mcc_mnc,
+								lac := 13135
+							},
+							rac := 0
+						},
+						cell_id := 20960
+					},
+					depth := BSSGP_DECODE_DEPTH_BSSGP,
+					create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
+				}
+			}
+		}, {
+			nsei := 97,
+			sgsn_role := false,
+			bvc := {
+				{
+					bvci := 210,
+					cell_id := {
+						ra_id := {
+							lai := {
+								mcc_mnc := c_mcc_mnc,
+								lac := 13200
+							},
+							rac := 0
+						},
+						cell_id := 20961
+					},
+					depth := BSSGP_DECODE_DEPTH_BSSGP,
+					create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
+				}
+			}
+		}, {
+			nsei := 98,
+			sgsn_role := false,
+			bvc := {
+				{
+					bvci := 220,
+					cell_id := {
+						ra_id := {
+							lai := {
+								mcc_mnc := c_mcc_mnc,
+								lac := 13300
+							},
+							rac := 0
+						},
+						cell_id := 20962
+					},
+					depth := BSSGP_DECODE_DEPTH_BSSGP,
+					create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
+				}
+			}
+		}
+	}
 };
 
 const integer NUM_BVC_PER_NSE := 3;
@@ -130,17 +196,16 @@
 };
 
 const integer NUM_PCU := 3;
-type record length(NUM_PCU) of GbInstance GbInstances_PCU;
-type record length(NUM_PCU) of NSConfiguration NSConfigurations_PCU;
-type record length(NUM_PCU) of BssgpCellId BssgpCellIds;
+type record of GbInstance GbInstances;
+type record of BssgpConfig BssgpConfigs;
+type record of NSConfiguration NSConfigurations;
+type record of BssgpCellId BssgpCellIds;
 
 const integer NUM_SGSN := 1;
-type record length(NUM_SGSN) of GbInstance GbInstances_SGSN;
-type record length(NUM_SGSN) of NSConfiguration NSConfigurations_SGSN;
 
 type component test_CT {
-	var GbInstances_PCU g_pcu;
-	var GbInstances_SGSN g_sgsn;
+	var GbInstances g_pcu;
+	var GbInstances g_sgsn;
 
 	port BSSGP_CT_PROC_PT PROC;
 
@@ -243,118 +308,31 @@
 	f_vty_transceive(GBPVTY, "enable");
 }
 
-/* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */
-function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT {
+function f_init() runs on test_CT {
 	var integer i;
 
 	if (g_initialized == true) {
 		return;
 	}
 	g_initialized := true;
-	g_pcu[0].cfg := {
-		nsei := 96,
-		sgsn_role := false,
-		bvc := { {
-			bvci := 196,
-			cell_id := {
-				ra_id := {
-					lai := {
-						mcc_mnc := mcc_mnc, lac := 13135},
-						rac := 0
-					},
-				cell_id := 20960
-			},
-			depth := BSSGP_DECODE_DEPTH_BSSGP,
-			create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
-		} }
-	};
-	g_pcu[1].cfg := {
-		nsei := 97,
-		sgsn_role := false,
-		bvc := { {
-			bvci := 210,
-			cell_id := {
-				ra_id := {
-					lai := {
-						mcc_mnc := mcc_mnc, lac := 13200},
-						rac := 0
-					},
-				cell_id := 20961
-			},
-			depth := BSSGP_DECODE_DEPTH_BSSGP,
-			create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
-		} }
-	};
-	g_pcu[2].cfg := {
-		nsei := 98,
-		sgsn_role := false,
-		bvc := { {
-			bvci := 220,
-			cell_id := {
-				ra_id := {
-					lai := {
-						mcc_mnc := mcc_mnc, lac := 13300},
-						rac := 0
-					},
-				cell_id := 20962
-			},
-			depth := BSSGP_DECODE_DEPTH_BSSGP,
-			create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
-		} }
-	};
 
 	g_sgsn[0].cfg := {
-		nsei := 101,
+		nsei := mp_nsconfig_sgsn[0].nsei,
 		sgsn_role := true,
-		bvc := {
-			{
-				bvci := 196,
-				cell_id := {
-					ra_id := {
-						lai := {
-							mcc_mnc := mcc_mnc, lac := 13135},
-							rac := 0
-						},
-					cell_id := 20960
-				},
-				depth := BSSGP_DECODE_DEPTH_BSSGP,
-				create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
-			},
-			{
-				bvci := 210,
-				cell_id := {
-					ra_id := {
-						lai := {
-							mcc_mnc := mcc_mnc, lac := 13200},
-							rac := 0
-						},
-					cell_id := 20961
-				},
-				depth := BSSGP_DECODE_DEPTH_BSSGP,
-				create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
-			},
-			{
-				bvci := 220,
-				cell_id := {
-					ra_id := {
-						lai := {
-							mcc_mnc := mcc_mnc, lac := 13300},
-							rac := 0
-						},
-					cell_id := 20962
-				},
-				depth := BSSGP_DECODE_DEPTH_BSSGP,
-				create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
-			}
-		}
-	};
+		bvc := { }
+	}
+	for (i := 0; i < lengthof(mp_gbconfigs); i := i+1) {
+		g_pcu[i].cfg := mp_gbconfigs[i];
+		/* concatenate all the PCU-side BVCs for the SGSN side */
+		g_sgsn[0].cfg.bvc := g_sgsn[0].cfg.bvc & mp_gbconfigs[i].bvc;
+	}
 
 	f_init_vty();
 	f_init_gb_sgsn(g_sgsn[0], "GbProxy_Test-SGSN0", 0);
 	f_sleep(4.0);
-	f_init_gb_pcu(g_pcu[0], "GbProxy_Test-PCU0", 0);
-	f_init_gb_pcu(g_pcu[1], "GbProxy_Test-PCU1", 1);
-	f_init_gb_pcu(g_pcu[2], "GbProxy_Test-PCU2", 2);
+	for (i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) {
+		f_init_gb_pcu(g_pcu[i], "GbProxy_Test-PCU0", i);
+	}
 }
 
 function f_cleanup() runs on test_CT {
@@ -364,7 +342,7 @@
 type function void_fn(charstring id) runs on BSSGP_ConnHdlr;
 
 /* helper function to create, connect and start a BSSGP_ConnHdlr component */
-function f_start_handler(void_fn fn, charstring id, GbInstances_PCU pcu, GbInstances_SGSN sgsn, integer imsi_suffix,
+function f_start_handler(void_fn fn, charstring id, GbInstances pcu, GbInstances sgsn, integer imsi_suffix,
 			 float t_guard := 30.0)
 runs on test_CT return BSSGP_ConnHdlr {
 	var BSSGP_ConnHdlr vc_conn;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21167
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: I43a3a8e133cf0f0e377b64d1b385e88285246957
Gerrit-Change-Number: 21167
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201115/e9b09127/attachment.htm>


More information about the gerrit-log mailing list