BSC_Tests: Add CTRL interface connection
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 55d54a3..6735459 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -11,14 +11,22 @@
import from IPA_Types all;
import from RSL_Types all;
+import from Osmocom_CTRL_Functions all;
+
import from RSL_Tests all;
const integer NUM_BTS := 1;
const float T3101_MAX := 12.0;
+type record BTS_State {
+ IPA_Client rsl,
+ IPA_Client ctrl
+}
+
type component test_CT extends BSSAP_Adapter_CT {
- var IPA_Client bts[NUM_BTS];
+ var BTS_State bts[NUM_BTS];
port IPA_RSL_PT IPA_RSL[NUM_BTS];
+ port IPA_CTRL_PT IPA_CTRL[NUM_BTS];
var boolean g_initialized := false;
timer T_guard := 30.0;
@@ -28,6 +36,7 @@
modulepar {
charstring mp_bsc_ip := "127.0.0.1";
integer mp_bsc_rsl_port := 3003;
+ integer mp_bsc_ctrl_port := 4249;
}
type record IPA_Client {
@@ -40,7 +49,7 @@
runs on test_CT {
timer T := 10.0;
- clnt.id := "IPA" & int2str(i);
+ clnt.id := "IPA" & int2str(i) & "-RSL";
clnt.vc_IPA := IPA_Emulation_CT.create(clnt.id & "-IPA");
clnt.ccm_pars := c_IPA_default_ccm_pars;
clnt.ccm_pars.name := "Osmocom TTCN-3 BTS Simulator";
@@ -60,12 +69,36 @@
}
[] IPA_RSL[i].receive { repeat }
[] T.timeout {
- setverdict(fail, "Timeout waiting for ASP_IPA_EVENT_ID_ACK");
+ setverdict(fail, "Timeout RSL waiting for ASP_IPA_EVENT_ID_ACK");
self.stop;
}
}
}
+function f_ipa_ctrl_start(inout IPA_Client clnt, charstring bsc_host, PortNumber bsc_port, integer i)
+runs on test_CT {
+ timer T := 10.0;
+
+ clnt.id := "IPA" & int2str(i) & "-CTRL";
+ clnt.vc_IPA := IPA_Emulation_CT.create(clnt.id & "-IPA");
+
+ map(clnt.vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
+ connect(clnt.vc_IPA:IPA_CTRL_PORT, self:IPA_CTRL[i]);
+
+ clnt.vc_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", -1));
+
+ /* wait for IPA CTRL link to connect and send UP */
+ T.start;
+ alt {
+ [] IPA_CTRL[i].receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { }
+ [] T.timeout {
+ setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP");
+ self.stop;
+ }
+ }
+}
+
+
function f_sleep(float seconds) {
timer T := seconds;
T.start;
@@ -91,7 +124,8 @@
f_sleep(5.0);
for (i := 0; i < NUM_BTS; i := i+1) {
- f_ipa_rsl_start(bts[i], mp_bsc_ip, mp_bsc_rsl_port, i);
+ f_ipa_rsl_start(bts[i].rsl, mp_bsc_ip, mp_bsc_rsl_port, i);
+ f_ipa_ctrl_start(bts[i].ctrl, mp_bsc_ip, mp_bsc_ctrl_port, i);
}
f_sleep(0.5);
@@ -201,9 +235,18 @@
setverdict(pass);
}
+testcase TC_ctrl() runs on test_CT {
+
+ f_init();
+ f_bssap_reset();
+
+ f_ctrl_get(IPA_CTRL[0], "bts.0.location-area-code");
+}
+
control {
+ execute( TC_ctrl() );
execute( TC_chan_act_noreply() );
execute( TC_chan_act_ack_noest() );
execute( TC_chan_act_ack_est_ind_noreply() );
diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh
index a4cb266..e6c1b44 100755
--- a/bsc/gen_links.sh
+++ b/bsc/gen_links.sh
@@ -76,5 +76,5 @@
gen_links $DIR $FILES
DIR=../library
-FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn"
+FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn"
gen_links $DIR $FILES