Change in osmo-ttcn3-hacks[master]: FR/FRNET: Dynamically create number of BVC at runtime

2020-11-12 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21110 )

Change subject: FR/FRNET: Dynamically create number of BVC at runtime
..

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
---
M fr-net/FRNET_Tests.ttcn
M fr/FR_Tests.ttcn
2 files changed, 70 insertions(+), 49 deletions(-)

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



diff --git a/fr-net/FRNET_Tests.ttcn b/fr-net/FRNET_Tests.ttcn
index 593ca77..721dd32 100644
--- a/fr-net/FRNET_Tests.ttcn
+++ b/fr-net/FRNET_Tests.ttcn
@@ -8,6 +8,7 @@
 import from BSSGP_Emulation all;

 modulepar {
+   integer mp_num_bvc := 10;
NSConfigurations mp_nsconfig := {
{
nsei := 123,
@@ -34,11 +35,9 @@
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 {
var GbInstances g_gb;
@@ -53,28 +52,39 @@
gb.vc_BSSGP.start(BssgpStart(gb.cfg, testcasename()));
 }

-testcase TC_foo() runs on test_CT {
-   g_gb[0].cfg := {
-   nsei := 123,
-   sgsn_role := true,
-   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 := true,
+   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);
}
diff --git a/fr/FR_Tests.ttcn b/fr/FR_Tests.ttcn
index d2d184f..b220bb9 100644
--- a/fr/FR_Tests.ttcn
+++ b/fr/FR_Tests.ttcn
@@ -8,6 +8,7 @@
 import from BSSGP_Emulation all;

 modulepar {
+   integer mp_num_bvc := 10;
NSConfigurations mp_nsconfig := {
{
nsei := 123,
@@ -34,10 +35,9 @@
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 @@
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 := {
-   

Change in osmo-ttcn3-hacks[master]: FR/FRNET: Dynamically create number of BVC at runtime

2020-11-12 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21110 )

Change subject: FR/FRNET: Dynamically create number of BVC at runtime
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21110
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: I55b44481b5322deaf78619c1689462d716ddfcec
Gerrit-Change-Number: 21110
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 12 Nov 2020 20:01:49 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: FR/FRNET: Dynamically create number of BVC at runtime

2020-11-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21110 )

Change subject: FR/FRNET: Dynamically create number of BVC at runtime
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21110
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: I55b44481b5322deaf78619c1689462d716ddfcec
Gerrit-Change-Number: 21110
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 11 Nov 2020 22:46:15 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: FR/FRNET: Dynamically create number of BVC at runtime

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


Change subject: FR/FRNET: Dynamically create number of BVC at runtime
..

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
---
M fr-net/FRNET_Tests.ttcn
M fr/FR_Tests.ttcn
2 files changed, 70 insertions(+), 49 deletions(-)



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

diff --git a/fr-net/FRNET_Tests.ttcn b/fr-net/FRNET_Tests.ttcn
index 593ca77..721dd32 100644
--- a/fr-net/FRNET_Tests.ttcn
+++ b/fr-net/FRNET_Tests.ttcn
@@ -8,6 +8,7 @@
 import from BSSGP_Emulation all;

 modulepar {
+   integer mp_num_bvc := 10;
NSConfigurations mp_nsconfig := {
{
nsei := 123,
@@ -34,11 +35,9 @@
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 {
var GbInstances g_gb;
@@ -53,28 +52,39 @@
gb.vc_BSSGP.start(BssgpStart(gb.cfg, testcasename()));
 }

-testcase TC_foo() runs on test_CT {
-   g_gb[0].cfg := {
-   nsei := 123,
-   sgsn_role := true,
-   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 := true,
+   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);
}
diff --git a/fr/FR_Tests.ttcn b/fr/FR_Tests.ttcn
index d2d184f..b220bb9 100644
--- a/fr/FR_Tests.ttcn
+++ b/fr/FR_Tests.ttcn
@@ -8,6 +8,7 @@
 import from BSSGP_Emulation all;

 modulepar {
+   integer mp_num_bvc := 10;
NSConfigurations mp_nsconfig := {
{
nsei := 123,
@@ -34,10 +35,9 @@
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 @@
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 := {
-