aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/sgsn/sgsn_test.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-08 15:29:01 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-19 08:30:01 +0100
commit244aeadb616702b34d479be3872a5e1bf71120b0 (patch)
treeb2654793730ca9af015a69b796c2a09886ead89f /openbsc/tests/sgsn/sgsn_test.c
parent10a8847d671260da5d94d76c5751424f2f367a0e (diff)
gprs: Support the full cancellation procedure
Currently no GSUP LocationCancellationResult message is sent back to the peer (HLR), if the procedure succeeded at the SGSN's side. This patch adds the missing message and put the whole request handling of this procedure into a separate function. Ticket: OW#1338 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/sgsn/sgsn_test.c')
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index c09b16931..662227d65 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -468,6 +468,12 @@ static void test_subscriber_gsup(void)
0x06, 0x01, 0x00,
};
+ static const uint8_t location_cancellation_req_other[] = {
+ 0x1c,
+ 0x01, 0x05, 0x11, 0x11, 0x11, 0x11, 0x01,
+ 0x06, 0x01, 0x00,
+ };
+
static const uint8_t insert_data_req[] = {
0x10,
TEST_GSUP_IMSI1_IE,
@@ -554,6 +560,17 @@ static void test_subscriber_gsup(void)
OSMO_ASSERT(rc == -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL);
OSMO_ASSERT(last_updated_subscr == NULL);
+ /* Inject wrong LocCancelReq GSUP message */
+ last_updated_subscr = NULL;
+ rc = rx_gsup_message(location_cancellation_req_other,
+ sizeof(location_cancellation_req_other));
+ OSMO_ASSERT(rc == -GMM_CAUSE_IMSI_UNKNOWN);
+ OSMO_ASSERT(last_updated_subscr == NULL);
+
+ /* Check cancellation result */
+ OSMO_ASSERT(!(s1->flags & GPRS_SUBSCRIBER_CANCELLED));
+ OSMO_ASSERT(s1->sgsn_data->mm != NULL);
+
/* Inject LocCancelReq GSUP message */
rc = rx_gsup_message(location_cancellation_req,
sizeof(location_cancellation_req));