From baf0f94a7dd858eba37548253959747838b1cc16 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 29 Jan 2015 14:55:34 +0100 Subject: sgsn/test: Add checks for subscr->error_cause This commits adds a few asserts that check the value of subscr->error_cause after a GSUP message has been received. Sponsored-by: On-Waves ehf --- openbsc/tests/sgsn/sgsn_test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 1036e41fc..5e74b0ece 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -515,6 +515,7 @@ static void test_subscriber_gsup(void) rc = rx_gsup_message(send_auth_info_err, sizeof(send_auth_info_err)); OSMO_ASSERT(rc == -GMM_CAUSE_GPRS_NOTALLOWED); OSMO_ASSERT(last_updated_subscr == s1); + OSMO_ASSERT(s1->sgsn_data->error_cause == GMM_CAUSE_GPRS_NOTALLOWED); /* Check triplets */ OSMO_ASSERT(s1->sgsn_data->auth_triplets[0].key_seq == GSM_KEY_SEQ_INVAL); @@ -526,6 +527,7 @@ static void test_subscriber_gsup(void) OSMO_ASSERT(rc >= 0); OSMO_ASSERT(last_updated_subscr == s1); OSMO_ASSERT(s1->flags & GPRS_SUBSCRIBER_ENABLE_PURGE); + OSMO_ASSERT(s1->sgsn_data->error_cause == SGSN_ERROR_CAUSE_NONE); /* Check authorization */ OSMO_ASSERT(s1->authorized == 1); @@ -534,6 +536,7 @@ static void test_subscriber_gsup(void) rc = rx_gsup_message(update_location_err, sizeof(update_location_err)); OSMO_ASSERT(rc == -GMM_CAUSE_GPRS_NOTALLOWED); OSMO_ASSERT(last_updated_subscr == s1); + OSMO_ASSERT(s1->sgsn_data->error_cause == GMM_CAUSE_GPRS_NOTALLOWED); /* Check authorization */ OSMO_ASSERT(s1->authorized == 0); @@ -566,6 +569,7 @@ static void test_subscriber_gsup(void) sizeof(location_cancellation_req)); OSMO_ASSERT(rc >= 0); OSMO_ASSERT(last_updated_subscr == s1); + OSMO_ASSERT(s1->sgsn_data->error_cause == SGSN_ERROR_CAUSE_NONE); /* Check cancellation result */ OSMO_ASSERT(s1->flags & GPRS_SUBSCRIBER_CANCELLED); -- cgit v1.2.3