Change in ...osmo-ttcn3-hacks[master]: bscnat: Add function to run actions on test per BSC component

2019-06-13 Thread pespin
pespin has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14413 )

Change subject: bscnat: Add function to run actions on test per BSC component
..

bscnat: Add function to run actions on test per BSC component

Will be useful to test stuff on IPA layer BSC<->BSC-NAT.

Change-Id: I97e743c79e5e9e7613ab91a1aa9ce2377a237fd5
---
M bsc-nat/BSCNAT_Tests.ttcn
M bsc-nat/BSC_MS_Simulation.ttcn
2 files changed, 19 insertions(+), 13 deletions(-)

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



diff --git a/bsc-nat/BSCNAT_Tests.ttcn b/bsc-nat/BSCNAT_Tests.ttcn
index 47d894b..81afcfa 100644
--- a/bsc-nat/BSCNAT_Tests.ttcn
+++ b/bsc-nat/BSCNAT_Tests.ttcn
@@ -138,7 +138,7 @@
f_vty_transceive(BSCNATVTY, "enable");
 }

-function f_init(void_fn_bsc_ms fn_bsc_ms, BssmapCreateCallback cb_msc, boolean 
use_osmux) runs on test_CT {
+function f_init(void_fn_bsc_ms fn_bsc_ms, void_fn_bsc fn_bsc, 
BssmapCreateCallback cb_msc, boolean use_osmux) runs on test_CT {
var integer i;
var charstring id;

@@ -166,7 +166,7 @@
pars.sccp_addr_remote := bsc[i].sccp_addr_peer;
pars.use_osmux := use_osmux;
bsc[i].BSC.start(BSC_MS_Simulation.main(mp_nat_ip, mp_nat_port, 
mp_bsc_ip, mp_bsc_port+i,
-   bsc[i].sccp_pars, pars, 
fn_bsc_ms, id));
+   bsc[i].sccp_pars, pars, 
fn_bsc_ms, fn_bsc, id));
}

 }
@@ -191,6 +191,7 @@
timer T := 30.0;

f_init(refers(bsc_ms_establish_fully),
+  refers(bsc_do_nothing),
   refers(CreateCallback_establish_fully),
   use_osmux);

diff --git a/bsc-nat/BSC_MS_Simulation.ttcn b/bsc-nat/BSC_MS_Simulation.ttcn
index 5feaf0e..7f23318 100644
--- a/bsc-nat/BSC_MS_Simulation.ttcn
+++ b/bsc-nat/BSC_MS_Simulation.ttcn
@@ -23,6 +23,9 @@

 import from BSC_MS_ConnectionHandler all;

+type function void_fn_bsc(charstring id) runs on BSC_CT;
+type record of BSC_MS_ConnHdlr BSC_MS_ConnHdlrList;
+
 type component BSC_CT {
/* component references */
var IPA_Emulation_CT vc_IPA;
@@ -64,11 +67,15 @@
fn.apply(id);
 }

+function bsc_do_nothing(charstring id)
+runs on BSC_CT {
+}
+
 function main(charstring remote_ip, PortNumber remote_port,
charstring local_ip, PortNumber local_port,
MSC_SCCP_MTP3_parameters sccp_pars,
BSC_MS_TestHdlrParams pars,
-   void_fn_bsc_ms fn, charstring id) runs on BSC_CT
+   void_fn_bsc_ms fn_bsc_ms, void_fn_bsc fn_bsc, charstring id) 
runs on BSC_CT
 {
var integer i := 0;
timer T := 1.0;
@@ -101,8 +108,15 @@
T.start(2.0);
T.timeout;

+   var BSC_MS_ConnHdlrList vc_conns;
for (i := 0; i < mp_num_iterations; i := i+1) {
-   f_start_BSC_MS(fn, id & "-MS-" & int2str(i));
+   vc_conns[i] := f_start_handler(fn_bsc_ms, id & "-MS-" & 
int2str(i), g_pars);
+   }
+
+   fn_bsc.apply(id);
+
+   for (i := 0; i < mp_num_iterations; i := i+1) {
+   vc_conns[i].done;
}

/* explicitly stop all components that we started above */
@@ -111,13 +125,4 @@
vc_SCCP.stop;
 }

-function f_start_BSC_MS(void_fn_bsc_ms fn, charstring id) runs on BSC_CT {
-   var BSC_MS_ConnHdlr vc_conn;
-   /* start component */
-   vc_conn := f_start_handler(fn, id, g_pars);
-   /* blocking wait until component terminates.  If you want to start MSs 
in parallel,
-* you have to remove this statement here */
-   vc_conn.done;
-}
-
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14413
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: I97e743c79e5e9e7613ab91a1aa9ce2377a237fd5
Gerrit-Change-Number: 14413
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in ...osmo-ttcn3-hacks[master]: bscnat: Add function to run actions on test per BSC component

2019-06-12 Thread osmith
osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14413 )

Change subject: bscnat: Add function to run actions on test per BSC component
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14413
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: I97e743c79e5e9e7613ab91a1aa9ce2377a237fd5
Gerrit-Change-Number: 14413
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 12 Jun 2019 12:13:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: bscnat: Add function to run actions on test per BSC component

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

Change subject: bscnat: Add function to run actions on test per BSC component
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14413
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: I97e743c79e5e9e7613ab91a1aa9ce2377a237fd5
Gerrit-Change-Number: 14413
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 11 Jun 2019 14:38:55 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: bscnat: Add function to run actions on test per BSC component

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

Change subject: bscnat: Add function to run actions on test per BSC component
..


Patch Set 2:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14413
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: I97e743c79e5e9e7613ab91a1aa9ce2377a237fd5
Gerrit-Change-Number: 14413
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 11 Jun 2019 14:03:13 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: bscnat: Add function to run actions on test per BSC component

2019-06-10 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14413


Change subject: bscnat: Add function to run actions on test per BSC component
..

bscnat: Add function to run actions on test per BSC component

Will be useful to test stuff on IPA layer BSC<->BSC-NAT.

Change-Id: I97e743c79e5e9e7613ab91a1aa9ce2377a237fd5
---
M bsc-nat/BSCNAT_Tests.ttcn
M bsc-nat/BSC_MS_Simulation.ttcn
2 files changed, 12 insertions(+), 4 deletions(-)



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

diff --git a/bsc-nat/BSCNAT_Tests.ttcn b/bsc-nat/BSCNAT_Tests.ttcn
index 47d894b..81afcfa 100644
--- a/bsc-nat/BSCNAT_Tests.ttcn
+++ b/bsc-nat/BSCNAT_Tests.ttcn
@@ -138,7 +138,7 @@
f_vty_transceive(BSCNATVTY, "enable");
 }

-function f_init(void_fn_bsc_ms fn_bsc_ms, BssmapCreateCallback cb_msc, boolean 
use_osmux) runs on test_CT {
+function f_init(void_fn_bsc_ms fn_bsc_ms, void_fn_bsc fn_bsc, 
BssmapCreateCallback cb_msc, boolean use_osmux) runs on test_CT {
var integer i;
var charstring id;

@@ -166,7 +166,7 @@
pars.sccp_addr_remote := bsc[i].sccp_addr_peer;
pars.use_osmux := use_osmux;
bsc[i].BSC.start(BSC_MS_Simulation.main(mp_nat_ip, mp_nat_port, 
mp_bsc_ip, mp_bsc_port+i,
-   bsc[i].sccp_pars, pars, 
fn_bsc_ms, id));
+   bsc[i].sccp_pars, pars, 
fn_bsc_ms, fn_bsc, id));
}

 }
@@ -191,6 +191,7 @@
timer T := 30.0;

f_init(refers(bsc_ms_establish_fully),
+  refers(bsc_do_nothing),
   refers(CreateCallback_establish_fully),
   use_osmux);

diff --git a/bsc-nat/BSC_MS_Simulation.ttcn b/bsc-nat/BSC_MS_Simulation.ttcn
index 5feaf0e..fe12305 100644
--- a/bsc-nat/BSC_MS_Simulation.ttcn
+++ b/bsc-nat/BSC_MS_Simulation.ttcn
@@ -23,6 +23,8 @@

 import from BSC_MS_ConnectionHandler all;

+type function void_fn_bsc(charstring id) runs on BSC_CT;
+
 type component BSC_CT {
/* component references */
var IPA_Emulation_CT vc_IPA;
@@ -64,11 +66,15 @@
fn.apply(id);
 }

+function bsc_do_nothing(charstring id)
+runs on BSC_CT {
+}
+
 function main(charstring remote_ip, PortNumber remote_port,
charstring local_ip, PortNumber local_port,
MSC_SCCP_MTP3_parameters sccp_pars,
BSC_MS_TestHdlrParams pars,
-   void_fn_bsc_ms fn, charstring id) runs on BSC_CT
+   void_fn_bsc_ms fn_bsc_ms, void_fn_bsc fn_bsc, charstring id) 
runs on BSC_CT
 {
var integer i := 0;
timer T := 1.0;
@@ -102,8 +108,9 @@
T.timeout;

for (i := 0; i < mp_num_iterations; i := i+1) {
-   f_start_BSC_MS(fn, id & "-MS-" & int2str(i));
+   f_start_BSC_MS(fn_bsc_ms, id & "-MS-" & int2str(i));
}
+   fn_bsc.apply(id);

/* explicitly stop all components that we started above */
vc_IPA.stop;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14413
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: I97e743c79e5e9e7613ab91a1aa9ce2377a237fd5
Gerrit-Change-Number: 14413
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange