summaryrefslogtreecommitdiffstats
path: root/sgsn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-16 21:17:11 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-18 10:18:14 +0100
commit62e2958e49d8b7c301749f46a04eee22439af1ba (patch)
tree3551c17605e691a67e9295c8f4cf37cadb9e6234 /sgsn
parent5a4fa04ec4a31dfa42778d638662d3fbc8b3f2e1 (diff)
sgsn: Introduce global guard timer
Diffstat (limited to 'sgsn')
-rw-r--r--sgsn/SGSN_Tests.ttcn20
1 files changed, 17 insertions, 3 deletions
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 test_CT {
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 @@ type record BSSGP_ConnHdlrPars {
RoutingAreaIdentificationV ra optional,
BssgpCellId bssgp_cell_id,
AuthVector vec optional,
- SGSN_ConnHdlrNetworkPars net
+ SGSN_ConnHdlrNetworkPars net,
+ float t_guard
};
@@ -136,7 +138,8 @@ function f_init() runs on test_CT {
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 @@ runs on test_CT return BSSGP_ConnHdlr {
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 @@ runs on test_CT return BSSGP_ConnHdlr {
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 @@ runs on BSSGP_ConnHdlr {
/* 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);