diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-05-15 14:48:04 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-05-23 14:55:00 +0200 |
commit | defc3c8caf518306637ac579ec9b856f50dbb8ec (patch) | |
tree | 71d14ec1340b9231eb0497dce43f26cec7138563 /tests/msc_vlr/msc_vlr_tests.c | |
parent | 2d95ab67d100a4747f7965b5be07e00453222f87 (diff) |
implement periodic Location Update expiry in the VLR
Remove subscribers which fail to send periodic Location Updates from the
list of subscribers known to the VLR. This complements the IMSI detach
procedure: periodic LU expiry triggers an implicit IMSI detach.
Expired subscribers are purged from a periodic timer which iterates
over all subscribers once per minute.
Subscribers with an active connection do not expire. This is controlled
by the subscriber conn FSM which sets a subscriber's the LU expiry timeout
value to GSM_SUBSCRIBER_NO_EXPIRATION while a connection is active.
Add support for fake time with osmo_clock_gettime() to msc_vlr tests.
This functionality existed in OpenBSC but was lost during the nitb split.
This code took some inspiration from the OpenBSC implementation.
Related: OS#1976
Change-Id: Iebdee8b12d22acfcfb265ee41e71cfc8d9eb3ba9
Diffstat (limited to 'tests/msc_vlr/msc_vlr_tests.c')
-rw-r--r-- | tests/msc_vlr/msc_vlr_tests.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 5c0189642..8910e328e 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -813,8 +813,15 @@ const struct timeval fake_time_start_time = { 123, 456 }; void fake_time_start() { + struct timespec *clock_override; + osmo_gettimeofday_override_time = fake_time_start_time; osmo_gettimeofday_override = true; + clock_override = osmo_clock_override_gettimespec(CLOCK_MONOTONIC); + OSMO_ASSERT(clock_override); + clock_override->tv_sec = fake_time_start_time.tv_sec; + clock_override->tv_nsec = fake_time_start_time.tv_usec * 1000; + osmo_clock_override_enable(CLOCK_MONOTONIC, true); fake_time_passes(0, 0); } |