diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-08-07 17:23:00 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-08-13 10:42:26 +0200 |
commit | aad32bccc0a031408aa369da91e5a21de660d15f (patch) | |
tree | 6297d16595c478d3d6643bc4a256b89c1b6a8ea4 /openbsc/tests/gbproxy | |
parent | 12828c1b309d0b9cda66dd369ad5935719b1ed66 (diff) |
gbproxy: Don't remove stale TLLI automatically
This patches removes the call to gbprox_remove_stale_tllis()
from gbprox_register_tlli(), so it must be called explicitly now.
The call is now done from within gbprox_update_state_after().
In addition, the TLLI cache size counter is also kept in sync when
gbprox_remove_stale_tllis is called manually. The call to
gbproxy_peer_free() in gbproxy_peer_free() is moved behind the TLLI
to allow for counter updates in gbprox_delete_tlli().
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/gbproxy')
-rw-r--r-- | openbsc/tests/gbproxy/gbproxy_test.c | 11 | ||||
-rw-r--r-- | openbsc/tests/gbproxy/gbproxy_test.ok | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index bb2b1aab8..beade6e83 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -1412,6 +1412,7 @@ static void test_gbproxy_tlli_expire(void) { struct gbproxy_tlli_info *tlli_info; + int num_removed; printf("Test TLLI expiry, max_len == 1:\n"); @@ -1427,6 +1428,10 @@ static void test_gbproxy_tlli_expire(void) /* replace the old entry */ printf(" Add TLLI 2, IMSI 2 (should replace IMSI 1)\n"); gbprox_register_tlli(peer, tlli2, imsi2, ARRAY_SIZE(imsi2)); + OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 2); + + num_removed = gbprox_remove_stale_tllis(peer, time(NULL) + 2); + OSMO_ASSERT(num_removed == 1); OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 1); dump_peers(stdout, 2, &cfg); @@ -1444,7 +1449,7 @@ static void test_gbproxy_tlli_expire(void) } { - int ret; + int num_removed; printf("Test TLLI expiry, max_age == 1:\n"); @@ -1462,8 +1467,8 @@ static void test_gbproxy_tlli_expire(void) gbprox_register_tlli(peer, tlli2, imsi2, ARRAY_SIZE(imsi2)); OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 2); - ret = gbprox_remove_stale_tllis(peer, time(NULL) + 2); - OSMO_ASSERT(ret == 2); + num_removed = gbprox_remove_stale_tllis(peer, time(NULL) + 2); + OSMO_ASSERT(num_removed == 2); OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 0); dump_peers(stdout, 2, &cfg); diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok index c893ff363..aea4de398 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.ok +++ b/openbsc/tests/gbproxy/gbproxy_test.ok @@ -1922,7 +1922,6 @@ Test TLLI expiry, max_age == 1: Add TLLI 2, IMSI 2 (should expire after timeout) Peers: NSEI 0, BVCI 20, not blocked, RAI 0-0-0-0 - TLLI cache size : 2 TLLI-Cache: 0 ===== GbProxy test END |