aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-23 09:53:53 -0400
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-05 21:09:53 +0200
commit9ba273d365ac731a9c3ff285821062c346724390 (patch)
tree1a88b3d31cfe795811436848d7dea2a998d344cd /openbsc/tests
parent49c1a7156c7e0ced1709aee4a3d3438db60bae41 (diff)
sgsn: Copy the msisdn to the sgsn_data and use it in PDP activation
The MSISDN should be present for "security" reasons in the first activation of a PDP context. Take the encoded MSISDN, store it for future use and then put it into the PDP activation request. The MM Context contains a field for a decoded MSISDN already. As we need to forward the data to the GGSN I want to avoid having to store TON and NPI in another place. Simply store the data in the encoded form.
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 197be9da4..d9b162dc2 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -414,9 +414,14 @@ static void test_subscriber_gsup(void)
0x02, 0x01, 0x07 /* GPRS not allowed */
};
+#define MSISDN 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09
+
+ static const uint8_t s1_msisdn[] = { MSISDN };
+
static const uint8_t update_location_res[] = {
0x06,
TEST_GSUP_IMSI1_IE,
+ 0x08, 0x09, MSISDN,
0x04, 0x00, /* PDP info complete */
0x05, 0x12,
0x10, 0x01, 0x01,
@@ -428,6 +433,8 @@ static void test_subscriber_gsup(void)
0x12, 0x08, 0x03, 'f', 'o', 'o', 0x03, 'a', 'p', 'n',
};
+#undef MSISDN
+
static const uint8_t update_location_err[] = {
0x05,
TEST_GSUP_IMSI1_IE,
@@ -534,6 +541,8 @@ static void test_subscriber_gsup(void)
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);
+ OSMO_ASSERT(s1->sgsn_data->msisdn_len == sizeof(s1_msisdn));
+ OSMO_ASSERT(memcmp(s1->sgsn_data->msisdn, s1_msisdn, sizeof(s1_msisdn)) == 0);
OSMO_ASSERT(!llist_empty(&s1->sgsn_data->pdp_list));
pdpd = llist_entry(s1->sgsn_data->pdp_list.next,
struct sgsn_subscriber_pdp_data, list);