Change in osmo-ttcn3-hacks[master]: CTRL: Introduce support to run osmocom CTRL server

2021-01-08 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012 )

Change subject: CTRL: Introduce support to run osmocom CTRL server
..


Patch Set 2: Code-Review+2

Merging since I applied the only comment which showed up.


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012
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: I37db9962f51baf2c63bd58ec47ec89f773d7a255
Gerrit-Change-Number: 22012
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 08 Jan 2021 13:46:43 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: CTRL: Introduce support to run osmocom CTRL server

2021-01-08 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012 )

Change subject: CTRL: Introduce support to run osmocom CTRL server
..

CTRL: Introduce support to run osmocom CTRL server

Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
---
M bsc-nat/BSCNAT_Tests.ttcn
M bsc/BSC_Tests.ttcn
M bts/BTS_Tests.ttcn
M hlr/HLR_Tests.ttcn
M library/Osmocom_CTRL_Adapter.ttcn
M library/Osmocom_CTRL_Functions.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
M sip/SIP_Tests.ttcn
9 files changed, 60 insertions(+), 22 deletions(-)

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



diff --git a/bsc-nat/BSCNAT_Tests.ttcn b/bsc-nat/BSCNAT_Tests.ttcn
index 41d58d7..1b24855 100644
--- a/bsc-nat/BSCNAT_Tests.ttcn
+++ b/bsc-nat/BSCNAT_Tests.ttcn
@@ -151,7 +151,7 @@

f_init_vty("VirtBSCNAT");
f_vty_allow_osmux(use_osmux);
-   f_ipa_ctrl_start(mp_nat_ip, mp_nat_ctrl_port);
+   f_ipa_ctrl_start_client(mp_nat_ip, mp_nat_ctrl_port);

for (i := 0; i < NUM_MSC; i := i+1) {
f_init_MscState(msc[i], mp_msc_pc +i, mp_bsc_pc, mp_msc_ssn, 
mp_bsc_ssn);
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index a1fa4dd..2c02e36 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1103,7 +1103,7 @@
/* start the test with exactly all enabled MSCs allowed to attach */
f_vty_msc_allow_attach(BSCVTY, allow_attach);

-   f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);
+   f_ipa_ctrl_start_client(mp_bsc_ip, mp_bsc_ctrl_port);

f_init_mgcp("VirtMSC");

@@ -3080,7 +3080,7 @@
bts[0].rsl.ccm_pars.name := "Osmocom TTCN-3 BTS Simulator";
bts[0].rsl.ccm_pars.unit_id := "99/0/0"; /* value which is unknown at 
BTS */
 
-   f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);
+   f_ipa_ctrl_start_client(mp_bsc_ip, mp_bsc_ctrl_port);

f_init_mgcp("VirtMSC");

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 16e3d71..c843032 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -547,7 +547,7 @@
f_init_rsl(id);
f_sleep(0.5);   /* workaround for OS#3000 */
f_init_vty(id);
-   f_ipa_ctrl_start(mp_ctrl_ip, mp_ctrl_port);
+   f_ipa_ctrl_start_client(mp_ctrl_ip, mp_ctrl_port);

/* Send SI3 to the BTS, it is needed for various computations */
f_rsl_bcch_fill(RSL_SYSTEM_INFO_3, ts_SI3_default);
@@ -5376,7 +5376,7 @@

/* re-connect CTRL port from BTS to BSC */
f_ipa_ctrl_stop();
-   f_ipa_ctrl_start(mp_bsc_ctrl_ip, mp_bsc_ctrl_port);
+   f_ipa_ctrl_start_client(mp_bsc_ctrl_ip, mp_bsc_ctrl_port);

/* Send that OML Alert */
PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_OML_ALERT, 
testcasename(;
diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn
index 36e28b8..ea450b3 100644
--- a/hlr/HLR_Tests.ttcn
+++ b/hlr/HLR_Tests.ttcn
@@ -245,7 +245,7 @@
f_init_gsup_server("HLR_Test");
}

-   f_ipa_ctrl_start(mp_hlr_ip, mp_hlr_ctrl_port);
+   f_ipa_ctrl_start_client(mp_hlr_ip, mp_hlr_ctrl_port);
 }

 /*! Start HLR_ConnHdlr from testCT in a separate thread.
diff --git a/library/Osmocom_CTRL_Adapter.ttcn 
b/library/Osmocom_CTRL_Adapter.ttcn
index 0be3ebb..fefff8b 100644
--- a/library/Osmocom_CTRL_Adapter.ttcn
+++ b/library/Osmocom_CTRL_Adapter.ttcn
@@ -26,12 +26,24 @@
port IPA_CTRL_PT IPA_CTRL;
 }

-
-/*! Start the CTRL connection to the specified BSC IP+Port */
-function f_ipa_ctrl_start(charstring bsc_host, PortNumber bsc_port)
+/* wait for IPA CTRL link to connect and send UP */
+function f_ipa_ctrl_wait_link_up()
 runs on CTRL_Adapter_CT {
-   var charstring id := "IPA-CTRL"
timer T := 10.0;
+   T.start;
+   alt {
+   [] IPA_CTRL.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_UP)) { }
+   [] T.timeout {
+   setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP");
+   mtc.stop;
+   }
+   }
+}
+
+/*! Start the CTRL client connection to the specified CTRL IP+Port server*/
+function f_ipa_ctrl_start_client(charstring bsc_host, PortNumber bsc_port)
+runs on CTRL_Adapter_CT {
+   var charstring id := "IPA-CTRL-CLI"

vc_CTRL_IPA := IPA_Emulation_CT.create(id & "-IPA");

@@ -41,15 +53,21 @@
vc_CTRL_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", 0,
c_IPA_default_ccm_pars, 
false));

-   /* wait for IPA CTRL link to connect and send UP */
-   T.start;
-   alt {
-   [] IPA_CTRL.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_UP)) { }
-   [] T.timeout {
-   setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP");
-   mtc.stop;
-   }
-   }
+   f_ipa_ctrl_wait_link_up();
+}
+
+/*! Start the CTRL server on the specified CTRL I

Change in osmo-ttcn3-hacks[master]: CTRL: Introduce support to run osmocom CTRL server

2021-01-07 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012 )

Change subject: CTRL: Introduce support to run osmocom CTRL server
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012
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: I37db9962f51baf2c63bd58ec47ec89f773d7a255
Gerrit-Change-Number: 22012
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 07 Jan 2021 18:56:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: CTRL: Introduce support to run osmocom CTRL server

2021-01-07 Thread pespin
Hello Jenkins Builder, laforge, fixeria,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012

to look at the new patch set (#2).

Change subject: CTRL: Introduce support to run osmocom CTRL server
..

CTRL: Introduce support to run osmocom CTRL server

Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
---
M bsc-nat/BSCNAT_Tests.ttcn
M bsc/BSC_Tests.ttcn
M bts/BTS_Tests.ttcn
M hlr/HLR_Tests.ttcn
M library/Osmocom_CTRL_Adapter.ttcn
M library/Osmocom_CTRL_Functions.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
M sip/SIP_Tests.ttcn
9 files changed, 60 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/12/22012/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012
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: I37db9962f51baf2c63bd58ec47ec89f773d7a255
Gerrit-Change-Number: 22012
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: CTRL: Introduce support to run osmocom CTRL server

2021-01-07 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012 )

Change subject: CTRL: Introduce support to run osmocom CTRL server
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012/1/library/Osmocom_CTRL_Adapter.ttcn
File library/Osmocom_CTRL_Adapter.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012/1/library/Osmocom_CTRL_Adapter.ttcn@62
PS1, Line 62:   v
> it might make sense to differentiate based on server/client in the ID. […]
Ack.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012
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: I37db9962f51baf2c63bd58ec47ec89f773d7a255
Gerrit-Change-Number: 22012
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 07 Jan 2021 13:30:20 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: CTRL: Introduce support to run osmocom CTRL server

2021-01-07 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012 )

Change subject: CTRL: Introduce support to run osmocom CTRL server
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012/1/library/Osmocom_CTRL_Adapter.ttcn
File library/Osmocom_CTRL_Adapter.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012/1/library/Osmocom_CTRL_Adapter.ttcn@62
PS1, Line 62:   v
it might make sense to differentiate based on server/client in the ID.  
Othertwise you start both client and server "adapter" and their components have 
identical names.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012
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: I37db9962f51baf2c63bd58ec47ec89f773d7a255
Gerrit-Change-Number: 22012
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 07 Jan 2021 12:59:42 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: CTRL: Introduce support to run osmocom CTRL server

2021-01-07 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22012 )


Change subject: CTRL: Introduce support to run osmocom CTRL server
..

CTRL: Introduce support to run osmocom CTRL server

Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
---
M bsc-nat/BSCNAT_Tests.ttcn
M bsc/BSC_Tests.ttcn
M bts/BTS_Tests.ttcn
M hlr/HLR_Tests.ttcn
M library/Osmocom_CTRL_Adapter.ttcn
M library/Osmocom_CTRL_Functions.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
M sip/SIP_Tests.ttcn
9 files changed, 59 insertions(+), 21 deletions(-)



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

diff --git a/bsc-nat/BSCNAT_Tests.ttcn b/bsc-nat/BSCNAT_Tests.ttcn
index 41d58d7..1b24855 100644
--- a/bsc-nat/BSCNAT_Tests.ttcn
+++ b/bsc-nat/BSCNAT_Tests.ttcn
@@ -151,7 +151,7 @@

f_init_vty("VirtBSCNAT");
f_vty_allow_osmux(use_osmux);
-   f_ipa_ctrl_start(mp_nat_ip, mp_nat_ctrl_port);
+   f_ipa_ctrl_start_client(mp_nat_ip, mp_nat_ctrl_port);

for (i := 0; i < NUM_MSC; i := i+1) {
f_init_MscState(msc[i], mp_msc_pc +i, mp_bsc_pc, mp_msc_ssn, 
mp_bsc_ssn);
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index a1fa4dd..2c02e36 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1103,7 +1103,7 @@
/* start the test with exactly all enabled MSCs allowed to attach */
f_vty_msc_allow_attach(BSCVTY, allow_attach);

-   f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);
+   f_ipa_ctrl_start_client(mp_bsc_ip, mp_bsc_ctrl_port);

f_init_mgcp("VirtMSC");

@@ -3080,7 +3080,7 @@
bts[0].rsl.ccm_pars.name := "Osmocom TTCN-3 BTS Simulator";
bts[0].rsl.ccm_pars.unit_id := "99/0/0"; /* value which is unknown at 
BTS */

-   f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);
+   f_ipa_ctrl_start_client(mp_bsc_ip, mp_bsc_ctrl_port);

f_init_mgcp("VirtMSC");

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 16e3d71..c843032 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -547,7 +547,7 @@
f_init_rsl(id);
f_sleep(0.5);   /* workaround for OS#3000 */
f_init_vty(id);
-   f_ipa_ctrl_start(mp_ctrl_ip, mp_ctrl_port);
+   f_ipa_ctrl_start_client(mp_ctrl_ip, mp_ctrl_port);

/* Send SI3 to the BTS, it is needed for various computations */
f_rsl_bcch_fill(RSL_SYSTEM_INFO_3, ts_SI3_default);
@@ -5376,7 +5376,7 @@

/* re-connect CTRL port from BTS to BSC */
f_ipa_ctrl_stop();
-   f_ipa_ctrl_start(mp_bsc_ctrl_ip, mp_bsc_ctrl_port);
+   f_ipa_ctrl_start_client(mp_bsc_ctrl_ip, mp_bsc_ctrl_port);

/* Send that OML Alert */
PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_OML_ALERT, 
testcasename(;
diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn
index 36e28b8..ea450b3 100644
--- a/hlr/HLR_Tests.ttcn
+++ b/hlr/HLR_Tests.ttcn
@@ -245,7 +245,7 @@
f_init_gsup_server("HLR_Test");
}

-   f_ipa_ctrl_start(mp_hlr_ip, mp_hlr_ctrl_port);
+   f_ipa_ctrl_start_client(mp_hlr_ip, mp_hlr_ctrl_port);
 }

 /*! Start HLR_ConnHdlr from testCT in a separate thread.
diff --git a/library/Osmocom_CTRL_Adapter.ttcn 
b/library/Osmocom_CTRL_Adapter.ttcn
index 0be3ebb..6e0d1c6 100644
--- a/library/Osmocom_CTRL_Adapter.ttcn
+++ b/library/Osmocom_CTRL_Adapter.ttcn
@@ -26,12 +26,24 @@
port IPA_CTRL_PT IPA_CTRL;
 }

+/* wait for IPA CTRL link to connect and send UP */
+function f_ipa_ctrl_wait_link_up()
+runs on CTRL_Adapter_CT {
+   timer T := 10.0;
+   T.start;
+   alt {
+   [] IPA_CTRL.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_UP)) { }
+   [] T.timeout {
+   setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP");
+   mtc.stop;
+   }
+   }
+}

-/*! Start the CTRL connection to the specified BSC IP+Port */
-function f_ipa_ctrl_start(charstring bsc_host, PortNumber bsc_port)
+/*! Start the CTRL client connection to the specified CTRL IP+Port server*/
+function f_ipa_ctrl_start_client(charstring bsc_host, PortNumber bsc_port)
 runs on CTRL_Adapter_CT {
var charstring id := "IPA-CTRL"
-   timer T := 10.0;

vc_CTRL_IPA := IPA_Emulation_CT.create(id & "-IPA");

@@ -41,15 +53,21 @@
vc_CTRL_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", 0,
c_IPA_default_ccm_pars, 
false));

-   /* wait for IPA CTRL link to connect and send UP */
-   T.start;
-   alt {
-   [] IPA_CTRL.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_UP)) { }
-   [] T.timeout {
-   setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP");
-   mtc.stop;
-   }
-   }
+   f_ipa_ctrl_wait_link_up();
+}
+
+/*! Start the CTRL server on the specified CTRL IP+Port */
+function f_ipa_ctrl_start_server(charstring listen_h