summaryrefslogtreecommitdiffstats
path: root/ggsn_tests
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-13 13:28:10 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-13 13:28:10 +0200
commit0be142b7bf86c412cfbf4b10383ccd9c231272fd (patch)
tree29bbd255a84a48de1eb9a2d965121042342f7da2 /ggsn_tests
parent5438b9dc27f9cdd14873b7392b1d0d3b7b5c7d6f (diff)
GGSN_Tests: Make sure f_init() body is traversed only once
We don't want the sequence numbers to be random-reinitialized on every test case, but only once.
Diffstat (limited to 'ggsn_tests')
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn7
1 files changed, 7 insertions, 0 deletions
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 9408121..2066e0d 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -40,6 +40,8 @@ module GGSN_Tests {
port GTPC_PT GTPC;
port GTPU_PT GTPU;
+ var boolean g_initialized := false;
+
var OCT1 g_restart_ctr := '01'O;
/* FIXME: unify with g_bind_ip + parse from config file */
var OCT4 g_sgsn_ip_c := '7f172a01'O;
@@ -56,6 +58,11 @@ module GGSN_Tests {
}
function f_init() runs on GT_CT {
+ if (g_initialized == true) {
+ return;
+ }
+ g_initialized := true;
+
var Result res;
map(self:GTPC, system:GTPC);
res := GTP_CodecPort_CtrlFunct.f_IPL4_listen(GTPC, g_bind_ip_c, GTP1C_PORT, {udp:={}});