aboutsummaryrefslogtreecommitdiffstats
path: root/bsc/BSC_Tests.ttcn
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-06-18 17:45:20 +0200
committerlaforge <laforge@gnumonks.org>2019-06-24 13:53:25 +0000
commitfd02ad474ea878c469408c200a1214114de55f13 (patch)
treee9bc19804e867c7416b907f82be67993c4411bb6 /bsc/BSC_Tests.ttcn
parent1a026a52d3e7c2914f8775c15245dbfbef5bdd40 (diff)
bsc: Test MGCP-over-IPA forwarding in SCCPlite tests
* MGCP-over-IPA handling in MSC_ConnectionHandler means we need to use the new MGCP_CLIENT_MULTI port since we'll be managing MGCP messages from 2 different UDP connections, and we need to be able to route answers correctly. As a result, parameter multi_conn_mode is enabled for SCCPlite and all code adapted to use that port in that type of scenario. * iDuring calls when on SCCPlite, send a full (all-required-params-in) CRCX through the MGCP-over-IPA connection towards the BSC in order to emulate the MSC, and expect the correct answer back. This way we test BSC funcionality to forward MGCP messages coming from MSC works as expected. Related: OS#2536 Depends: osmo-bsc.git I38ad8fa645c08900e0e1f1b4b96136bc6d96b3ab Change-Id: I31fed700772dd0b063f913b1e1639fd428c46e7d
Diffstat (limited to 'bsc/BSC_Tests.ttcn')
-rw-r--r--bsc/BSC_Tests.ttcn28
1 files changed, 23 insertions, 5 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 4c86e51f..ec1be132 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -38,6 +38,7 @@ import from RSL_Emulation all;
import from MGCP_Emulation all;
import from MGCP_Templates all;
import from MGCP_Types all;
+import from MGCP_CodecPort all;
import from Osmocom_CTRL_Functions all;
import from Osmocom_CTRL_Types all;
@@ -295,7 +296,9 @@ function f_init_mgcp(charstring id) runs on test_CT {
callagent_udp_port := -1,
mgw_ip := mp_test_ip,
mgw_udp_port := 2427,
- multi_conn_mode := false
+ /* Enable it for SCCPlite, since we have 2 MGCP sockets towards MGW (UDP one +
+ the on with MGCP over IPA forwarded from MSC one) */
+ multi_conn_mode := (mp_bssap_cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER)
};
vc_MGCP := MGCP_Emulation_CT.create(id);
@@ -1718,6 +1721,7 @@ private function f_connect_handler(inout MSC_ConnHdlr vc_conn) runs on test_CT {
}
connect(vc_conn:BSSAP, g_bssap.vc_RAN:CLIENT);
connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT);
+ connect(vc_conn:MGCP_MULTI, vc_MGCP:MGCP_CLIENT_MULTI);
}
function f_start_handler(void_fn fn, template (omit) TestHdlrParams pars := omit)
@@ -2891,18 +2895,32 @@ testcase TC_ho_int() runs on test_CT {
/* Expecting MGCP to DLCX the endpoint's two connections: towards BTS and towards MSC */
private function f_expect_dlcx_conns(boolean exp_clear_cmpl := true) runs on MSC_ConnHdlr {
var MgcpCommand mgcp;
+ var template MgcpResponse mgcp_resp;
+ var MGCP_RecvFrom mrf;
+ var template MgcpMessage msg_resp;
+ var template MgcpMessage msg_dlcx := {
+ command := tr_DLCX()
+ }
- MGCP.receive(tr_DLCX()) -> value mgcp {
+ if (g_pars.aoip) {
+ MGCP.receive(tr_DLCX()) -> value mgcp {
log("Got first DLCX: ", mgcp);
MGCP.send(ts_DLCX_ACK2(mgcp.line.trans_id));
- };
+ };
- /* For SCCPLite, BSC doesn't handle the MSC-side */
- if (g_pars.aoip) {
MGCP.receive(tr_DLCX()) -> value mgcp {
log("Got second DLCX: ", mgcp);
MGCP.send(ts_DLCX_ACK2(mgcp.line.trans_id));
};
+ } else {
+ /* For SCCPLite, BSC doesn't handle the MSC-side */
+ MGCP_MULTI.receive(tr_MGCP_RecvFrom_any(msg_dlcx)) -> value mrf {
+ log("Got first DLCX: ", mrf.msg.command);
+ msg_resp := {
+ response := ts_DLCX_ACK2(mrf.msg.command.line.trans_id)
+ }
+ MGCP_MULTI.send(t_MGCP_SendToMrf(mrf, msg_resp));
+ };
}
if (exp_clear_cmpl) {