[MERGED] osmo-ttcn3-hacks[master]: Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Feb 18 21:36:42 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP DEACT
......................................................................


Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP DEACT

Change-Id: I7eb653694f487f8bbf122146300c93be625b0f87
Related: OS#2961
---
M library/GTP_Templates.ttcn
M library/L3_Templates.ttcn
M sgsn/SGSN_Tests.ttcn
3 files changed, 155 insertions(+), 6 deletions(-)

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



diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn
index ef7e97b..44d9682 100644
--- a/library/GTP_Templates.ttcn
+++ b/library/GTP_Templates.ttcn
@@ -456,12 +456,10 @@
 		ts_IPCP(LCP_Configure_Request, identifier,
 			{ tr_IPCP_PrimaryDns('00000000'O), tr_IPCP_SecondaryDns('00000000'O) });
 
-	function f_teardown_ind_IE(in template BIT1 ind) return template TearDownInd {
-/*
-		if (not isvalue(ind)) {
+	function f_teardown_ind_IE(in template (omit) BIT1 ind) return template (omit) TearDownInd {
+		if (istemplatekind(ind, "omit")) {
 			return omit;
 		}
-*/
 		var TearDownInd ret := {
 			type_gtpc := '13'O,
 			tdInd := valueof(ind),
@@ -470,7 +468,7 @@
 		return ret;
 	}
 
-	template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template BIT1 teardown_ind) := {
+	template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := {
 		deletePDPContextRequest := {
 			cause := omit,
 			tearDownIndicator := f_teardown_ind_IE(teardown_ind),
@@ -489,7 +487,7 @@
 	}
 
 	template Gtp1cUnitdata ts_GTPC_DeletePDP(GtpPeer peer, uint16_t seq, OCT4 teid,
-						 BIT4 nsapi, template BIT1 teardown_ind) := {
+						 BIT4 nsapi, template (omit) BIT1 teardown_ind) := {
 		peer := peer,
 		gtpc := ts_GTP1C_PDU(deletePDPContextRequest, teid,
 					valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq)
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index e1947b2..d3e021d 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -1937,6 +1937,74 @@
 	}
 }
 
+template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, boolean tdown := false,
+						  template (omit) ProtocolConfigOptionsV pco := omit
+						) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+		transactionId := {
+			tio := tid,
+			tiFlag := '1'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		gprs_sm := {
+			deactivatePDPContextRequest := {
+				messageType := '00000000'B, /* overwritten */
+				smCause := cause,
+				tearDownIndicator := {
+					tearDownIndicatorV := {
+						tdi_flag := bool2bit(tdown),
+						spare := '000'B
+					},
+					elementIdentifier := '1001'B
+				},
+				protocolConfigOpts := ts_PcoTLV(pco),
+				mBMSprotocolConfigOptions := omit,
+				t3396 := omit,
+				wLANOffloadIndication := omit,
+				nBIFOM_Container := omit
+			}
+		}
+	}
+}
+
+template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause,
+						template boolean tdown := false,
+						  template (omit) ProtocolConfigOptionsV pco := omit
+						) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+		transactionId := {
+			tio := tid,
+			tiFlag := '1'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		gprs_sm := {
+			deactivatePDPContextRequest := {
+				messageType := '00000000'B, /* overwritten */
+				smCause := cause,
+				tearDownIndicator := {
+					tearDownIndicatorV := {
+						tdi_flag := bool2bit_tmpl(tdown),
+						spare := '000'B
+					},
+					elementIdentifier := '1001'B
+				},
+				protocolConfigOpts := *,
+				mBMSprotocolConfigOptions := *,
+				t3396 := *,
+				wLANOffloadIndication := *,
+				nBIFOM_Container := *
+			}
+		}
+	}
+}
+
+
 template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?)
 := {
 	discriminator := '1010'B,
@@ -1959,6 +2027,50 @@
 	}
 }
 
+template PDU_L3_MS_SGSN tr_SM_DEACT_PDP_ACCEPT_MO(template BIT3 tid := ?)
+:= {
+	discriminator := '1010'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := tid,
+			tiFlag := '0'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		gprs_sm := {
+			deactivatePDPContextAccept := {
+				messageType := '01000111'B,
+				protocolConfigOpts := *,
+				mBMSprotocolConfigOptions := *,
+				nBIFOM_Container := *
+			}
+		}
+	}
+}
+
+template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_ACCEPT_MO(BIT3 tid)
+:= {
+	discriminator := '1010'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := tid,
+			tiFlag := '0'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		gprs_sm := {
+			deactivatePDPContextAccept := {
+				messageType := '01000111'B,
+				protocolConfigOpts := omit,
+				mBMSprotocolConfigOptions := omit,
+				nBIFOM_Container := omit
+			}
+		}
+	}
+}
+
 
 
 private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring {
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 06ed56b..a853c6d 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -842,6 +842,22 @@
 	}
 }
 
+function f_pdp_ctx_deact_mt(inout PdpActPars apars, OCT1 cause) runs on BSSGP_ConnHdlr {
+	var Gtp1cUnitdata g_ud;
+	var integer seq_nr := 23;
+	var GtpPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c));
+
+	BSSGP.clear;
+	GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, omit));
+
+	interleave {
+	[] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?))) {
+		BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
+		}
+	[] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { }
+	}
+}
+
 
 /* Table 10.5.156/3GPP TS 24.008 */
 template (value) QoSV t_QosDefault := {
@@ -1095,6 +1111,28 @@
 	vc_conn.done;
 }
 
+/* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction */
+private function f_TC_attach_pdp_act_user_deact_mt(charstring id) runs on BSSGP_ConnHdlr {
+	var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
+
+	/* first perform regular attach */
+	f_TC_attach(id);
+	/* then activate PDP context */
+	f_pdp_ctx_act(apars);
+	/* then transceive a downlink PDU */
+	f_gtpu_xceive_mt(apars, f_rnd_octstring(100));
+	f_gtpu_xceive_mo(apars, f_rnd_octstring(200));
+
+	f_pdp_ctx_deact_mt(apars, '00'O);
+}
+testcase TC_attach_pdp_act_user_deact_mt() runs on test_CT {
+	var BSSGP_ConnHdlr vc_conn;
+	f_init();
+	vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_deact_mt), testcasename(), g_gb[0], 22);
+	vc_conn.done;
+}
+
+
 
 control {
 	execute( TC_attach() );
@@ -1117,6 +1155,7 @@
 	execute( TC_attach_pdp_act_user() );
 	execute( TC_attach_pdp_act_ggsn_reject() );
 	execute( TC_attach_pdp_act_user_deact_mo() );
+	execute( TC_attach_pdp_act_user_deact_mt() );
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/6587
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7eb653694f487f8bbf122146300c93be625b0f87
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list