aboutsummaryrefslogtreecommitdiffstats
path: root/tests/sgsn/sgsn_test.c
diff options
context:
space:
mode:
authorefistokl <mykola@pentonet.com>2019-04-23 14:37:13 +0300
committerMykola Shchetinin <mykola@pentonet.com>2019-05-11 05:28:49 +0000
commitdef0d941f9048aa7d82057640d7a8ecfab728832 (patch)
tree55d259f50f308c156730841ce35e08d0232ec6bf /tests/sgsn/sgsn_test.c
parentbfd67d2f69d49003095c2aec624ba38e85aa8bd5 (diff)
gprs_gmm: send Service Reject when no PDP ctxs are available.
Look at PDP Context Status IE: if there are any PDP contexts which are ACTIVE on MS side and there are no PDP contexts which are ACTIVE on the network side, then send Service Reject with the cause "NO PDP ACTIVATED". This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Fixes: OS#3937 Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
Diffstat (limited to 'tests/sgsn/sgsn_test.c')
-rw-r--r--tests/sgsn/sgsn_test.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c
index 61452060..23cb4fbc 100644
--- a/tests/sgsn/sgsn_test.c
+++ b/tests/sgsn/sgsn_test.c
@@ -1575,6 +1575,22 @@ static void test_ggsn_selection(void)
cleanup_test();
}
+bool pdp_status_has_active_nsapis(const uint8_t *pdp_status, const size_t pdp_status_len);
+
+static void test_pdp_status_has_active_nsapis(void)
+{
+ const size_t pdp_status_len = 2;
+ const uint8_t pdp_status1[] = { 0b00100000, 0b00000000 }; /* PDP NSAPI 5 active */
+ const uint8_t pdp_status2[] = { 0b00000000, 0b00000000 }; /* no active PDP NSAPI */
+ const uint8_t pdp_status3[] = { 0b00000000, 0b00000001 }; /* PDP NSAPI 8 active */
+
+ printf("Testing pdp_status_has_active_nsapis\n");
+
+ OSMO_ASSERT(pdp_status_has_active_nsapis(pdp_status1, pdp_status_len));
+ OSMO_ASSERT(!pdp_status_has_active_nsapis(pdp_status2, pdp_status_len));
+ OSMO_ASSERT(pdp_status_has_active_nsapis(pdp_status3, pdp_status_len));
+}
+
static struct log_info_cat gprs_categories[] = {
[DMM] = {
.name = "DMM",
@@ -1657,6 +1673,7 @@ int main(int argc, char **argv)
test_gmm_cancel();
test_apn_matching();
test_ggsn_selection();
+ test_pdp_status_has_active_nsapis();
printf("Done\n");
talloc_report_full(osmo_sgsn_ctx, stderr);