diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-10-03 09:10:06 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-10-09 17:35:19 +0200 |
commit | 4cffd79dd8e679f1472cb0a526458af9d440681b (patch) | |
tree | b28ac400af78ce1c05d59a4bc2a58aaa1f95e442 /openbsc | |
parent | 258ce3ded57e742889122c68d6a217d14a95edcc (diff) |
sgsn: Add testcase for "re-transmission" of detach messagesysmocom/sgsn-tests
This currently shows that the LLME will remain allocated and
never be freed.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/tests/sgsn/sgsn_test.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index a38b1460f..4ee23347b 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -142,6 +142,21 @@ static void test_gmm_detach(void) OSMO_ASSERT(count(gprs_llme_list()) == 0); ictx = sgsn_mm_ctx_by_tlli(local_tlli, &raid); OSMO_ASSERT(!ictx); + + /* and inject it again, e.g. the response was lost */ + lle = gprs_lle_get_or_create(local_tlli, 3); + msg = create_msg(detach_req, ARRAY_SIZE(detach_req)); + msgb_tlli(msg) = local_tlli; + gsm0408_gprs_rcvmsg(msg, lle->llme); + msgb_free(msg); + + /* No context */ + ictx = sgsn_mm_ctx_by_tlli(local_tlli, &raid); + OSMO_ASSERT(!ictx); + + /* TODO: Expected failure on re-transmission */ + OSMO_ASSERT(count(gprs_llme_list()) == 1); + /* TODO: check the output we get */ } static struct log_info_cat gprs_categories[] = { |