use osmo_init_logging2() with proper talloc ctx

Since the logging allocations now also show up in the root context report, some
tests need adjusted talloc checks.

In msc_vlr_tests, also output the number of talloc blocks before tests are
started to show that the number didn't change after the tests.

Change-Id: Iae07ae60230c7bab28e52b5df97fa3844778158e
This commit is contained in:
Neels Hofmeyr 2018-03-30 23:04:04 +02:00
parent 053e27528c
commit 08b3828995
17 changed files with 150 additions and 102 deletions

View File

@ -289,10 +289,11 @@ int main(int argc, char **argv)
unsigned long long i;
char *server_host = "127.0.0.1";
uint16_t server_port = OSMO_GSUP_PORT;
void *ctx = talloc_named_const(NULL, 0, "gsup_test_client");
osmo_init_logging(&gsup_test_client_log_info);
osmo_init_logging2(ctx, &gsup_test_client_log_info);
g_gc = gsup_client_create(NULL, "GSUPTEST", server_host, server_port,
g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port,
gsupc_read_cb, NULL);

View File

@ -531,7 +531,7 @@ int main(int argc, char **argv)
tall_call_ctx = talloc_named_const(tall_msc_ctx, 0, "gsm_call");
tall_trans_ctx = talloc_named_const(tall_msc_ctx, 0, "transaction");
osmo_init_logging(&log_info);
osmo_init_logging2(tall_msc_ctx, &log_info);
osmo_stats_init(tall_msc_ctx);
/* For --version, vty_init() must be called before handling options */

View File

@ -343,12 +343,13 @@ int main(int argc, char **argv)
char *host = "localhost";
int port = 0;
int rc;
void *ctx = talloc_named_const(NULL, 0, "smpp_mirror");
msgb_talloc_ctx_init(NULL, 0);
msgb_talloc_ctx_init(ctx, 0);
memset(&esme, 0, sizeof(esme));
osmo_init_logging(&log_info);
osmo_init_logging2(ctx, &log_info);
snprintf((char *) esme.system_id, sizeof(esme.system_id), "mirror");
snprintf((char *) esme.password, sizeof(esme.password), "mirror");

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_auth_use_twice_geran
- Location Update request causes a GSUP Send Auth Info request to HLR
MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@ -424,7 +427,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_auth_use_twice_geran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_auth_use_twice_utran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -884,7 +887,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_auth_use_twice_utran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_auth_use_infinitely_geran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1405,7 +1408,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_auth_use_infinitely_geran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_auth_use_infinitely_utran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1968,7 +1971,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_auth_use_infinitely_utran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_auth_reuse_geran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -2289,7 +2292,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_auth_reuse_geran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_auth_reuse_utran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -2632,8 +2635,8 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_auth_reuse_utran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_call_mo
- Total time passed: 0.000000 s
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -370,7 +373,7 @@ DREF freeing VLR subscr MSISDN:42342
===== test_call_mo: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_call_mt
- Total time passed: 0.000000 s
@ -752,7 +755,7 @@ DREF freeing VLR subscr MSISDN:42342
===== test_call_mt: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_call_mo_to_unknown
- Total time passed: 0.000000 s
@ -1088,7 +1091,7 @@ DREF freeing VLR subscr MSISDN:42342
===== test_call_mo_to_unknown: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_call_mo_to_unknown_timeout
- Total time passed: 0.000000 s
@ -1422,8 +1425,8 @@ DREF freeing VLR subscr MSISDN:42342
===== test_call_mo_to_unknown_timeout: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_gsm_authen
- Location Update request causes a GSUP Send Auth Info request to HLR
MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@ -445,7 +448,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_gsm_authen: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_gsm_authen_tmsi
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1098,7 +1101,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_gsm_authen_tmsi: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_gsm_authen_imei
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1318,7 +1321,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_gsm_authen_imei: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_gsm_authen_tmsi_imei
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1569,7 +1572,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_gsm_authen_tmsi_imei: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_gsm_milenage_authen
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1999,7 +2002,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_gsm_milenage_authen: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_wrong_sres_length
- Total time passed: 0.000000 s
@ -2113,8 +2116,8 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_wrong_sres_length: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_ciph
- Location Update request causes a GSUP Send Auth Info request to HLR
MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@ -493,7 +496,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_ciph: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_ciph_tmsi
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1027,7 +1030,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_ciph_tmsi: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_ciph_imei
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1251,7 +1254,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_ciph_imei: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_ciph_imeisv
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1464,7 +1467,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_ciph_imeisv: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_ciph_tmsi_imei
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1719,7 +1722,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_ciph_tmsi_imei: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_gsm_ciph_in_umts_env
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -2185,7 +2188,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_gsm_ciph_in_umts_env: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_a5_3_not_supported
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -2283,8 +2286,8 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_a5_3_not_supported: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_rej_auth_info_unknown_imsi
- Location Update request causes a GSUP Send Auth Info request to HLR
MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@ -72,7 +75,7 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_hlr_rej_auth_info_unknown_imsi: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_rej_auth_info_net_fail
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -148,7 +151,7 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_hlr_rej_auth_info_net_fail: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_rej_auth_info_net_fail_reuse_tuples
---
@ -451,7 +454,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_hlr_rej_auth_info_net_fail_reuse_tuples: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_rej_auth_info_net_fail_no_reuse_tuples
---
@ -679,7 +682,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_hlr_rej_auth_info_net_fail_no_reuse_tuples: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples
---
@ -908,7 +911,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_acc_but_no_auth_tuples
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -983,7 +986,7 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_hlr_acc_but_no_auth_tuples: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_rej_lu
- Location Update request causes a GSUP LU request to HLR
@ -1061,7 +1064,7 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_hlr_rej_lu: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_no_insert_data
- Location Update request causes a GSUP LU request to HLR
@ -1162,8 +1165,8 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_hlr_no_insert_data: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_timeout_lu_auth_info
- Total time passed: 0.000000 s
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -80,7 +83,7 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_hlr_timeout_lu_auth_info: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_hlr_timeout_lu_upd_loc_result
- Total time passed: 0.000000 s
@ -183,8 +186,8 @@ DREF freeing VLR subscr MSISDN:46071
===== test_hlr_timeout_lu_upd_loc_result: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_ms_timeout_lu_auth_resp
- Total time passed: 0.000000 s
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -100,7 +103,7 @@ DREF freeing VLR subscr IMSI:901700000004620
===== test_ms_timeout_lu_auth_resp: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_ms_timeout_cm_auth_resp
- Total time passed: 0.000000 s
@ -336,7 +339,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_ms_timeout_cm_auth_resp: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_ms_timeout_paging
- Total time passed: 0.000000 s
@ -519,8 +522,8 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_ms_timeout_paging: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_authen
- Location Update request causes a GSUP LU request to HLR
MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@ -321,7 +324,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_authen: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_authen_tmsi
- Location Update request causes a GSUP LU request to HLR
@ -833,7 +836,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_authen_tmsi: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_authen_imei
- Location Update request causes a GSUP LU request to HLR
@ -1006,7 +1009,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_authen_imei: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_authen_tmsi_imei
- Location Update request causes a GSUP LU request to HLR
@ -1204,7 +1207,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_authen_tmsi_imei: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_authen_imeisv
- Location Update request causes an IMEISV ID request back to the MS
@ -1362,7 +1365,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_authen_imeisv: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_authen_imeisv_imei
- Location Update request causes an IMEISV ID request back to the MS
@ -1552,7 +1555,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_authen_imeisv_imei: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_authen_imeisv_tmsi
- Location Update request causes an IMEISV ID request back to the MS
@ -1908,7 +1911,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_authen_imeisv_tmsi: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_no_authen_imeisv_tmsi_imei
- Location Update request causes an IMEISV ID request back to the MS
@ -2124,8 +2127,8 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_no_authen_imeisv_tmsi_imei: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_2nd_conn
- Location Update Request on one connection
MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@ -152,7 +155,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_2nd_conn: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_lu_during_lu
- Location Update Request
@ -277,7 +280,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_lu_during_lu: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_cm_during_lu
- Location Update Request
@ -408,7 +411,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_cm_during_lu: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_paging_resp_during_lu
- Location Update Request
@ -534,7 +537,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_paging_resp_during_lu: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_lu_during_cm
---
@ -727,7 +730,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_lu_during_cm: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_cm_during_cm
---
@ -922,7 +925,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_cm_during_cm: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_paging_resp_during_cm
---
@ -1123,7 +1126,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_paging_resp_during_cm: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_lu_during_paging_resp
---
@ -1351,7 +1354,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_lu_during_paging_resp: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_accept_cm_during_paging_resp
---
@ -1598,7 +1601,7 @@ DREF freeing VLR subscr MSISDN:46071
===== test_accept_cm_during_paging_resp: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_reject_paging_resp_during_paging_resp
---
@ -1825,8 +1828,8 @@ DREF freeing VLR subscr MSISDN:46071
===== test_reject_paging_resp_during_paging_resp: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_early_stage
- NULL conn
msc_subscr_conn_is_accepted() == false
@ -40,7 +43,7 @@ DMM Subscr_Conn(test){SUBSCR_CONN_S_RELEASED}: Deallocated
===== test_early_stage: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_cm_service_without_lu
- CM Service Request without a prior Location Updating
@ -83,7 +86,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_cm_service_without_lu: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_two_lu
- Location Update request causes a GSUP LU request to HLR
@ -340,7 +343,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_two_lu: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_lu_unknown_tmsi
- Location Update request with unknown TMSI sends ID Request for IMSI
@ -489,8 +492,8 @@ DREF freeing VLR subscr MSISDN:46071
===== test_lu_unknown_tmsi: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -1,3 +1,6 @@
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_geran
- Location Update request causes a GSUP Send Auth Info request to HLR
MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST
@ -459,7 +462,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_umts_authen_geran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_utran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -954,7 +957,7 @@ DRLL Freeing subscriber connection with NULL subscriber
===== test_umts_authen_utran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_resync_geran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1167,7 +1170,7 @@ DREF freeing VLR subscr MSISDN:42342
===== test_umts_authen_resync_geran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_resync_utran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1392,7 +1395,7 @@ DREF freeing VLR subscr MSISDN:42342
===== test_umts_authen_resync_utran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_too_short_res_geran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1486,7 +1489,7 @@ DREF freeing VLR subscr IMSI:901700000010650
===== test_umts_authen_too_short_res_geran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_too_short_res_utran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1580,7 +1583,7 @@ DREF freeing VLR subscr IMSI:901700000010650
===== test_umts_authen_too_short_res_utran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_too_long_res_geran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1674,7 +1677,7 @@ DREF freeing VLR subscr IMSI:901700000010650
===== test_umts_authen_too_long_res_geran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_too_long_res_utran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1768,7 +1771,7 @@ DREF freeing VLR subscr IMSI:901700000010650
===== test_umts_authen_too_long_res_utran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_only_sres_geran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1862,7 +1865,7 @@ DREF freeing VLR subscr IMSI:901700000010650
===== test_umts_authen_only_sres_geran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
===== test_umts_authen_only_sres_utran
- Location Update request causes a GSUP Send Auth Info request to HLR
@ -1956,8 +1959,8 @@ DREF freeing VLR subscr IMSI:901700000010650
===== test_umts_authen_only_sres_utran: SUCCESS
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(tall_bsc_ctx) == 7
talloc_total_blocks(tall_bsc_ctx) == 12

View File

@ -805,23 +805,29 @@ void fake_time_start()
fake_time_passes(0, 0);
}
static void check_talloc(void *msgb_ctx, void *msc_vlr_tests_ctx, int expected_blocks)
static void check_talloc(void *msgb_ctx, void *msc_vlr_tests_ctx)
{
/* Verifying that the msgb context is empty */
talloc_report_full(msgb_ctx, stderr);
/* Expecting these to stick around in msc_vlr_tests_ctx:
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
talloc_total_blocks(msc_vlr_tests_ctx) == 7
full talloc report on 'subscr_conn_test_ctx' (total 2642 bytes in 8 blocks)
struct gsup_client contains 248 bytes in 1 blocks (ref 0) 0x61300000dee0
struct gsm_network contains 2023 bytes in 6 blocks (ref 0) 0x61700000fce0
struct vlr_instance contains 160 bytes in 1 blocks (ref 0) 0x611000009a60
no_gsup_server contains 15 bytes in 1 blocks (ref 0) 0x60b00000ade0
../../../src/libosmocore/src/rate_ctr.c:199 contains 1552 bytes in 1 blocks (ref 0) 0x61b00001eae0
msgb contains 0 bytes in 1 blocks (ref 0) 0x60800000bf80
*/
* talloc_total_blocks(tall_bsc_ctx) == 12
* full talloc report on 'msc_vlr_tests_ctx' (total 3636 bytes in 12 blocks)
* struct gsup_client contains 248 bytes in 1 blocks (ref 0) 0x563a489c05f0
* struct gsm_network contains 2031 bytes in 4 blocks (ref 0) 0x563a489bfbb0
* struct vlr_instance contains 168 bytes in 1 blocks (ref 0) 0x563a489c04e0
* no_gsup_server contains 15 bytes in 1 blocks (ref 0) 0x563a489c0460
* ../../../src/libosmocore/src/rate_ctr.c:228 contains 1552 bytes in 1 blocks (ref 0) 0x563a489bfd40
* logging contains 1357 bytes in 5 blocks (ref 0) 0x563a489bf440
* struct log_target contains 228 bytes in 2 blocks (ref 0) 0x563a489bf9f0
* struct log_category contains 68 bytes in 1 blocks (ref 0) 0x563a489bfb00
* struct log_info contains 1128 bytes in 2 blocks (ref 0) 0x563a489bf4b0
* struct log_info_cat contains 1088 bytes in 1 blocks (ref 0) 0x563a489bf540
* msgb contains 0 bytes in 1 blocks (ref 0) 0x563a489bf3d0
* (That's 12 counting the root ctx)
*/
fprintf(stderr, "talloc_total_blocks(tall_bsc_ctx) == %zu\n",
talloc_total_blocks(msc_vlr_tests_ctx));
if (talloc_total_blocks(msc_vlr_tests_ctx) != expected_blocks)
if (talloc_total_blocks(msc_vlr_tests_ctx) != 12)
talloc_report_full(msc_vlr_tests_ctx, stderr);
fprintf(stderr, "\n");
}
@ -882,6 +888,9 @@ void *msgb_ctx = NULL;
static void run_tests(int nr)
{
int test_nr;
check_talloc(msgb_ctx, msc_vlr_tests_ctx);
nr--; /* arg's first test is 1, in here it's 0 */
for (test_nr = 0; msc_vlr_tests[test_nr]; test_nr++) {
if (nr >= 0 && test_nr != nr)
@ -895,7 +904,7 @@ static void run_tests(int nr)
if (cmdline_opts.verbose)
fprintf(stderr, "(test nr %d)\n", test_nr + 1);
check_talloc(msgb_ctx, msc_vlr_tests_ctx, 7);
check_talloc(msgb_ctx, msc_vlr_tests_ctx);
}
}
@ -928,7 +937,7 @@ int main(int argc, char **argv)
msc_vlr_tests_ctx = talloc_named_const(NULL, 0, "msc_vlr_tests_ctx");
msgb_ctx = msgb_talloc_ctx_init(msc_vlr_tests_ctx, 0);
osmo_init_logging(&info);
osmo_init_logging2(msc_vlr_tests_ctx, &info);
_log_lines = cmdline_opts.verbose;
@ -969,6 +978,6 @@ int main(int argc, char **argv)
printf("Done\n");
check_talloc(msgb_ctx, msc_vlr_tests_ctx, 7);
check_talloc(msgb_ctx, msc_vlr_tests_ctx);
return 0;
}

View File

@ -77,7 +77,8 @@ const struct log_info log_info = {
int main(int argc, char **argv)
{
osmo_init_logging(&log_info);
void *ctx = talloc_named_const(NULL, 0, "smpp_test");
osmo_init_logging2(ctx, &log_info);
log_set_use_color(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);

View File

@ -198,10 +198,12 @@ static struct log_info info = {
int main(int argc, char **argv)
{
void *msgb_ctx;
void *logging_ctx;
talloc_ctx = talloc_named_const(NULL, 0, "sms_queue_test");
msgb_ctx = msgb_talloc_ctx_init(NULL, 0);
osmo_init_logging(&info);
msgb_ctx = msgb_talloc_ctx_init(talloc_ctx, 0);
logging_ctx = talloc_named_const(talloc_ctx, 0, "logging");
osmo_init_logging2(logging_ctx, &info);
OSMO_ASSERT(osmo_stderr_target);
log_set_use_color(osmo_stderr_target, 0);
@ -222,6 +224,7 @@ int main(int argc, char **argv)
OSMO_ASSERT(talloc_total_blocks(msgb_ctx) == 1);
OSMO_ASSERT(talloc_total_size(msgb_ctx) == 0);
talloc_free(msgb_ctx);
talloc_free(logging_ctx);
if (talloc_total_blocks(talloc_ctx) != 1
|| talloc_total_size(talloc_ctx) != 0)