aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-01-09 23:48:25 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-12 05:26:30 +0100
commit090dd141cb88607213068853592594ce2c6f8e1a (patch)
treec18dc54a137d46946b0738b81825990c83a8fd06 /tests
parenta642c872e4c05dc3d20a72a9f2656ba1b09a0ade (diff)
associate conn with bsc subscriber where possible (TODO)neels/ho_with_on_change_cb
Various logging in the code (e.g. handover) attempts to log the subscriber information from conn->bsub, but so far, the only time we set conn->bsub is during paging. We do though get IMSI and/or TMSI information from Layer 3 Complete messaging, not only from the Paging Request, which is already used for IMSI filtering. Also extract TMSI and create a conn->bsub subscriber. <-- TODO Make sure conn->bsub also gets cleaned up by bsc_subscr_put() when the conn is freed. Change-Id: Icc20c141ec339385181949b93548a73121bb7615
Diffstat (limited to 'tests')
-rw-r--r--tests/handover/handover_test.c8
-rw-r--r--tests/subscr/bsc_subscr_test.err3
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index f7b408be6..fedaf7d9b 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -186,7 +186,15 @@ static struct gsm_bts *create_bts(int arfcn)
void create_conn(struct gsm_lchan *lchan)
{
+ static unsigned int next_imsi = 0;
+ struct gsm_network *net = lchan->ts->trx->bts->network;
+ char imsi[sizeof(lchan->conn->bsub->imsi)];
+
+ next_imsi ++;
+ snprintf(imsi, sizeof(imsi), "%06u", next_imsi);
+
lchan->conn = bsc_subscr_con_allocate(lchan);
+ lchan->conn->bsub = bsc_subscr_find_or_create_by_imsi(net->bsc_subscribers, imsi);
}
/* create lchan */
diff --git a/tests/subscr/bsc_subscr_test.err b/tests/subscr/bsc_subscr_test.err
index a66317a36..afc8bf778 100644
--- a/tests/subscr/bsc_subscr_test.err
+++ b/tests/subscr/bsc_subscr_test.err
@@ -1,5 +1,8 @@
+DREF BSC subscr IMSI:1234567890 usage increases to: 1
DREF BSC subscr IMSI:1234567890 usage increases to: 2
DREF BSC subscr IMSI:1234567890 usage decreases to: 1
+DREF BSC subscr IMSI:9876543210 usage increases to: 1
+DREF BSC subscr IMSI:5656565656 usage increases to: 1
DREF BSC subscr IMSI:1234567890 usage increases to: 2
DREF BSC subscr IMSI:1234567890 usage decreases to: 1
DREF BSC subscr IMSI:9876543210 usage increases to: 2