summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-03-27 14:52:35 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2018-03-28 12:34:54 +0200
commit7593298b3653ffe260352709b9a23d5e7e706807 (patch)
treed24e3fb2f1bd7026e41eb172ef16449add24fac6
parent0f4a0f941f8ef0937de17c5bdd9bbc3a5c11e930 (diff)
MSC_Tests: Add support for multiple BSC
The upcomming tests for inter-BSC handover make it necessary to simulate multiple (two) BSCs to the MSC, while the current Implementation can only handle one BSC instance at a time. - Allow multiple BSC instances to be created - Add a simple reset-test to test what happens when two BSC instances are started (BSSMAP reset from two different BSCs) Change-Id: I52a4c8118828c1605cf672889982f987568ad17d Related: OS#1609
-rw-r--r--library/BSSAP_Adapter.ttcn5
-rw-r--r--msc/MSC_Tests.cfg1
-rw-r--r--msc/MSC_Tests.default28
-rw-r--r--msc/MSC_Tests.ttcn74
4 files changed, 80 insertions, 28 deletions
diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn
index e27783c..6c4f30e 100644
--- a/library/BSSAP_Adapter.ttcn
+++ b/library/BSSAP_Adapter.ttcn
@@ -44,7 +44,8 @@ type record BSSAP_Configuration {
integer own_ssn,
integer peer_pc,
integer peer_ssn,
- octetstring sio
+ octetstring sio,
+ integer rctx
};
/* construct a SCCP_PAR_Address with just PC + SSN and no GT */
@@ -97,7 +98,7 @@ function f_bssap_init(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg, charst
/* connect MTP3 service provider (M3UA) to lower side of SCCP */
connect(ba.vc_M3UA:MTP3_SP_PORT, ba.vc_SCCP:MTP3_SCCP_PORT);
- ba.vc_M3UA.start(f_M3UA_Emulation(cfg.sctp_addr));
+ ba.vc_M3UA.start(f_M3UA_Emulation(cfg.sctp_addr, cfg.rctx));
ba.vc_SCCP.start(SCCPStart(ba.sccp_pars));
if (isvalue(ops)) {
diff --git a/msc/MSC_Tests.cfg b/msc/MSC_Tests.cfg
index 6082d5b..5a3c33c 100644
--- a/msc/MSC_Tests.cfg
+++ b/msc/MSC_Tests.cfg
@@ -58,4 +58,5 @@ MSC_Tests.control
#MSC_Tests.TC_lu_imsi_auth_tmsi_encr_013_2
#MSC_Tests.TC_mo_release_timeout
#MSC_Tests.TC_lu_and_mt_call_no_dlcx_resp
+#MSC_Tests.TC_reset_two
#MSC_Tests.TC_lu_and_mt_call
diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default
index eff5d96..6958f10 100644
--- a/msc/MSC_Tests.default
+++ b/msc/MSC_Tests.default
@@ -24,14 +24,28 @@ mtc.FileMask := ERROR | WARNING;
[MODULE_PARAMETERS]
M3UA_Emulation.tsp_logVerbose := true;
MSC_Tests.mp_bssap_cfg := {
- sccp_service_type := "mtp3_itu",
- sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" },
- own_pc := 193,
- own_ssn := 254,
- peer_pc := 185,
- peer_ssn := 254,
- sio := '83'O
+ {
+ sccp_service_type := "mtp3_itu",
+ sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" },
+ own_pc := 193,
+ own_ssn := 254,
+ peer_pc := 185,
+ peer_ssn := 254,
+ sio := '83'O
+ rctx := 0
+ },
+ {
+ sccp_service_type := "mtp3_itu",
+ sctp_addr := { 23907, "127.0.0.1", 2905, "127.0.0.1" },
+ own_pc := 194,
+ own_ssn := 254,
+ peer_pc := 185,
+ peer_ssn := 254,
+ sio := '83'O
+ rctx := 1
+ }
};
+
Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoMSC";
[MAIN_CONTROLLER]
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 84f33b7..ce9c8b9 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -47,11 +47,13 @@ import from MobileL3_CommonIE_Types all;
import from L3_Templates all;
import from L3_Common all;
+const integer NUM_BSC := 2;
+type record of BSSAP_Configuration BSSAP_Configurations;
type component MTC_CT extends CTRL_Adapter_CT {
var boolean g_initialized := false;
- var BSSAP_Adapter g_bssap;
+ var BSSAP_Adapter g_bssap[NUM_BSC];
/* no 'adapter_CT' for MNCC or GSUP */
var MNCC_Emulation_CT vc_MNCC;
@@ -89,13 +91,27 @@ modulepar {
charstring mp_msc_mncc := "/tmp/mncc";
- BSSAP_Configuration mp_bssap_cfg := {
- sccp_service_type := "mtp3_itu",
- sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" },
- own_pc := 185,
- own_ssn := 254,
- peer_pc := 187,
- peer_ssn := 254
+ BSSAP_Configurations mp_bssap_cfg := {
+ {
+ sccp_service_type := "mtp3_itu",
+ sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" },
+ own_pc := 185,
+ own_ssn := 254,
+ peer_pc := 187,
+ peer_ssn := 254,
+ sio := '83'O,
+ rctx := 0
+ },
+ {
+ sccp_service_type := "mtp3_itu",
+ sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" },
+ own_pc := 186,
+ own_ssn := 254,
+ peer_pc := 187,
+ peer_ssn := 254,
+ sio := '83'O,
+ rctx := 1
+ }
};
}
@@ -167,14 +183,25 @@ function f_init_gsup(charstring id) runs on MTC_CT {
}
}
-function f_init() runs on MTC_CT {
+function f_init(integer num_bsc := 1) runs on MTC_CT {
if (g_initialized == true) {
return;
}
g_initialized := true;
- f_bssap_init(g_bssap, mp_bssap_cfg, "MSC_Test", BSC_BssmapOps);
+ if (num_bsc > NUM_BSC) {
+ setverdict(fail, "excess number of BSC instances requested");
+ }
+
+ for (var integer i := 0; i < num_bsc; i := i + 1) {
+ if (isbound(mp_bssap_cfg[i])) {
+ f_bssap_init(g_bssap[0], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_BssmapOps);
+ } else {
+ setverdict(fail, "missing BSSAP configuration");
+ }
+ }
+
f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port);
f_init_mncc("MSC_Test");
f_init_mgcp("MSC_Test");
@@ -194,8 +221,8 @@ function f_init() runs on MTC_CT {
* to f_init() when the high level functions of the BSC_ConnectionHandler are
* not needed. */
function f_init_bssap_direct() runs on MTC_CT {
- f_bssap_init(g_bssap, mp_bssap_cfg, "MSC_Test", omit);
- connect(g_bssap.vc_SCCP:SCCP_SP_PORT, self:BSSAP_DIRECT);
+ f_bssap_init(g_bssap[0], mp_bssap_cfg[0], "MSC_Test", omit);
+ connect(g_bssap[0].vc_SCCP:SCCP_SP_PORT, self:BSSAP_DIRECT);
/* Start guard timer and activate it as default */
Tguard_direct.start
@@ -376,8 +403,8 @@ function f_init_pars(integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlrPars
expect_ciph := false
};
var BSC_ConnHdlrPars pars := {
- sccp_addr_own := g_bssap.sccp_addr_own,
- sccp_addr_peer := g_bssap.sccp_addr_peer,
+ sccp_addr_own := g_bssap[0].sccp_addr_own,
+ sccp_addr_peer := g_bssap[0].sccp_addr_peer,
cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)),
imei := f_gen_imei(imsi_suffix),
imsi := f_gen_imsi(imsi_suffix),
@@ -399,8 +426,8 @@ function f_start_handler_with_pars(void_fn fn, BSC_ConnHdlrPars pars) runs on MT
vc_conn := BSC_ConnHdlr.create(id);
/* BSSMAP part / A interface */
- connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT);
- connect(vc_conn:BSSAP_PROC, g_bssap.vc_BSSMAP:PROC);
+ connect(vc_conn:BSSAP, g_bssap[0].vc_BSSMAP:CLIENT);
+ connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_BSSMAP:PROC);
/* MNCC part */
connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT);
connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC);
@@ -1665,10 +1692,10 @@ testcase TC_cr_before_reset() runs on MTC_CT {
f_init_bssap_direct();
/* Make a blind connection attemt, to trigger the deadlock condition */
- BSSAP_DIRECT.send(ts_BSSAP_CONNECT_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, 1, omit));
+ BSSAP_DIRECT.send(ts_BSSAP_CONNECT_req(g_bssap[0].sccp_addr_peer, g_bssap[0].sccp_addr_own, 1, omit));
/* Send a BSSMAP reset */
- BSSAP_DIRECT.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, ts_BSSMAP_Reset(0)));
+ BSSAP_DIRECT.send(ts_BSSAP_UNITDATA_req(g_bssap[0].sccp_addr_peer, g_bssap[0].sccp_addr_own, ts_BSSMAP_Reset(0)));
T.start
alt {
[] BSSAP_DIRECT.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_ResetAck)) {
@@ -1678,7 +1705,7 @@ testcase TC_cr_before_reset() runs on MTC_CT {
/* Acknowledge MSC sided reset requests */
[] BSSAP_DIRECT.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) {
- BSSAP_DIRECT.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, ts_BSSMAP_ResetAck));
+ BSSAP_DIRECT.send(ts_BSSAP_UNITDATA_req(g_bssap[0].sccp_addr_peer, g_bssap[0].sccp_addr_own, ts_BSSMAP_ResetAck));
repeat;
}
@@ -1774,6 +1801,14 @@ testcase TC_lu_and_mt_call_no_dlcx_resp() runs on MTC_CT {
f_init();
}
+/* Two BSSMAP resets from two different BSCs */
+testcase TC_reset_two() runs on MTC_CT {
+ var BSC_ConnHdlr vc_conn;
+ f_init(2);
+ f_sleep(2.0);
+ setverdict(pass);
+}
+
/* TODO:
* continue to send repeated MO signalling messages to keep channel open: does MSC tmeout?
* malformed messages (missing IE, invalid message type): properly rejected?
@@ -1831,6 +1866,7 @@ control {
execute( TC_lu_imsi_auth_tmsi_encr_013_2() );
execute( TC_mo_release_timeout() );
execute( TC_lu_and_mt_call_no_dlcx_resp() );
+ execute( TC_reset_two() );
execute( TC_lu_and_mt_call() );