gbproxy: Allow creating ConnHdlr without a P-TMSI
This will be useful for testing paging cases where no P-TMSI is allocated.
Change-Id: Icd780c750c77e723e545ed5a5b52ef26e442b4f2
diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 6141f6a..f1e8749 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -1,6 +1,7 @@
module GBProxy_Tests {
/* Osmocom GBProxy test suite in TTCN-3
+ * (C) 2020-2021 Harald Welte <laforge@osmocom.org>
* (C) 2020 sysmocom - s.f.m.c. GmbH
* All rights reserved.
*
@@ -601,8 +602,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, integer imsi_suffix,
- float t_guard := 30.0, integer sgsn_idx := 0, integer nri_idx := 0)
+function f_start_handler(void_fn fn, charstring id, integer imsi_suffix, float t_guard := 30.0,
+ integer sgsn_idx := 0, integer nri_idx := 0, boolean have_ptmsi := true)
runs on test_CT return BSSGP_ConnHdlr {
var BSSGP_ConnHdlr vc_conn;
var integer nri := mp_sgsn_nri[sgsn_idx][nri_idx];
@@ -622,6 +623,9 @@
sgsn_idx := sgsn_idx,
t_guard := t_guard
};
+ if (not have_ptmsi) {
+ pars.p_tmsi := omit;
+ }
vc_conn := BSSGP_ConnHdlr.create(id);
@@ -629,7 +633,8 @@
return vc_conn;
}
-function f_start_handlers(void_fn fn, charstring id, integer imsi_suffix, float t_guard := 30.0)
+function f_start_handlers(void_fn fn, charstring id, integer imsi_suffix, float t_guard := 30.0,
+ boolean have_ptmsi := true)
runs on test_CT
{
var integer sgsn_idx, nri_idx;
@@ -637,8 +642,8 @@
for (nri_idx := 0; nri_idx < lengthof(mp_sgsn_nri[sgsn_idx]); nri_idx:=nri_idx+1) {
var integer extd_imsi_suffix := 1000*sgsn_idx + 100*nri_idx;
var BSSGP_ConnHdlr vc_conn;
- vc_conn := f_start_handler(fn, id, extd_imsi_suffix, t_guard,
- sgsn_idx, nri_idx);
+ vc_conn := f_start_handler(fn, id, extd_imsi_suffix, t_guard, sgsn_idx, nri_idx,
+ have_ptmsi);
/* Idea: we could also run them in parallel ? */
vc_conn.done;
}