Change in osmo-ttcn3-hacks[master]: SGSN_Tests: Make more helper functions gb_index aware

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri May 10 22:38:18 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13859 )

Change subject: SGSN_Tests: Make more helper functions gb_index aware
......................................................................

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
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 32 insertions(+), 23 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
 	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 @@
 	}
 
 	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 @@
 						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 @@
 	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 @@
 	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 @@
 }
 
 /* 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));

-- 
To view, visit https://gerrit.osmocom.org/13859
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3825634f581897f6951d9673984f138e977cc7ac
Gerrit-Change-Number: 13859
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190510/bd0672db/attachment.html>


More information about the gerrit-log mailing list