aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.c12
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.ok14
2 files changed, 18 insertions, 8 deletions
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index 769dc675d..229d2d45f 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -116,10 +116,14 @@ static int dump_peers(FILE *stream, int indent, struct gbproxy_config *cfg)
llist_for_each_entry(tlli_info, &state->enabled_tllis, list) {
char mi_buf[200];
time_t age = now - tlli_info->timestamp;
- snprintf(mi_buf, sizeof(mi_buf), "(invalid)");
- gsm48_mi_to_string(mi_buf, sizeof(mi_buf),
- tlli_info->mi_data,
- tlli_info->mi_data_len);
+ if (tlli_info->mi_data_len > 0) {
+ snprintf(mi_buf, sizeof(mi_buf), "(invalid)");
+ gsm48_mi_to_string(mi_buf, sizeof(mi_buf),
+ tlli_info->mi_data,
+ tlli_info->mi_data_len);
+ } else {
+ snprintf(mi_buf, sizeof(mi_buf), "(none)");
+ }
rc = fprintf(stream,
"%*s TLLI %08x, IMSI %s, AGE %d\n",
indent, "",
diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok
index ee67c33ef..455364883 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.ok
+++ b/openbsc/tests/gbproxy/gbproxy_test.ok
@@ -1807,8 +1807,9 @@ Peers:
RAID patched (SGSN): 3
APN patched : 3
Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
+ TLLI cache size : 2
+ TLLI-Cache: 2
+ TLLI efe2b700, IMSI (none), AGE 0
TLLI efe28117, IMSI 12131415161718, AGE 0
PROCESSING DETACH REQ from 0x01020304:1111
00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 15 01 c0 19 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 7e e1 41
@@ -1841,7 +1842,9 @@ Peers:
RAID patched (SGSN): 3
APN patched : 3
Attach Request count : 1
- TLLI-Cache: 0
+ TLLI cache size : 1
+ TLLI-Cache: 1
+ TLLI efe28117, IMSI 12131415161718, AGE 0
--- Bad cases ---
TLLI is already detached, shouldn't patch
@@ -1879,7 +1882,10 @@ Peers:
RAID patched (SGSN): 3
APN patched : 3
Attach Request count : 1
- TLLI-Cache: 0
+ TLLI cache size : 2
+ TLLI-Cache: 2
+ TLLI efe2b700, IMSI (none), AGE 0
+ TLLI efe28117, IMSI 12131415161718, AGE 0
Test TLLI info expiry
Test TLLI replacement: