From e1beb6f51d3822593d56e071d47e12a74f077826 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 8 Jan 2015 14:13:46 +0100 Subject: sgsn/test: Fix subscriber cleanup Currently the subscribers are not really deleted by cleanup_subscr_by_imsi, but kept in RAM instead. This patch fixes this and adds a test to verify, that the subscriber is really deleted afterwards. Sponsored-by: On-Waves ehf --- openbsc/tests/sgsn/sgsn_test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'openbsc/tests/sgsn/sgsn_test.c') diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index ba76f5575..b83cfaef2 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -842,7 +842,10 @@ static void cleanup_subscr_by_imsi(const char *imsi) subscr = gprs_subscr_get_by_imsi(imsi); OSMO_ASSERT(subscr != NULL); - gprs_subscr_delete(subscr); + subscr->keep_in_ram = 0; + subscr_put(subscr); + subscr = gprs_subscr_get_by_imsi(imsi); + OSMO_ASSERT(subscr == NULL); } static void test_gmm_attach_subscr(void) -- cgit v1.2.3