Change in osmo-ttcn3-hacks[master]: BSC LCLS: add bts-loop tests

2018-11-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11559 )

Change subject: BSC LCLS: add bts-loop tests
..


Patch Set 7: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11559
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I40e786b430591899c722d99d685db26efa868508
Gerrit-Change-Number: 11559
Gerrit-PatchSet: 7
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Neels Hofmeyr 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 19 Nov 2018 05:54:28 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: BSC LCLS: add bts-loop tests

2018-11-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11559 )

Change subject: BSC LCLS: add bts-loop tests
..

BSC LCLS: add bts-loop tests

Add basic establishment and teardown tests for 'bts-loop' mode of LCLS:
* add explicit vty init for desired LCLS kind
* add necessary IPA RSL MDCX functions
* explicitly pass LCLS kind as a parameter to shared
  functions (defaulting to 'mgw-loop')

Change-Id: I40e786b430591899c722d99d685db26efa868508
Related: OS#3659
---
M bsc/BSC_Tests.ttcn
M bsc/BSC_Tests_LCLS.ttcn
M bsc/expected-results.xml
3 files changed, 127 insertions(+), 12 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 21ec0ff..13535ce 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -289,7 +289,7 @@
vc_MGCP.start(MGCP_Emulation.main(ops, mgcp_pars, id));
 }

-private function f_init_vty(charstring id := "foo") runs on test_CT {
+function f_init_vty(charstring id := "foo") runs on test_CT {
if (BSCVTY.checkstate("Mapped")) {
/* skip initialization if already executed once */
return;
diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn
index 585059e..c401206 100644
--- a/bsc/BSC_Tests_LCLS.ttcn
+++ b/bsc/BSC_Tests_LCLS.ttcn
@@ -36,6 +36,7 @@
 import from MGCP_Emulation all;
 import from MGCP_Templates all;
 import from SDP_Types all;
+import from Native_Functions all;

 import from Osmocom_CTRL_Functions all;
 import from Osmocom_CTRL_Types all;
@@ -226,13 +227,20 @@
}
 }

-private function f_lcls_init(integer nr_bts := 1) runs on lcls_test_CT
+private function f_lcls_init(boolean bts_mode := false, integer nr_bts := 1) 
runs on lcls_test_CT
 {
var default d;

d := activate(as_ignore());
f_init(nr_bts, true);
f_sleep(1.0);
+
+   f_init_vty();
+   if (bts_mode == true) {
+   f_vty_config(BSCVTY, "msc", "lcls-mode bts-loop");
+   } else {
+   f_vty_config(BSCVTY, "msc", "lcls-mode mgw-loop");
+   }
 }


@@ -273,12 +281,62 @@
}
 }

-private function f_tc_lcls_gcr_bway_connect(boolean hr) runs on lcls_test_CT {
+private function f_tc_lcls_ack_rsl_mdcx(RSL_Message rsl_msg, boolean 
send_on_a) runs on lcls_test_CT {
+   var boolean fixme_unused;
+   var RSL_IE_Body ie;
+   var RslChannelNr chan_nr;
+   var uint16_t conn_id;
+   var uint7_t rtp_pt := 0;
+   var HostName host;
+   var PortNumber port_num;
+
+   if (f_rsl_find_ie(rsl_msg, RSL_IE_CHAN_NR, ie) == true) {
+   chan_nr := ie.chan_nr;
+   } else {
+   log("Unable to find chan# in ", rsl_msg);
+   }
+
+fixme_unused := f_rsl_find_ie(rsl_msg, RSL_IE_IPAC_CONN_ID, ie);
+conn_id := ie.ipa_conn_id;
+
+/* mandatory fields */
+   fixme_unused := f_rsl_find_ie(rsl_msg, RSL_IE_IPAC_REMOTE_IP, ie);
+   host := f_inet_ntoa(int2oct(ie.ipa_remote_ip, 4));
+
+fixme_unused := f_rsl_find_ie(rsl_msg, RSL_IE_IPAC_REMOTE_PORT, ie);
+   port_num := ie.ipa_remote_port;
+   log("LCLS IPA MDCX for lchan ", chan_nr, " connection ID ", conn_id, " 
host ", host, ":", port_num);
+
+/* optional */
+   if (f_rsl_find_ie(rsl_msg, RSL_IE_IPAC_RTP_PAYLOAD, ie)) {
+   rtp_pt := ie.ipa_rtp_pt;
+   }
+
+   if (send_on_a == true) {
+   CONN_A.send(ts_RSL_IPA_MDCX_ACK(chan_nr, conn_id, 
oct2int(f_inet_addr(host)), port_num, rtp_pt));
+   } else {
+   CONN_B.send(ts_RSL_IPA_MDCX_ACK(chan_nr, conn_id, 
oct2int(f_inet_addr(host)), port_num, rtp_pt));
+   }
+}
+
+private function f_tc_lcls_recv_ls_exp_rsl() runs on lcls_test_CT {
+   var RSL_Message rsl_msg;
+   interleave {
+   [] 
CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)) {}
+   [] 
CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_locally_switched)) {}
+   [] CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL) {}
+   [] CONN_A.receive(tr_RSL_IPA_MDCX(?, ?)) -> value rsl_msg {
+   f_tc_lcls_ack_rsl_mdcx(rsl_msg, true)
+   }
+   }
+}
+
+private function f_tc_lcls_gcr_bway_connect(boolean hr, boolean bts_mode := 
false) runs on lcls_test_CT {
var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars);
var TestHdlrParams pars_b;
var MSC_ConnHdlr vc_conn;

-   f_lcls_init();
+   f_lcls_init(bts_mode);

if (hr == true) {
pars_a.ass_codec_list := 
valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR}));
@@ -288,6 +346,7 @@
pars_a.lcls.gcr := valueof(ts_GCR('010203'O, '0405'O, '060708090a'O));
pars_a.lcls.cfg := LCLS_CFG_both_way;
pars_a.lcls.csc := LCLS_CSC_connect;
+pars_a.lcls.adjust_cx_exp := not bts_mode;

Change in osmo-ttcn3-hacks[master]: BSC LCLS: add bts-loop tests

2018-11-11 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11559 )

Change subject: BSC LCLS: add bts-loop tests
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11559
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I40e786b430591899c722d99d685db26efa868508
Gerrit-Change-Number: 11559
Gerrit-PatchSet: 6
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Neels Hofmeyr 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 11 Nov 2018 21:52:51 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: BSC LCLS: add bts-loop tests

2018-11-06 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/11559

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

Change subject: BSC LCLS: add bts-loop tests
..

BSC LCLS: add bts-loop tests

Add basic establishment and teardown tests for 'bts-loop' mode of LCLS:
* add explicit vty init for desired LCLS kind
* add necessary IPA RSL MDCX functions
* explicitly pass LCLS kind as a parameter to shared
  functions (defaulting to 'mgw-loop')

Change-Id: I40e786b430591899c722d99d685db26efa868508
Related: OS#3659
---
M bsc/BSC_Tests.ttcn
M bsc/BSC_Tests_LCLS.ttcn
M bsc/expected-results.xml
3 files changed, 134 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/59/11559/5
--
To view, visit https://gerrit.osmocom.org/11559
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I40e786b430591899c722d99d685db26efa868508
Gerrit-Change-Number: 11559
Gerrit-PatchSet: 5
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Neels Hofmeyr 
Gerrit-CC: Vadim Yanitskiy 


Change in osmo-ttcn3-hacks[master]: BSC LCLS: add bts-loop tests

2018-11-05 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11559 )

Change subject: BSC LCLS: add bts-loop tests
..


Patch Set 3:

(5 comments)

https://gerrit.osmocom.org/#/c/11559/3/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

https://gerrit.osmocom.org/#/c/11559/3/bsc/BSC_Tests.ttcn@a292
PS3, Line 292:
Why not to expose this function in a separate change?


https://gerrit.osmocom.org/#/c/11559/3/bsc/BSC_Tests_LCLS.ttcn
File bsc/BSC_Tests_LCLS.ttcn:

https://gerrit.osmocom.org/#/c/11559/3/bsc/BSC_Tests_LCLS.ttcn@239
PS3, Line 239: f_init_vty();
cosmetic: this could be placed outside the 'if' statement.


https://gerrit.osmocom.org/#/c/11559/3/bsc/BSC_Tests_LCLS.ttcn@295
PS3, Line 295: chan_nr := ie.chan_nr
Hmm, missing semicolon?
I think the build verification would fail...

Probably, it works when a { ... } block contains
only a single line, but adding a new line would
require one to add the missing semicolon.

Let's avoid this.


https://gerrit.osmocom.org/#/c/11559/3/bsc/BSC_Tests_LCLS.ttcn@297
PS3, Line 297: log("Unable to find chan# in ", rsl_msg)
Same here. And moreover, should we just ignore this?
Wouldn't this cause dynamic testcase error?


https://gerrit.osmocom.org/#/c/11559/3/bsc/BSC_Tests_LCLS.ttcn@334
PS3, Line 334: CONN_A.receive(RSL_Message:?) -> value rsl_msg
Why this part is commented out?
Makes sense to add some FIXME/TODO note.



--
To view, visit https://gerrit.osmocom.org/11559
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I40e786b430591899c722d99d685db26efa868508
Gerrit-Change-Number: 11559
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Neels Hofmeyr 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 05 Nov 2018 22:55:19 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: BSC LCLS: add bts-loop tests

2018-11-05 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11559 )

Change subject: BSC LCLS: add bts-loop tests
..


Patch Set 3:

Not sure how ATM. So far the plan is to implement MSC side and test with real 
hw, than adjust tests if necessary. Would be nice to be able to test purely in 
TTCN as well but that would require implementing proper RTP receiver - not sure 
how much effort it is.


--
To view, visit https://gerrit.osmocom.org/11559
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I40e786b430591899c722d99d685db26efa868508
Gerrit-Change-Number: 11559
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 05 Nov 2018 10:53:28 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: BSC LCLS: add bts-loop tests

2018-11-04 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/11559 )

Change subject: BSC LCLS: add bts-loop tests
..


Patch Set 3:

just a general idea ... when I refactored osmo-bsc's FSMs, I managed to 
completely break the RTP streams, but the ttcn tests never noticed, because 
they don't verify that the expected IP:port are sent to the {BTS,MGW} nor that 
RTP packets follow the expected route. Would it be possible to test for this in 
more detail, without huge effort?


--
To view, visit https://gerrit.osmocom.org/11559
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I40e786b430591899c722d99d685db26efa868508
Gerrit-Change-Number: 11559
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 05 Nov 2018 04:03:27 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: BSC LCLS: add bts-loop tests

2018-11-01 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11559 )

Change subject: BSC LCLS: add bts-loop tests
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11559
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I40e786b430591899c722d99d685db26efa868508
Gerrit-Change-Number: 11559
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 01 Nov 2018 12:36:42 +
Gerrit-HasComments: No
Gerrit-HasLabels: No