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

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
Sat Feb 17 09:17:16 UTC 2018


Review at  https://gerrit.osmocom.org/6547

sgsn: Introduce global guard timer

Change-Id: I0c1fd2a38a4f412079b5f28302b15124d9fd3b3d
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 17 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/47/6547/1

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 47ec847..8beeb3b 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: newchange
Gerrit-Change-Id: I0c1fd2a38a4f412079b5f28302b15124d9fd3b3d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list