summaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-29 14:55:34 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-30 21:32:47 +0100
commitbaf0f94a7dd858eba37548253959747838b1cc16 (patch)
tree5c5aca95378664b7ac6f5b0e50b47bbd3112563d /openbsc/tests
parent9ff82892da2b58ba344b2f6e70256d08947b9c34 (diff)
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
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 1036e41..5e74b0e 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);