summaryrefslogtreecommitdiffstats
path: root/sgsn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-02 20:37:23 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-10 22:38:17 +0000
commitf7191679aafe7dc694874256072a58f31852c53c (patch)
tree9770e7e39cd09fa5f0cc99b6a50a2bf767590266 /sgsn
parentca36246737cdeaee55b6d53ba9a3f63df0b3070b (diff)
SGSN_Tests: Make more helper functions gb_index aware
The gb_index indicates through which Gb link (simulated RAN/PCU) a given message shall be sent. Change-Id: I3825634f581897f6951d9673984f138e977cc7ac
Diffstat (limited to 'sgsn')
-rw-r--r--sgsn/SGSN_Tests.ttcn55
1 files changed, 32 insertions, 23 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index c34cf59..d87c09d 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1013,7 +1013,8 @@ private function f_process_gtp_ctx_act_req(inout PdpActPars apars, PDU_GTPC gtpc
f_gtp_register_teid(apars.ggsn_tei_u);
}
-function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false) runs on BSSGP_ConnHdlr {
+function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false, integer gb_idx := 0)
+runs on BSSGP_ConnHdlr {
var boolean exp_rej := ispresent(apars.exp_rej_cause);
var Gtp1cUnitdata g_ud;
var template Recovery_gtpc recovery := omit;
@@ -1023,7 +1024,7 @@ function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false) r
}
f_send_l3_gmm_llc(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
- apars.apn, apars.pco));
+ apars.apn, apars.pco), gb_idx);
GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud {
f_process_gtp_ctx_act_req(apars, g_ud.gtpc);
var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber);
@@ -1035,48 +1036,54 @@ function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false) r
omit, recovery));
}
alt {
- [exp_rej] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) {
+ [exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) {
setverdict(pass);
}
- [exp_rej] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) {
+ [exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) {
setverdict(fail, "Unexpected PDP CTX ACT ACC");
mtc.stop;
}
- [not exp_rej] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) {
+ [not exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) {
setverdict(fail, "Unexpected PDP CTX ACT FAIL");
mtc.stop;
}
- [not exp_rej] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) {
+ [not exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) {
+ setverdict(fail, "Unexpected PDP CTX ACT FAIL");
+ mtc.stop;
+ }
+ [not exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) {
setverdict(pass);
}
- [] as_xid(apars);
+ [] as_xid(apars, gb_idx);
}
}
-function f_pdp_ctx_deact_mo(inout PdpActPars apars, OCT1 cause) runs on BSSGP_ConnHdlr {
+function f_pdp_ctx_deact_mo(inout PdpActPars apars, OCT1 cause, integer gb_idx := 0)
+runs on BSSGP_ConnHdlr {
var boolean exp_rej := ispresent(apars.exp_rej_cause);
var Gtp1cUnitdata g_ud;
- f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit));
+ f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit), gb_idx);
GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud {
var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber);
- BSSGP[0].clear;
+ BSSGP[gb_idx].clear;
GTP.send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O));
}
alt {
- [] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid))) {
+ [] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid))) {
setverdict(pass);
}
- [] as_xid(apars);
+ [] as_xid(apars, gb_idx);
}
}
-function f_pdp_ctx_deact_mt(inout PdpActPars apars, boolean error_ind := false) runs on BSSGP_ConnHdlr {
+function f_pdp_ctx_deact_mt(inout PdpActPars apars, boolean error_ind := false, integer gb_idx := 0)
+runs on BSSGP_ConnHdlr {
var Gtp1cUnitdata g_ud;
var integer seq_nr := 23;
var GtpPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c));
- BSSGP[0].clear;
+ BSSGP[gb_idx].clear;
if (error_ind) {
GTP.send(ts_GTPU_ErrorIndication(peer, 0 /* seq */, apars.ggsn_tei_u, apars.ggsn_ip_u));
} else {
@@ -1087,8 +1094,8 @@ function f_pdp_ctx_deact_mt(inout PdpActPars apars, boolean error_ind := false)
T.start;
alt {
- [] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {
- f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
+ [] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {
+ f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), gb_idx);
}
[not error_ind] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {
repeat;
@@ -1191,8 +1198,8 @@ private function f_gtpu_send(inout PdpActPars apars, octetstring payload) runs o
GTP.send(ts_GTP1U_GPDU(peer, 0 /*seq*/, apars.sgsn_tei_u, payload));
}
-private altstep as_xid(PdpActPars apars) runs on BSSGP_ConnHdlr {
- [] BSSGP[0].receive(tr_BD_LLC(tr_LLC_XID_MT_CMD(?, apars.sapi))) {
+private altstep as_xid(PdpActPars apars, integer gb_idx := 0) runs on BSSGP_ConnHdlr {
+ [] BSSGP[gb_idx].receive(tr_BD_LLC(tr_LLC_XID_MT_CMD(?, apars.sapi))) {
repeat;
}
}
@@ -1231,22 +1238,24 @@ template (value) PDU_SN ts_SN_UD(BIT4 nsapi, octetstring payload) := {
}
/* Transceive given 'payload' as MT message from GTP -> OsmoSGSN -> Gb */
-private function f_gtpu_xceive_mt(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr {
+private function f_gtpu_xceive_mt(inout PdpActPars apars, octetstring payload, integer gb_idx := 0)
+runs on BSSGP_ConnHdlr {
/* Send PDU via GTP from our simulated GGSN to the SGSN */
f_gtpu_send(apars, payload);
/* Expect PDU via BSSGP/LLC on simulated PCU from SGSN */
alt {
- [] as_xid(apars);
- [] BSSGP[0].receive(tr_BD_SNDCP(apars.sapi, tr_SN_UD(apars.nsapi, payload)));
+ [] as_xid(apars, gb_idx);
+ [] BSSGP[gb_idx].receive(tr_BD_SNDCP(apars.sapi, tr_SN_UD(apars.nsapi, payload)));
}
}
/* Transceive given 'payload' as MT message from Gb -> OsmoSGSN -> GTP */
-private function f_gtpu_xceive_mo(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr {
+private function f_gtpu_xceive_mo(inout PdpActPars apars, octetstring payload, integer gb_idx := 0)
+runs on BSSGP_ConnHdlr {
/* Send PDU via SNDCP/LLC/BSSGP/NS via simulated MS/PCU to the SGSN */
var GtpPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u));
var PDU_SN sndcp := valueof(ts_SN_UD(apars.nsapi, payload));
- BSSGP[0].send(ts_LLC_UI(enc_PDU_SN(sndcp), apars.sapi, '0'B, 0));
+ BSSGP[gb_idx].send(ts_LLC_UI(enc_PDU_SN(sndcp), apars.sapi, '0'B, 0));
/* Expect PDU via GTP from SGSN on simulated GGSN */
alt {
[] GTP.receive(tr_GTPU_GPDU(peer, apars.ggsn_tei_u, payload));