[MERGED] osmo-ttcn3-hacks[master]: sgsn: Introduce global guard timer

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Feb 18 09:54:35 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: sgsn: Introduce global guard timer
......................................................................


sgsn: Introduce global guard timer

Change-Id: I0c1fd2a38a4f412079b5f28302b15124d9fd3b3d
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 17 insertions(+), 3 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 bb97a68..a326a83 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -43,6 +43,7 @@
 
 type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr {
 	var BSSGP_ConnHdlrPars g_pars;
+	timer g_Tguard;
 }
 
 type record SGSN_ConnHdlrNetworkPars {
@@ -65,7 +66,8 @@
 	RoutingAreaIdentificationV ra optional,
 	BssgpCellId bssgp_cell_id,
 	AuthVector vec optional,
-	SGSN_ConnHdlrNetworkPars net
+	SGSN_ConnHdlrNetworkPars net,
+	float t_guard
 };
 
 
@@ -136,7 +138,8 @@
 type function void_fn(charstring id) runs on BSSGP_ConnHdlr;
 
 /* helper function to create, connect and start a BSSGP_ConnHdlr component */
-function f_start_handler(void_fn fn, charstring id, GbInstance gb, integer imsi_suffix)
+function f_start_handler(void_fn fn, charstring id, GbInstance gb, integer imsi_suffix,
+			 float t_guard := 30.0)
 runs on test_CT return BSSGP_ConnHdlr {
 	var BSSGP_ConnHdlr vc_conn;
 	var SGSN_ConnHdlrNetworkPars net_pars := {
@@ -153,7 +156,8 @@
 		ra := omit,
 		bssgp_cell_id := gb.cfg.cell_id,
 		vec := omit,
-		net := net_pars
+		net := net_pars,
+		t_guard := t_guard
 	};
 
 	vc_conn := BSSGP_ConnHdlr.create(id);
@@ -167,6 +171,13 @@
 	return vc_conn;
 }
 
+private altstep as_Tguard() runs on BSSGP_ConnHdlr {
+	[] g_Tguard.timeout {
+		setverdict(fail, "Tguard timeout");
+		self.stop;
+	}
+}
+
 /* first function called in every ConnHdlr */
 private function f_handler_init(void_fn fn, charstring id, BSSGP_ConnHdlrPars pars)
 runs on BSSGP_ConnHdlr {
@@ -178,6 +189,9 @@
 	/* tell GSUP dispatcher to send this IMSI to us */
 	f_create_gsup_expect(hex2str(g_pars.imsi));
 
+	g_Tguard.start(pars.t_guard);
+	activate(as_Tguard());
+
 	/* call the user-supplied test case function */
 	fn.apply(id);
 	f_bssgp_client_unregister(g_pars.imsi);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c1fd2a38a4f412079b5f28302b15124d9fd3b3d
Gerrit-PatchSet: 2
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