gbproxy: Introduce global guard timer in test_CT
We did have a guard time in each ConnHdlr, but not in the MTC (test_CT).
However, we do have tests that don't use any ConnHdlr, and those were so
far ran without a guard timeout. Fix that.
Change-Id: Iee90fc26a151c692d3c6f3eb6ad80f528f8d939f
diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index a2055ea..7811a01 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -279,6 +279,7 @@
var boolean g_use_echo := false;
var ro_integer g_roi := {};
+ timer g_Tguard;
};
type component BSSGP_ConnHdlr {
@@ -414,7 +415,7 @@
return false;
}
-function f_init() runs on test_CT {
+function f_init(float t_guard := 30.0) runs on test_CT {
var ro_integer bvci_unblocked := {};
var BssgpStatusIndication bsi;
var integer i;
@@ -424,6 +425,9 @@
}
g_initialized := true;
+ g_Tguard.start(t_guard);
+ activate(as_gTguard(g_Tguard));
+
g_sgsn[0].cfg := {
nsei := mp_nsconfig_sgsn[0].nsei,
sgsn_role := true,
@@ -503,6 +507,9 @@
mtc.stop;
}
}
+
+ /* re-start guard timer after all BVCs are up, so it only counts the actual test case */
+ g_Tguard.start(t_guard);
}
function f_cleanup() runs on test_CT {
@@ -574,8 +581,8 @@
sgsn_ct[port_idx] := bvc_ct;
}
-private altstep as_Tguard() runs on BSSGP_ConnHdlr {
- [] g_Tguard.timeout {
+private altstep as_gTguard(timer Tguard) {
+ [] Tguard.timeout {
setverdict(fail, "Tguard timeout");
mtc.stop;
}
@@ -601,7 +608,7 @@
}
g_Tguard.start(pars.t_guard);
- activate(as_Tguard());
+ activate(as_gTguard(g_Tguard));
/* call the user-supplied test case function */
fn.apply(id);