From 111536ea9a43282c82d6dfc4c39a12e2beaf2c8e Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Mon, 31 Aug 2020 22:41:39 -0400 Subject: [PATCH] Fix the test program [#536] --- lib/pfcp/context.c | 17 ++++ lib/pfcp/context.h | 3 + src/amf/nsmf-handler.c | 111 +++++++++++++++------------ src/sgwc/context.c | 12 +-- src/sgwu/context.c | 12 +-- src/smf/context.c | 14 +--- src/upf/context.c | 12 +-- tests/app/5gc-init.c | 15 +++- tests/app/app-init.c | 54 ++++++------- tests/app/epc-init.c | 49 +++++------- tests/csfb/abts-main.c | 8 -- tests/handover/abts-main.c | 8 -- tests/handover/epc-s1-test.c | 3 + tests/registration/dereg-test.c | 11 ++- tests/registration/gmm-status-test.c | 13 ++++ tests/volte/abts-main.c | 12 +-- tests/volte/rx-test.c | 3 + tests/volte/video-test.c | 15 ++++ 18 files changed, 191 insertions(+), 181 deletions(-) diff --git a/lib/pfcp/context.c b/lib/pfcp/context.c index 4232443af..d58b922e3 100644 --- a/lib/pfcp/context.c +++ b/lib/pfcp/context.c @@ -1502,3 +1502,20 @@ void ogs_pfcp_subnet_remove_all(void) ogs_list_for_each_safe(&self.subnet_list, next_subnet, subnet) ogs_pfcp_subnet_remove(subnet); } + +void ogs_pfcp_pool_init(ogs_pfcp_sess_t *sess) +{ + ogs_pool_init(&sess->pdr_pool, OGS_MAX_NUM_OF_PDR); + ogs_pool_init(&sess->far_pool, OGS_MAX_NUM_OF_FAR); + ogs_pool_init(&sess->urr_pool, OGS_MAX_NUM_OF_URR); + ogs_pool_init(&sess->qer_pool, OGS_MAX_NUM_OF_QER); + ogs_pool_init(&sess->bar_pool, OGS_MAX_NUM_OF_BAR); +} +void ogs_pfcp_pool_final(ogs_pfcp_sess_t *sess) +{ + ogs_pool_final(&sess->pdr_pool); + ogs_pool_final(&sess->far_pool); + ogs_pool_final(&sess->urr_pool); + ogs_pool_final(&sess->qer_pool); + ogs_pool_final(&sess->bar_pool); +} diff --git a/lib/pfcp/context.h b/lib/pfcp/context.h index 42e987f89..13def34e6 100644 --- a/lib/pfcp/context.h +++ b/lib/pfcp/context.h @@ -362,6 +362,9 @@ ogs_pfcp_subnet_t *ogs_pfcp_subnet_next(ogs_pfcp_subnet_t *subnet); void ogs_pfcp_subnet_remove(ogs_pfcp_subnet_t *subnet); void ogs_pfcp_subnet_remove_all(void); +void ogs_pfcp_pool_init(ogs_pfcp_sess_t *sess); +void ogs_pfcp_pool_final(ogs_pfcp_sess_t *sess); + #ifdef __cplusplus } #endif diff --git a/src/amf/nsmf-handler.c b/src/amf/nsmf-handler.c index c01fd3967..900a702e4 100644 --- a/src/amf/nsmf-handler.c +++ b/src/amf/nsmf-handler.c @@ -427,71 +427,88 @@ int amf_nsmf_pdu_session_handle_release_sm_context(amf_sess_t *sess, int state) /* Check last session */ if (ogs_list_count(&amf_ue->sess_list) == 0) { - if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_authentication)) { - - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate); - - } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_de_registered)) { - - nas_5gs_send_de_registration_accept(amf_ue); - - } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_exception)) { - + if (state == AMF_RELEASE_SM_CONTEXT_NG_CONTEXT_REMOVE) { /* - * 1. GMM Exception + * 1. Initial context setup failure * 2. Release All SM contexts * 3. UE Context release command * 4. UE Context release complete */ ngap_send_amf_ue_context_release_command(amf_ue, NGAP_Cause_PR_nas, NGAP_CauseNas_normal_release, - NGAP_UE_CTX_REL_UE_CONTEXT_REMOVE, 0); + NGAP_UE_CTX_REL_NG_CONTEXT_REMOVE, 0); + + } else if (state == AMF_RELEASE_SM_CONTEXT_REGISTRATION_ACCEPT) { + /* + * 1. Registration request + * 2. Release All SM contexts + * 3. Registration accept + */ + nas_5gs_send_registration_accept(amf_ue); + + } else if (state == AMF_RELEASE_SM_CONTEXT_SERVICE_ACCEPT) { + /* + * 1. Service request + * 2. Release All SM contexts + * 3. Service accept + */ + nas_5gs_send_service_accept(amf_ue); } else { - if (state == AMF_RELEASE_SM_CONTEXT_NG_CONTEXT_REMOVE) { + /* NO_STATE */ + + if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_authentication)) { + + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, amf_ue, NULL, + amf_nausf_auth_build_authenticate); + + } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_de_registered)) { /* - * 1. Initial context setup failure + * 1. PDU session release request + * 2. PDUSessionResourceReleaseCommand + + * PDU session release command + * 3. PDUSessionResourceReleaseREsponse + * 4. PDU session release complete + * 5. Deregistration request + * 6. UEContextReleaseCommand + * 7. UEContextReleaseComplete + */ + + nas_5gs_send_de_registration_accept(amf_ue); + + } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)) { + /* + * 1. PDU session release request + * 2. PDUSessionResourceReleaseCommand + + * PDU session release command + * 3. PDUSessionResourceReleaseREsponse + * 4. PDU session release complete + * + * No Deregistration request in the above step + * + * So, Nothing to do! + */ + } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_exception)) { + /* + * 1. GMM Exception * 2. Release All SM contexts * 3. UE Context release command * 4. UE Context release complete */ ngap_send_amf_ue_context_release_command(amf_ue, NGAP_Cause_PR_nas, NGAP_CauseNas_normal_release, - NGAP_UE_CTX_REL_NG_CONTEXT_REMOVE, 0); + NGAP_UE_CTX_REL_UE_CONTEXT_REMOVE, 0); - } else if (state == AMF_RELEASE_SM_CONTEXT_REGISTRATION_ACCEPT) { - /* - * 1. Registration request - * 2. Release All SM contexts - * 3. Registration accept - */ - nas_5gs_send_registration_accept(amf_ue); - - } else if (state == AMF_RELEASE_SM_CONTEXT_SERVICE_ACCEPT) { - /* - * 1. Service request - * 2. Release All SM contexts - * 3. Service accept - */ - nas_5gs_send_service_accept(amf_ue); - - } else { - ogs_fatal("Unknown state[%d]", state); - if (OGS_FSM_CHECK(&amf_ue->sm, + } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_initial_context_setup)) { - ogs_fatal("Release SM Context in initial-context-setup"); - } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)) { - - ogs_fatal("Release SM Context in registered"); - - } else if (OGS_FSM_CHECK( - &amf_ue->sm, gmm_state_security_mode)) { - ogs_fatal("Release SM Context in security-mode"); - } else { - ogs_fatal("Release SM Context : INVALID STATE"); - - } + ogs_fatal("Release SM Context in initial-context-setup"); + ogs_assert_if_reached(); + } else if (OGS_FSM_CHECK( + &amf_ue->sm, gmm_state_security_mode)) { + ogs_fatal("Release SM Context in security-mode"); + ogs_assert_if_reached(); + } else { + ogs_fatal("Release SM Context : INVALID STATE"); ogs_assert_if_reached(); } } diff --git a/src/sgwc/context.c b/src/sgwc/context.c index f0c944c0a..0ca181dfd 100644 --- a/src/sgwc/context.c +++ b/src/sgwc/context.c @@ -389,11 +389,7 @@ sgwc_sess_t *sgwc_sess_add(sgwc_ue_t *sgwc_ue, char *apn) } memset(sess, 0, sizeof *sess); - ogs_pool_init(&sess->pfcp.pdr_pool, OGS_MAX_NUM_OF_PDR); - ogs_pool_init(&sess->pfcp.far_pool, OGS_MAX_NUM_OF_FAR); - ogs_pool_init(&sess->pfcp.urr_pool, OGS_MAX_NUM_OF_URR); - ogs_pool_init(&sess->pfcp.qer_pool, OGS_MAX_NUM_OF_QER); - ogs_pool_init(&sess->pfcp.bar_pool, OGS_MAX_NUM_OF_BAR); + ogs_pfcp_pool_init(&sess->pfcp); sess->index = ogs_pool_index(&sgwc_sess_pool, sess); ogs_assert(sess->index > 0 && sess->index <= ogs_app()->pool.sess); @@ -490,11 +486,7 @@ int sgwc_sess_remove(sgwc_sess_t *sess) sgwc_bearer_remove_all(sess); - ogs_pool_final(&sess->pfcp.pdr_pool); - ogs_pool_final(&sess->pfcp.far_pool); - ogs_pool_final(&sess->pfcp.urr_pool); - ogs_pool_final(&sess->pfcp.qer_pool); - ogs_pool_final(&sess->pfcp.bar_pool); + ogs_pfcp_pool_final(&sess->pfcp); ogs_pool_free(&sgwc_sess_pool, sess); diff --git a/src/sgwu/context.c b/src/sgwu/context.c index c0c89988f..c9ea1da68 100644 --- a/src/sgwu/context.c +++ b/src/sgwu/context.c @@ -374,11 +374,7 @@ sgwu_sess_t *sgwu_sess_add(ogs_pfcp_f_seid_t *cp_f_seid, ogs_assert(sess); memset(sess, 0, sizeof *sess); - ogs_pool_init(&sess->pfcp.pdr_pool, OGS_MAX_NUM_OF_PDR); - ogs_pool_init(&sess->pfcp.far_pool, OGS_MAX_NUM_OF_FAR); - ogs_pool_init(&sess->pfcp.urr_pool, OGS_MAX_NUM_OF_URR); - ogs_pool_init(&sess->pfcp.qer_pool, OGS_MAX_NUM_OF_QER); - ogs_pool_init(&sess->pfcp.bar_pool, OGS_MAX_NUM_OF_BAR); + ogs_pfcp_pool_init(&sess->pfcp); sess->index = ogs_pool_index(&sgwu_sess_pool, sess); ogs_assert(sess->index > 0 && sess->index <= ogs_app()->pool.sess); @@ -412,11 +408,7 @@ int sgwu_sess_remove(sgwu_sess_t *sess) ogs_hash_set(self.sess_hash, &sess->sgwc_sxa_seid, sizeof(sess->sgwc_sxa_seid), NULL); - ogs_pool_final(&sess->pfcp.pdr_pool); - ogs_pool_final(&sess->pfcp.far_pool); - ogs_pool_final(&sess->pfcp.urr_pool); - ogs_pool_final(&sess->pfcp.qer_pool); - ogs_pool_final(&sess->pfcp.bar_pool); + ogs_pfcp_pool_final(&sess->pfcp); ogs_pool_free(&sgwu_sess_pool, sess); diff --git a/src/smf/context.c b/src/smf/context.c index b92905db3..e5a924b69 100644 --- a/src/smf/context.c +++ b/src/smf/context.c @@ -777,12 +777,7 @@ smf_sess_t *smf_sess_add_by_psi(smf_ue_t *smf_ue, uint8_t psi) } memset(sess, 0, sizeof *sess); - ogs_pool_init(&sess->pfcp.pdr_pool, OGS_MAX_NUM_OF_PDR); - ogs_pool_init(&sess->pfcp.far_pool, OGS_MAX_NUM_OF_FAR); - ogs_pool_init(&sess->pfcp.urr_pool, OGS_MAX_NUM_OF_URR); - ogs_pool_init(&sess->pfcp.qer_pool, OGS_MAX_NUM_OF_QER); - ogs_pool_init(&sess->pfcp.bar_pool, OGS_MAX_NUM_OF_BAR); - + ogs_pfcp_pool_init(&sess->pfcp); smf_qfi_pool_init(sess); sess->index = ogs_pool_index(&smf_sess_pool, sess); @@ -984,12 +979,7 @@ void smf_sess_remove(smf_sess_t *sess) smf_bearer_remove_all(sess); - ogs_pool_final(&sess->pfcp.pdr_pool); - ogs_pool_final(&sess->pfcp.far_pool); - ogs_pool_final(&sess->pfcp.urr_pool); - ogs_pool_final(&sess->pfcp.qer_pool); - ogs_pool_final(&sess->pfcp.bar_pool); - + ogs_pfcp_pool_final(&sess->pfcp); ogs_pool_final(&sess->qfi_pool); ogs_pool_free(&smf_sess_pool, sess); diff --git a/src/upf/context.c b/src/upf/context.c index 341860ce7..93cc27966 100644 --- a/src/upf/context.c +++ b/src/upf/context.c @@ -388,11 +388,7 @@ upf_sess_t *upf_sess_add(ogs_pfcp_f_seid_t *cp_f_seid, ogs_assert(sess); memset(sess, 0, sizeof *sess); - ogs_pool_init(&sess->pfcp.pdr_pool, OGS_MAX_NUM_OF_PDR); - ogs_pool_init(&sess->pfcp.far_pool, OGS_MAX_NUM_OF_FAR); - ogs_pool_init(&sess->pfcp.urr_pool, OGS_MAX_NUM_OF_URR); - ogs_pool_init(&sess->pfcp.qer_pool, OGS_MAX_NUM_OF_QER); - ogs_pool_init(&sess->pfcp.bar_pool, OGS_MAX_NUM_OF_BAR); + ogs_pfcp_pool_init(&sess->pfcp); sess->index = ogs_pool_index(&upf_sess_pool, sess); ogs_assert(sess->index > 0 && sess->index <= ogs_app()->pool.sess); @@ -489,11 +485,7 @@ int upf_sess_remove(upf_sess_t *sess) ogs_pfcp_ue_ip_free(sess->ipv6); } - ogs_pool_final(&sess->pfcp.pdr_pool); - ogs_pool_final(&sess->pfcp.far_pool); - ogs_pool_final(&sess->pfcp.urr_pool); - ogs_pool_final(&sess->pfcp.qer_pool); - ogs_pool_final(&sess->pfcp.bar_pool); + ogs_pfcp_pool_final(&sess->pfcp); ogs_pool_free(&upf_sess_pool, sess); diff --git a/tests/app/5gc-init.c b/tests/app/5gc-init.c index 9bb27e41f..89ae69e94 100644 --- a/tests/app/5gc-init.c +++ b/tests/app/5gc-init.c @@ -51,17 +51,24 @@ int app_initialize(const char *const argv[]) nrf_thread = test_child_create("nrf", argv_out); if (ogs_app()->parameter.no_amf == 0) amf_thread = test_child_create("amf", argv_out); - if (ogs_app()->parameter.no_ausf == 0) - ausf_thread = test_child_create("ausf", argv_out); - if (ogs_app()->parameter.no_udm == 0) - udm_thread = test_child_create("udm", argv_out); if (ogs_app()->parameter.no_smf == 0) smf_thread = test_child_create("smf", argv_out); if (ogs_app()->parameter.no_upf == 0) upf_thread = test_child_create("upf", argv_out); + if (ogs_app()->parameter.no_ausf == 0) + ausf_thread = test_child_create("ausf", argv_out); + if (ogs_app()->parameter.no_udm == 0) + udm_thread = test_child_create("udm", argv_out); if (ogs_app()->parameter.no_udr == 0) udr_thread = test_child_create("udr", argv_out); + /* + * Wait for all sockets listening + * + * If freeDiameter is not used, we can use a delay of less than 1 second. + */ + ogs_msleep(500); + return OGS_OK;; } diff --git a/tests/app/app-init.c b/tests/app/app-init.c index b2cb4c1bc..533d29577 100644 --- a/tests/app/app-init.c +++ b/tests/app/app-init.c @@ -30,6 +30,7 @@ static ogs_thread_t *sgwc_thread = NULL; static ogs_thread_t *sgwu_thread = NULL; static ogs_thread_t *smf_thread = NULL; static ogs_thread_t *mme_thread = NULL; +static ogs_thread_t *amf_thread = NULL; int app_initialize(const char *const argv[]) { @@ -53,39 +54,22 @@ int app_initialize(const char *const argv[]) if (ogs_app()->parameter.no_nrf == 0) nrf_thread = test_child_create("nrf", argv_out); - if (ogs_app()->parameter.no_pcrf == 0) - pcrf_thread = test_child_create("pcrf", argv_out); - if (ogs_app()->parameter.no_hss == 0) - hss_thread = test_child_create("hss", argv_out); - - /* - * To avoid freeDiameter error - * - * ROUTING ERROR - * 'No remaining suitable candidate to route the message to' for: - */ - ogs_msleep(500); - - if (ogs_app()->parameter.no_upf == 0) - upf_thread = test_child_create("upf", argv_out); - if (ogs_app()->parameter.no_sgwu == 0) - sgwu_thread = test_child_create("sgwu", argv_out); - if (ogs_app()->parameter.no_sgwc == 0) - sgwc_thread = test_child_create("sgwc", argv_out); - - /* - * To avoid freeDiameter error - * - * ROUTING ERROR - * 'No remaining suitable candidate to route the message to' for: - */ - ogs_msleep(500); - - if (ogs_app()->parameter.no_smf == 0) - smf_thread = test_child_create("smf", argv_out); if (ogs_app()->parameter.no_mme == 0) mme_thread = test_child_create("mme", argv_out); - + if (ogs_app()->parameter.no_sgwc == 0) + sgwc_thread = test_child_create("sgwc", argv_out); + if (ogs_app()->parameter.no_smf == 0) + smf_thread = test_child_create("smf", argv_out); + if (ogs_app()->parameter.no_amf == 0) + amf_thread = test_child_create("amf", argv_out); + if (ogs_app()->parameter.no_sgwu == 0) + sgwu_thread = test_child_create("sgwu", argv_out); + if (ogs_app()->parameter.no_upf == 0) + upf_thread = test_child_create("upf", argv_out); + if (ogs_app()->parameter.no_hss == 0) + hss_thread = test_child_create("hss", argv_out); + if (ogs_app()->parameter.no_pcrf == 0) + pcrf_thread = test_child_create("pcrf", argv_out); if (ogs_app()->parameter.no_ausf == 0) ausf_thread = test_child_create("ausf", argv_out); if (ogs_app()->parameter.no_udm == 0) @@ -93,6 +77,13 @@ int app_initialize(const char *const argv[]) if (ogs_app()->parameter.no_udr == 0) udr_thread = test_child_create("udr", argv_out); + /* + * Wait for all sockets listening + * + * Note that at least 1 second is needed if freeDiameter is running. + */ + ogs_msleep(1200); + return OGS_OK;; } @@ -102,6 +93,7 @@ void app_terminate(void) if (udm_thread) ogs_thread_destroy(udm_thread); if (ausf_thread) ogs_thread_destroy(ausf_thread); + if (amf_thread) ogs_thread_destroy(amf_thread); if (mme_thread) ogs_thread_destroy(mme_thread); if (smf_thread) ogs_thread_destroy(smf_thread); diff --git a/tests/app/epc-init.c b/tests/app/epc-init.c index 9c5fb6dc3..4675e7bf1 100644 --- a/tests/app/epc-init.c +++ b/tests/app/epc-init.c @@ -50,38 +50,27 @@ int app_initialize(const char *const argv[]) if (ogs_app()->parameter.no_nrf == 0) nrf_thread = test_child_create("nrf", argv_out); - if (ogs_app()->parameter.no_pcrf == 0) - pcrf_thread = test_child_create("pcrf", argv_out); - if (ogs_app()->parameter.no_hss == 0) - hss_thread = test_child_create("hss", argv_out); - - /* - * To avoid freeDiameter error - * - * ROUTING ERROR - * 'No remaining suitable candidate to route the message to' for: - */ - ogs_msleep(500); - - if (ogs_app()->parameter.no_upf == 0) - upf_thread = test_child_create("upf", argv_out); - if (ogs_app()->parameter.no_sgwu == 0) - sgwu_thread = test_child_create("sgwu", argv_out); - if (ogs_app()->parameter.no_sgwc == 0) - sgwc_thread = test_child_create("sgwc", argv_out); - - /* - * To avoid freeDiameter error - * - * ROUTING ERROR - * 'No remaining suitable candidate to route the message to' for: - */ - ogs_msleep(500); - - if (ogs_app()->parameter.no_smf == 0) - smf_thread = test_child_create("smf", argv_out); if (ogs_app()->parameter.no_mme == 0) mme_thread = test_child_create("mme", argv_out); + if (ogs_app()->parameter.no_sgwc == 0) + sgwc_thread = test_child_create("sgwc", argv_out); + if (ogs_app()->parameter.no_smf == 0) + smf_thread = test_child_create("smf", argv_out); + if (ogs_app()->parameter.no_sgwu == 0) + sgwu_thread = test_child_create("sgwu", argv_out); + if (ogs_app()->parameter.no_upf == 0) + upf_thread = test_child_create("upf", argv_out); + if (ogs_app()->parameter.no_hss == 0) + hss_thread = test_child_create("hss", argv_out); + if (ogs_app()->parameter.no_pcrf == 0) + pcrf_thread = test_child_create("pcrf", argv_out); + + /* + * Wait for all sockets listening + * + * Note that at least 1 second is needed if freeDiameter is running. + */ + ogs_msleep(1200); return OGS_OK;; } diff --git a/tests/csfb/abts-main.c b/tests/csfb/abts-main.c index f0cded7ec..450a127df 100644 --- a/tests/csfb/abts-main.c +++ b/tests/csfb/abts-main.c @@ -68,14 +68,6 @@ static void initialize(const char *const argv[]) rv = app_initialize(argv); ogs_assert(rv == OGS_OK); - - /* - * To avoid freeDiameter error - * - * ROUTING ERROR - * 'No remaining suitable candidate to route the message to' for: - */ - ogs_msleep(500); } int main(int argc, const char *const argv[]) diff --git a/tests/handover/abts-main.c b/tests/handover/abts-main.c index 88d3db6c0..5595cffa7 100644 --- a/tests/handover/abts-main.c +++ b/tests/handover/abts-main.c @@ -51,14 +51,6 @@ static void initialize(const char *const argv[]) rv = app_initialize(argv); ogs_assert(rv == OGS_OK); - - /* - * To avoid freeDiameter error - * - * ROUTING ERROR - * 'No remaining suitable candidate to route the message to' for: - */ - ogs_msleep(500); } int main(int argc, const char *const argv[]) diff --git a/tests/handover/epc-s1-test.c b/tests/handover/epc-s1-test.c index aeb234eec..0f1f452f4 100644 --- a/tests/handover/epc-s1-test.c +++ b/tests/handover/epc-s1-test.c @@ -387,6 +387,9 @@ static void test1_func(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, recvbuf); tests1ap_recv(test_ue, recvbuf); + /* DELAY is needed in dedicated EPS bearer */ + ogs_msleep(100); + /* Send GTP-U ICMP Packet */ bearer = test_bearer_find_by_ue_ebi(test_ue, 5); ogs_assert(bearer); diff --git a/tests/registration/dereg-test.c b/tests/registration/dereg-test.c index 640175b6c..f25e8f190 100644 --- a/tests/registration/dereg-test.c +++ b/tests/registration/dereg-test.c @@ -1278,7 +1278,16 @@ static void test4_func(abts_case *tc, void *data) rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); - ogs_msleep(100); + /* Send GTP-U ICMP Packet */ + qos_flow = test_qos_flow_find_by_ue_qfi(test_ue, 1); + ogs_assert(qos_flow); + rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive GTP-U ICMP Packet */ + recvbuf = testgnb_gtpu_read(gtpu); + ABTS_PTR_NOTNULL(tc, recvbuf); + ogs_pkbuf_free(recvbuf); /* Send PDU Session release request */ sess->ul_nas_transport_param.request_type = 0; diff --git a/tests/registration/gmm-status-test.c b/tests/registration/gmm-status-test.c index 3fcc11f41..933db47b6 100644 --- a/tests/registration/gmm-status-test.c +++ b/tests/registration/gmm-status-test.c @@ -253,6 +253,19 @@ static void test1_func(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, recvbuf); testngap_recv(test_ue, recvbuf); + /* + * Related to issue #536. When running with VirtualBox 1 Core, + * AMF sends namf-callback response very late. In SMF, + * the Session context has already been removed, so an assertion occurs. + * + * It seems to be related to the response part of MHD. We will check + * if the same situation occurs after upgrading to nghttp2. + * + * If this issue still occurs on nghttp2, + * I will remove the assertion from SMF. + */ + ogs_msleep(100); + /* Send GMM Status */ gmmbuf = testgmm_build_gmm_status(test_ue, OGS_5GMM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE); diff --git a/tests/volte/abts-main.c b/tests/volte/abts-main.c index 671c0dcd3..9cfd2af23 100644 --- a/tests/volte/abts-main.c +++ b/tests/volte/abts-main.c @@ -57,18 +57,10 @@ static void initialize(const char *const argv[]) ogs_assert(rv == OGS_OK); test_epc_init(); - rv = app_initialize(argv); + rv = pcscf_fd_init(); ogs_assert(rv == OGS_OK); - /* - * To avoid freeDiameter error - * - * ROUTING ERROR - * 'No remaining suitable candidate to route the message to' for: - */ - ogs_msleep(500); - - rv = pcscf_fd_init(); + rv = app_initialize(argv); ogs_assert(rv == OGS_OK); } diff --git a/tests/volte/rx-test.c b/tests/volte/rx-test.c index efb7a038b..c457ef37a 100644 --- a/tests/volte/rx-test.c +++ b/tests/volte/rx-test.c @@ -971,6 +971,9 @@ static void test2_func(abts_case *tc, void *data) rv = testenb_s1ap_send(s1ap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* DELAY is needed in dedicated EPS bearer */ + ogs_msleep(100); + /* Send AA-Request */ pcscf_rx_send_aar(&rx_sid, sess, OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI, 0, 1); diff --git a/tests/volte/video-test.c b/tests/volte/video-test.c index 7bd2cbc0b..d7b9aa2d0 100644 --- a/tests/volte/video-test.c +++ b/tests/volte/video-test.c @@ -524,6 +524,9 @@ static void test1_func(abts_case *tc, void *data) rv = testenb_s1ap_send(s1ap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* DELAY is needed before AA-Request */ + ogs_msleep(100); + /* Send AA-Request */ rx_sid = NULL; pcscf_rx_send_aar2(&rx_sid, sess, @@ -665,6 +668,9 @@ static void test1_func(abts_case *tc, void *data) rv = testenb_s1ap_send(s1ap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* DELAY is needed before AA-Request */ + ogs_msleep(100); + /* Send AA-Request */ rx_sid = NULL; pcscf_rx_send_aar2(&rx_sid, sess, @@ -806,6 +812,9 @@ static void test1_func(abts_case *tc, void *data) rv = testenb_s1ap_send(s1ap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* DELAY is needed before AA-Request */ + ogs_msleep(100); + /* Send AA-Request */ rx_sid = NULL; pcscf_rx_send_aar2(&rx_sid, sess, @@ -947,6 +956,9 @@ static void test1_func(abts_case *tc, void *data) rv = testenb_s1ap_send(s1ap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* DELAY is needed before AA-Request */ + ogs_msleep(100); + /* Send AA-Request */ rx_sid = NULL; pcscf_rx_send_aar2(&rx_sid, sess, @@ -1088,6 +1100,9 @@ static void test1_func(abts_case *tc, void *data) rv = testenb_s1ap_send(s1ap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* DELAY is needed before AA-Request */ + ogs_msleep(100); + /* Send AA-Request */ rx_sid = NULL; pcscf_rx_send_aar2(&rx_sid, sess,