From 62e2958e49d8b7c301749f46a04eee22439af1ba Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 16 Feb 2018 21:17:11 +0100 Subject: sgsn: Introduce global guard timer Change-Id: I0c1fd2a38a4f412079b5f28302b15124d9fd3b3d --- sgsn/SGSN_Tests.ttcn | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'sgsn') diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index bb97a684..a326a834 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); -- cgit v1.2.3