aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/sgsn
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-12-13 12:11:12 +0000
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-12-13 12:42:45 +0000
commitd53e9b51b6e6be1a1e8a6c10187b08dc5a95f971 (patch)
tree3679a683572e53da7d540233c6b063bcdfb9eb2c /openbsc/tests/sgsn
parentc3b94f92c556dc3590d8343b572bc53f251a830d (diff)
Revert "Support Deactivate PDP Context Request from network"
This reverts commit 1611df5226199da2bf2fba3d22d93cc1a6c6c777. This is due to a segfault introduced to the asan build only. See: http://lists.osmocom.org/pipermail/openbsc/2016-December/009966.html Subject: new sanitizer breakage: SIGSEGV in sgsn_create_pdp_ctx() Date: Tue Dec 13 12:08:32 UTC 2016 Change-Id: Ic926c0e6778947b516994822e3a21d4fde25bb02
Diffstat (limited to 'openbsc/tests/sgsn')
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c136
-rw-r--r--openbsc/tests/sgsn/sgsn_test.ok4
2 files changed, 0 insertions, 140 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 6f01d4417..e7b74585b 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -38,17 +38,14 @@
#include <osmocom/core/rate_ctr.h>
#include <stdio.h>
-#include <gtp.h>
void *tall_bsc_ctx;
-struct gsn_t gsn_ctx;
static struct sgsn_instance sgsn_inst = {
.config_file = "osmo_sgsn.cfg",
.cfg = {
.gtp_statedir = "./",
.auth_policy = SGSN_AUTH_POLICY_CLOSED,
},
- .gsn = &gsn_ctx,
};
struct sgsn_instance *sgsn = &sgsn_inst;
unsigned sgsn_tx_counter = 0;
@@ -2366,138 +2363,6 @@ static void test_ggsn_selection(void)
cleanup_test();
}
-static void test_pdp_deactivation_with_pdp_ctx(void)
-{
- struct apn_ctx *actxs[4];
- struct sgsn_ggsn_ctx *ggc, *ggcs[3];
- struct gsm_subscriber *s1;
- const char *imsi1 = "1234567890";
- struct sgsn_mm_ctx *ctx;
- struct gprs_ra_id raid = { 0, };
- uint32_t local_tlli = 0xffeeddcc;
- enum gsm48_gsm_cause gsm_cause;
- struct tlv_parsed tp;
- uint8_t apn_enc[GSM_APN_LENGTH + 10];
- struct sgsn_subscriber_pdp_data *pdp_data;
- char apn_str[GSM_APN_LENGTH];
-
- printf("Testing Pdp deactivation for MS with pdp ctx\n");
-
- gprs_gsup_client_send_cb = my_gprs_gsup_client_send_dummy;
-
- /* Check for emptiness */
- OSMO_ASSERT(gprs_subscr_get_by_imsi(imsi1) == NULL);
-
- /* Create a context */
- OSMO_ASSERT(count(gprs_llme_list()) == 0);
- ctx = alloc_mm_ctx(local_tlli, &raid);
- strncpy(ctx->imsi, imsi1, sizeof(ctx->imsi) - 1);
-
- /* Allocate and attach a subscriber */
- s1 = gprs_subscr_get_or_create_by_mmctx(ctx);
- assert_subscr(s1, imsi1);
-
- struct sgsn_pdp_ctx *pdp;
-
- tp.lv[GSM48_IE_GSM_APN].len = 0;
- tp.lv[GSM48_IE_GSM_APN].val = apn_enc;
-
- tp.lv[OSMO_IE_GSM_REQ_PDP_ADDR].len = 2;
- tp.lv[OSMO_IE_GSM_REQ_PDP_ADDR].val = apn_enc;
-
- tp.lv[OSMO_IE_GSM_REQ_QOS].len = 14;
- tp.lv[OSMO_IE_GSM_REQ_QOS].val = apn_enc;
-
- ggcs[0] = sgsn_ggsn_ctx_find_alloc(0);
-
- actxs[0] = sgsn_apn_ctx_find_alloc("test.apn", "123456");
- actxs[0]->ggsn = ggcs[0];
-
- pdp_data = sgsn_subscriber_pdp_data_alloc(s1->sgsn_data);
- pdp_data->context_id = 1;
- pdp_data->pdp_type = 0x0121;
- strncpy(pdp_data->apn_str, "*", sizeof(pdp_data->apn_str)-1);
-
- /* Resolve GGSNs */
- tp.lv[GSM48_IE_GSM_APN].len =
- gprs_str_to_apn(apn_enc, sizeof(apn_enc), "Test.Apn");
-
- ggc = sgsn_mm_ctx_find_ggsn_ctx(ctx, &tp, &gsm_cause, apn_str);
-
- OSMO_ASSERT(ggc != NULL);
- OSMO_ASSERT(ggc->id == 0);
-
- ggc = sgsn_ggsn_ctx_alloc(ggc->id);
- /* Create a pdp context */
- pdp = sgsn_create_pdp_ctx(ggc, ctx, 5, &tp);
-
- /* Intiate PDP deactivation for imsi1 */
- drop_gmm_ctx_for_ms(imsi1);
- gsm48_tx_gsm_deact_pdp_acc(pdp);
- gsm0408_gprs_access_cancelled(ctx, GMM_CAUSE_GPRS_NOTALLOWED);
-
- /* Cleanup */
-
- subscr_put(s1);
-
- sgsn_apn_ctx_free(actxs[0]);
- sgsn_ggsn_ctx_free(ggcs[0]);
- sgsn_ggsn_ctx_free(ggc);
- talloc_free(pdp);
-
- cleanup_test();
-}
-
-static void test_pdp_deactivation_with_only_mm_ctx(void)
-{
- struct gsm_subscriber *s1;
- const char *imsi1 = "1234567890";
- struct sgsn_mm_ctx *ctx;
- struct gprs_ra_id raid = { 0, };
- uint32_t local_tlli = 0xffeeddcc;
-
- printf("Testing Pdp deactivation for MS with only MM ctx\n");
-
- gprs_gsup_client_send_cb = my_gprs_gsup_client_send_dummy;
-
- /* Check for emptiness */
- OSMO_ASSERT(gprs_subscr_get_by_imsi(imsi1) == NULL);
-
- /* Create a context */
- OSMO_ASSERT(count(gprs_llme_list()) == 0);
- ctx = alloc_mm_ctx(local_tlli, &raid);
- strncpy(ctx->imsi, imsi1, sizeof(ctx->imsi) - 1);
-
- /* Allocate and attach a subscriber */
- s1 = gprs_subscr_get_or_create_by_mmctx(ctx);
- assert_subscr(s1, imsi1);
-
- /* Intiate PDP deactivation for imsi1 */
- drop_gmm_ctx_for_ms(imsi1);
-
- cleanup_test();
-}
-
-static void test_pdp_deactivation_without_mm_ctx(void)
-{
- const char *imsi1 = "1234567890";
-
- printf("Testing Pdp deactivation for MS without MM ctx\n");
-
- /* Intiate PDP deactivation for imsi1 */
- drop_gmm_ctx_for_ms(imsi1);
-
- cleanup_test();
-}
-
-static void test_pdp_deactivation(void)
-{
- printf("Testing pdp deactivation\n");
-
- test_pdp_deactivation_with_pdp_ctx();
- test_pdp_deactivation_without_mm_ctx();
- test_pdp_deactivation_with_only_mm_ctx();
-}
static struct log_info_cat gprs_categories[] = {
[DMM] = {
.name = "DMM",
@@ -2589,7 +2454,6 @@ int main(int argc, char **argv)
test_gmm_routing_areas();
test_apn_matching();
test_ggsn_selection();
- test_pdp_deactivation();
printf("Done\n");
talloc_report_full(osmo_sgsn_ctx, stderr);
diff --git a/openbsc/tests/sgsn/sgsn_test.ok b/openbsc/tests/sgsn/sgsn_test.ok
index c36b64341..c7a53b9e5 100644
--- a/openbsc/tests/sgsn/sgsn_test.ok
+++ b/openbsc/tests/sgsn/sgsn_test.ok
@@ -34,8 +34,4 @@ Testing routing area changes
- RA Update Request (RA 2 -> RA 2)
Testing APN matching
Testing GGSN selection
-Testing pdp deactivation
-Testing Pdp deactivation for MS with pdp ctx
-Testing Pdp deactivation for MS without MM ctx
-Testing Pdp deactivation for MS with only MM ctx
Done