aboutsummaryrefslogtreecommitdiffstats
path: root/fr
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-11-11 19:01:46 +0100
committerlaforge <laforge@osmocom.org>2020-11-12 20:02:07 +0000
commitde6f3ee592637fd8a5822b460c2378a735d1f359 (patch)
tree524da594ad6a2e263c63bd3bb899a5232c08ea90 /fr
parentc450552c597b4f570ad4f3aadeccd0bc140b8b13 (diff)
FR/FRNET: Dynamically create number of BVC at runtime
We don't want the number of NSE and the number of BVC to be a compile-time choice, but rather something dynamic at rutime. This allows configuration files to define those details. Change-Id: I55b44481b5322deaf78619c1689462d716ddfcec
Diffstat (limited to 'fr')
-rw-r--r--fr/FR_Tests.ttcn59
1 files changed, 35 insertions, 24 deletions
diff --git a/fr/FR_Tests.ttcn b/fr/FR_Tests.ttcn
index d2d184f4..b220bb96 100644
--- a/fr/FR_Tests.ttcn
+++ b/fr/FR_Tests.ttcn
@@ -8,6 +8,7 @@ import from NS_Emulation all;
import from BSSGP_Emulation all;
modulepar {
+ integer mp_num_bvc := 10;
NSConfigurations mp_nsconfig := {
{
nsei := 123,
@@ -34,10 +35,9 @@ type record GbInstance {
BssgpConfig cfg
};
-const integer NUM_GB := 1;
-type record length(NUM_GB) of GbInstance GbInstances;
-type record length(NUM_GB) of NSConfiguration NSConfigurations;
-type record length(NUM_GB) of BssgpCellId BssgpCellIds;
+type record of GbInstance GbInstances;
+type record of NSConfiguration NSConfigurations;
+type record of BssgpCellId BssgpCellIds;
type component test_CT {
@@ -53,28 +53,39 @@ private function f_init_gb(inout GbInstance gb, charstring id, integer offset) r
gb.vc_BSSGP.start(BssgpStart(gb.cfg, testcasename()));
}
-testcase TC_foo() runs on test_CT {
- g_gb[0].cfg := {
- nsei := 123,
- sgsn_role := false,
- bvc := {
- {
- bvci := 1123,
- cell_id := {
- ra_id := {
- lai := {
- mcc_mnc := '262F42'H,
- lac := 11123
- },
- rac := 1
- },
- cell_id := 31123
+function f_gen_bvc(integer base, integer idx) return BssgpBvcConfig {
+ var BssgpBvcConfig bvc := {
+ bvci := base + 100 + idx,
+ cell_id := {
+ ra_id := {
+ lai := {
+ mcc_mnc := '262F42'H,
+ lac := base + 300 + idx
},
- depth := BSSGP_DECODE_DEPTH_LLC
- }
- }
+ rac := 1
+ },
+ cell_id := base + 600 + idx
+ },
+ depth := BSSGP_DECODE_DEPTH_LLC
};
- f_init_gb(g_gb[0], "gb", 0);
+ return bvc;
+}
+
+
+testcase TC_foo() runs on test_CT {
+
+ for (var integer i := 0; i < lengthof(mp_nsconfig); i := i+1) {
+ g_gb[i].cfg := {
+ nsei := mp_nsconfig[i].nsei,
+ sgsn_role := false,
+ bvc := { }
+ };
+ /* create 'mp_num_bvc' number of BVCs */
+ for (var integer j := 0; j < mp_num_bvc; j := j+1) {
+ g_gb[i].cfg.bvc := g_gb[i].cfg.bvc & { f_gen_bvc(i * 1000, j) };
+ }
+ f_init_gb(g_gb[i], "gb", i);
+ }
while (true) {
f_sleep(100.0);
}