diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-05-24 18:43:58 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-06-08 16:16:42 +0000 |
commit | bb6c13b862c27b5953cb277e948ea0168bb0b968 (patch) | |
tree | 1d29f4332d898e504e70204fd291b3bcaab61f8d | |
parent | 7c68e9048f1e6d12faad9f79a61bbeaa07907924 (diff) |
cosmetic: handover_test: add IMSI to subscr for logging
Change-Id: I52fa8f3183c93ed362d8252d20daf00c60a117c8
-rw-r--r-- | tests/handover/handover_test.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 87e64ecb8..769fd069e 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -239,8 +239,12 @@ static struct gsm_bts *create_bts(int arfcn) void create_conn(struct gsm_lchan *lchan) { + static unsigned int next_imsi = 0; + char imsi[sizeof(lchan->conn->bsub->imsi)]; + struct gsm_network *net = lchan->ts->trx->bts->network; struct gsm_subscriber_connection *conn; - conn = bsc_subscr_con_allocate(lchan->ts->trx->bts->network); + + conn = bsc_subscr_con_allocate(net); /* CAUTION HACK: When __real_mgcp_conn_modify() is called by the GSCON * FSM, then we need to know the reference to caller FSM (GSCON FSM). @@ -254,6 +258,12 @@ void create_conn(struct gsm_lchan *lchan) lchan->conn = conn; conn->lchan = lchan; + + /* Make up a new IMSI for this test, for logging the subscriber */ + next_imsi ++; + snprintf(imsi, sizeof(imsi), "%06u", next_imsi); + lchan->conn->bsub = bsc_subscr_find_or_create_by_imsi(net->bsc_subscribers, imsi); + /* kick the FSM from INIT through to the ACTIVE state */ osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_A_CONN_REQ, NULL); osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_A_CONN_CFM, NULL); |