aboutsummaryrefslogtreecommitdiffstats
path: root/mme/MME_Tests.ttcn
diff options
context:
space:
mode:
Diffstat (limited to 'mme/MME_Tests.ttcn')
-rw-r--r--mme/MME_Tests.ttcn46
1 files changed, 41 insertions, 5 deletions
diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn
index cc753777..55cb021a 100644
--- a/mme/MME_Tests.ttcn
+++ b/mme/MME_Tests.ttcn
@@ -44,6 +44,10 @@ import from DNS_Helpers all;
import from Osmocom_Types all;
import from Osmocom_Gb_Types all;
+import from GTPv2_Types all;
+import from GTPv2_Templates all;
+import from GTPv2_Emulation all;
+
friend module MME_Tests_SGsAP;
/* (maximum) number of emulated eNBs */
@@ -84,6 +88,10 @@ type component MTC_CT {
/* Gn interface (GTPv1C) of emulated SGSN (Rel. 7) */
var GTP_Emulation_CT vc_GTP;
+ /* S11 interface (GTPv2C) of emulated SGW-C */
+ var GTPv2_Emulation_CT vc_GTP2;
+ port GTP2EM_PT TEID0;
+
var UeParams g_ue_pars[NUM_UE];
}
@@ -116,7 +124,7 @@ private function enc_S1AP_Global_ENB_ID(Global_ENB_ID global_enb_id) return octe
return substr(encoded, 11, global_enb_id_len);
}
-type component ConnHdlr extends S1AP_ConnHdlr, SGsAP_ConnHdlr, DIAMETER_ConnHdlr, GTP_ConnHdlr {
+type component ConnHdlr extends S1AP_ConnHdlr, SGsAP_ConnHdlr, DIAMETER_ConnHdlr, GTP_ConnHdlr, GTP2_ConnHdlr {
var ConnHdlrPars g_pars;
timer g_Tguard := 30.0;
@@ -153,6 +161,12 @@ modulepar {
charstring mp_gn_local_ip := "127.0.0.22";
integer mp_gn_local_port := 2123;
charstring mp_gn_remote_ip := "127.0.0.2";
+
+ /* S11 interface (GTPv2C, interface between MME and SGW) */
+ charstring mp_s11_local_ip := "127.0.0.3";
+ integer mp_s11_local_port := 2123;
+ charstring mp_s11_remote_ip := "127.0.0.2";
+ integer mp_s11_remote_port := 2123;
}
/* send incoming unit data messages (like reset) to global SGsAP_UNIT port */
@@ -290,7 +304,25 @@ friend function f_init_gtp(charstring id) runs on MTC_CT {
vc_GTP.start(GTP_Emulation.main(gtp_cfg));
}
-friend template (value) TAI ts_enb_S1AP_TAI(EnbParams enb) := {
+friend function f_init_gtpv2_s11(charstring id) runs on MTC_CT {
+ id := id & "-GTPV2";
+
+ var Gtp2EmulationCfg cfg := {
+ gtpc_bind_ip := mp_s11_local_ip,
+ gtpc_bind_port := mp_s11_local_port,
+ gtpc_remote_ip := mp_s11_remote_ip,
+ gtpc_remote_port := mp_s11_remote_port,
+ sgw_role := true,
+ use_gtpu_daemon := false
+ };
+
+ vc_GTP2 := GTPv2_Emulation_CT.create(id);
+ map(vc_GTP2:GTP2C, system:GTP2C);
+ connect(vc_GTP2:TEID0, self:TEID0);
+ vc_GTP2.start(GTPv2_Emulation.main(cfg));
+}
+
+friend template (value) S1AP_IEs.TAI ts_enb_S1AP_TAI(EnbParams enb) := {
pLMNidentity := enb.global_enb_id.pLMNidentity,
tAC := enb.supported_tas[0].tAC,
iE_Extensions := omit
@@ -339,6 +371,10 @@ runs on MTC_CT return ConnHdlr {
connect(vc_conn:GTP, vc_GTP:CLIENT);
connect(vc_conn:GTP_PROC, vc_GTP:CLIENT_PROC);
}
+ if (isbound(vc_GTP2)) {
+ connect(vc_conn:GTP2, vc_GTP2:CLIENT);
+ connect(vc_conn:GTP2_PROC, vc_GTP2:CLIENT_PROC);
+ }
/* We cannot use vc_conn.start(f_init_handler(fn, id, pars)); as we cannot have
* a stand-alone 'derefers()' call, see https://www.eclipse.org/forums/index.php/t/1091364/ */
@@ -371,8 +407,8 @@ friend function f_init_handler(ConnHdlrPars pars, float t_guard := 30.0) runs on
-friend function f_s1ap_setup(integer idx := 0, template Cause cause := omit) runs on MTC_CT {
- var template (present) Cause exp_cause;
+friend function f_s1ap_setup(integer idx := 0, template S1AP_IEs.Cause cause := omit) runs on MTC_CT {
+ var template (present) S1AP_IEs.Cause exp_cause;
var boolean exp_fail := false;
timer T := 5.0;
if (not istemplatekind(cause, "omit")) {
@@ -911,7 +947,7 @@ testcase TC_s1ap_reset() runs on MTC_CT {
f_init_s1ap(id, 3);
f_s1ap_setup(0);
- var template (value) Cause reset_cause := {misc := om_intervention};
+ var template (value) S1AP_IEs.Cause reset_cause := {misc := om_intervention};
var template (value) ResetType reset_type := {s1_Interface := reset_all};
timer T := 5.0;