This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/6035
MSC_Tests: Proper treatment of IMEI + TMSI
* don't use IMSI as IMEI
* store the TMSI (after it is allocated) in the g_pars variable for later use
Change-Id: I717f1c9ab21e5be8b88f10ce4e8c583b385f3664
---
M msc_tests/BSC_ConnectionHandler.ttcn
M msc_tests/MSC_Tests.ttcn
2 files changed, 14 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/35/6035/1
diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn
index 69854e3..25f8daf 100644
--- a/msc_tests/BSC_ConnectionHandler.ttcn
+++ b/msc_tests/BSC_ConnectionHandler.ttcn
@@ -28,8 +28,10 @@
SCCP_PAR_Address sccp_addr_own,
SCCP_PAR_Address sccp_addr_peer,
BSSMAP_IE_CellIdentifier cell_id,
+ hexstring imei,
hexstring imsi,
hexstring msisdn,
+ OCT4 tmsi optional,
BSSMAP_IE_ClassmarkInformationType2 cm2,
BSSMAP_IE_ClassmarkInformationType3 cm3 optional
};
@@ -199,6 +201,7 @@
setverdict(fail, "Expected TMSI but no TMSI was allocated");
self.stop;
} else {
+ g_pars.tmsi := lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets;
BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl));
}
} else {
diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn
index 4bacc1d..959cd37 100644
--- a/msc_tests/MSC_Tests.ttcn
+++ b/msc_tests/MSC_Tests.ttcn
@@ -290,6 +290,12 @@
type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr;
+function f_gen_imei(hexstring prefix, integer suffix) return hexstring {
+ var integer suffix_len := 15 - lengthof(prefix);
+ suffix_len := suffix_len;
+ return prefix & int2hex(suffix, suffix_len);
+}
+
function f_gen_imsi(hexstring prefix, integer suffix) return hexstring {
var integer suffix_len := 15 - lengthof(prefix);
suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */
@@ -308,8 +314,10 @@
sccp_addr_own := g_sccp_addr_own,
sccp_addr_peer := g_sccp_addr_peer,
cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)),
+ imei := f_gen_imei('49999'H, imsi_suffix),
imsi := f_gen_imsi('26242'H, imsi_suffix),
msisdn := f_gen_msisdn('491239999'H, imsi_suffix),
+ tmsi := omit,
cm2 := valueof(ts_CM2_default),
cm3 := omit
};
@@ -654,7 +662,7 @@
private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
g_pars := pars;
- var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imsi)
+ var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imei)
var PDU_DTAP_MT dtap_mt;
/* tell GSUP dispatcher to send this IMSI to us */
@@ -788,7 +796,7 @@
private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
g_pars := pars;
- var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi));
+ var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
/* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */
f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi)));
@@ -860,7 +868,7 @@
private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
g_pars := pars;
- var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi));
+ var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi));
f_bssap_compl_l3(l3_info);
BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O)));
--
To view, visit https://gerrit.osmocom.org/6035
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I717f1c9ab21e5be8b88f10ce4e8c583b385f3664
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>