aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-08 14:13:46 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-18 18:26:14 +0100
commite1beb6f51d3822593d56e071d47e12a74f077826 (patch)
tree2886233bdc5aa1eac1b98332f9d79836bd515fb5
parentd3cde1ecf49940fae90ec5e1d36824ee0ba17501 (diff)
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
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c5
1 files changed, 4 insertions, 1 deletions
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)