diff --git a/lib/core/ogs-queue.c b/lib/core/ogs-queue.c index 97077d6a0..7da89ced8 100644 --- a/lib/core/ogs-queue.c +++ b/lib/core/ogs-queue.c @@ -114,13 +114,12 @@ static int queue_push(ogs_queue_t *queue, void *data, ogs_time_t timeout) { int rv; - ogs_thread_mutex_lock(&queue->one_big_mutex); - if (queue->terminated) { - ogs_thread_mutex_unlock(&queue->one_big_mutex); return OGS_DONE; /* no more elements ever again */ } + ogs_thread_mutex_lock(&queue->one_big_mutex); + if (ogs_queue_full(queue)) { if (!timeout) { ogs_thread_mutex_unlock(&queue->one_big_mutex); @@ -143,15 +142,16 @@ static int queue_push(ogs_queue_t *queue, void *data, ogs_time_t timeout) return rv; } } - if (queue->terminated) { - ogs_thread_mutex_unlock(&queue->one_big_mutex); - return OGS_DONE; - } - /* If we wake up and it's still full, then we were interrupted */ + /* If we wake up and it's still empty, then we were interrupted */ if (ogs_queue_full(queue)) { ogs_warn("queue full (intr)"); ogs_thread_mutex_unlock(&queue->one_big_mutex); - return OGS_ERROR; + if (queue->terminated) { + return OGS_DONE; /* no more elements ever again */ + } + else { + return OGS_ERROR; + } } } @@ -208,13 +208,12 @@ static int queue_pop(ogs_queue_t *queue, void **data, ogs_time_t timeout) { int rv; - ogs_thread_mutex_lock(&queue->one_big_mutex); - if (queue->terminated) { - ogs_thread_mutex_unlock(&queue->one_big_mutex); return OGS_DONE; /* no more elements ever again */ } + ogs_thread_mutex_lock(&queue->one_big_mutex); + /* Keep waiting until we wake up and find that the queue is not empty. */ if (ogs_queue_empty(queue)) { if (!timeout) { @@ -238,15 +237,15 @@ static int queue_pop(ogs_queue_t *queue, void **data, ogs_time_t timeout) return rv; } } - if (queue->terminated) { - ogs_thread_mutex_unlock(&queue->one_big_mutex); - return OGS_DONE; - } /* If we wake up and it's still empty, then we were interrupted */ if (ogs_queue_empty(queue)) { ogs_warn("queue empty (intr)"); ogs_thread_mutex_unlock(&queue->one_big_mutex); - return OGS_ERROR; + if (queue->terminated) { + return OGS_DONE; /* no more elements ever again */ + } else { + return OGS_ERROR; + } } } @@ -307,28 +306,3 @@ int ogs_queue_term(ogs_queue_t *queue) return ogs_queue_interrupt_all(queue); } -void ogs_queue_drain(ogs_queue_t *queue, void (*cleanup)(void *data)) -{ - void *data; - - ogs_assert(queue); - ogs_assert(cleanup); - - ogs_thread_mutex_lock(&queue->one_big_mutex); - ogs_assert(queue->terminated); - - while (!ogs_queue_empty(queue)) { - data = queue->data[queue->out]; - queue->data[queue->out] = NULL; - queue->nelts--; - queue->out++; - if (queue->out >= queue->bounds) - queue->out -= queue->bounds; - - ogs_thread_mutex_unlock(&queue->one_big_mutex); - cleanup(data); - ogs_thread_mutex_lock(&queue->one_big_mutex); - } - - ogs_thread_mutex_unlock(&queue->one_big_mutex); -} diff --git a/lib/core/ogs-queue.h b/lib/core/ogs-queue.h index 24574c637..570fc77c9 100644 --- a/lib/core/ogs-queue.h +++ b/lib/core/ogs-queue.h @@ -62,9 +62,6 @@ unsigned int ogs_queue_size(ogs_queue_t *queue); int ogs_queue_interrupt_all(ogs_queue_t *queue); int ogs_queue_term(ogs_queue_t *queue); -/* Discard pending items after termination and after all consumers stop. */ -void ogs_queue_drain(ogs_queue_t *queue, void (*cleanup)(void *data)); - #ifdef __cplusplus } diff --git a/lib/sctp/ogs-usrsctp.c b/lib/sctp/ogs-usrsctp.c index 5589c3c37..a587fbcae 100644 --- a/lib/sctp/ogs-usrsctp.c +++ b/lib/sctp/ogs-usrsctp.c @@ -332,7 +332,6 @@ int ogs_sctp_recvmsg(ogs_sock_t *sock, void *msg, size_t len, memset(&rcv_info, 0, sizeof rcv_info); memset(&addr, 0, sizeof addr); - infolen = sizeof rcv_info; n = usrsctp_recvv(socket, msg, len, &addr.sa, &addrlen, (void *)&rcv_info, diff --git a/src/amf/amf-sm.c b/src/amf/amf-sm.c index e67cf8297..95354362f 100644 --- a/src/amf/amf-sm.c +++ b/src/amf/amf-sm.c @@ -383,7 +383,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) e->h.sbi.message = &sbi_message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/amf/init.c b/src/amf/init.c index 88f742274..1ee5c9b14 100644 --- a/src/amf/init.c +++ b/src/amf/init.c @@ -81,37 +81,6 @@ int amf_initialize(void) static ogs_timer_t *t_termination_holding = NULL; -static void event_cleanup(void *data) -{ - amf_event_t *e = data; - - ogs_assert(e); - - switch (e->h.id) { - case OGS_EVENT_SBI_CLIENT: - ogs_sbi_response_free(e->h.sbi.response); - break; - case AMF_EVENT_NGAP_LO_ACCEPT: - ogs_sock_destroy(e->ngap.sock); - break; - case AMF_EVENT_NGAP_TIMER: - if (e->h.timer_id == AMF_TIMER_NG_DELAYED_SEND) - ogs_timer_delete(e->timer); - break; - default: - break; - } - - /* SBI server requests are owned and freed by their streams. */ - if (e->h.id >= AMF_EVENT_BASE) { - if (e->ngap.addr) - ogs_free(e->ngap.addr); - if (e->pkbuf) - ogs_pkbuf_free(e->pkbuf); - } - ogs_event_free(e); -} - static void event_termination(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; @@ -146,9 +115,6 @@ void amf_terminate(void) ngap_close(); amf_sbi_close(); - /* Release queued events without dispatching into finalized NF FSMs. */ - ogs_queue_drain(ogs_app()->queue, event_cleanup); - ogs_metrics_context_close(ogs_metrics_self()); amf_context_final(); diff --git a/src/ausf/ausf-sm.c b/src/ausf/ausf-sm.c index aee48b0a4..61f8785f7 100644 --- a/src/ausf/ausf-sm.c +++ b/src/ausf/ausf-sm.c @@ -245,7 +245,7 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/bsf/bsf-sm.c b/src/bsf/bsf-sm.c index e5e26bbb4..e706d0d95 100644 --- a/src/bsf/bsf-sm.c +++ b/src/bsf/bsf-sm.c @@ -322,7 +322,7 @@ cleanup: e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/eir/eir-sm.c b/src/eir/eir-sm.c index 52483ed81..910e0efb4 100644 --- a/src/eir/eir-sm.c +++ b/src/eir/eir-sm.c @@ -203,7 +203,7 @@ void eir_state_operational(ogs_fsm_t *s, eir_event_t *e) e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/nssf/nssf-sm.c b/src/nssf/nssf-sm.c index 0706dbe49..f0d17f121 100644 --- a/src/nssf/nssf-sm.c +++ b/src/nssf/nssf-sm.c @@ -251,7 +251,7 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e) e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/pcf/pcf-sm.c b/src/pcf/pcf-sm.c index fc22c9763..8e6d357a9 100644 --- a/src/pcf/pcf-sm.c +++ b/src/pcf/pcf-sm.c @@ -411,7 +411,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/scp/scp-sm.c b/src/scp/scp-sm.c index 22556c450..6e9cf5565 100644 --- a/src/scp/scp-sm.c +++ b/src/scp/scp-sm.c @@ -197,7 +197,7 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e) e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/sepp/sepp-sm.c b/src/sepp/sepp-sm.c index 504d2b90e..0e7f1a743 100644 --- a/src/sepp/sepp-sm.c +++ b/src/sepp/sepp-sm.c @@ -271,7 +271,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); /* * The SEPP on the H-PLMN should send a n32c-handshake message diff --git a/src/smf/smf-sm.c b/src/smf/smf-sm.c index 9cdcee4b3..3e351d1fe 100644 --- a/src/smf/smf-sm.c +++ b/src/smf/smf-sm.c @@ -885,7 +885,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) e->h.sbi.message = &sbi_message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/udm/udm-sm.c b/src/udm/udm-sm.c index 666940cfe..f6744f2f4 100644 --- a/src/udm/udm-sm.c +++ b/src/udm/udm-sm.c @@ -343,7 +343,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/src/udr/udr-sm.c b/src/udr/udr-sm.c index 100da8208..fe96f3486 100644 --- a/src/udr/udr-sm.c +++ b/src/udr/udr-sm.c @@ -255,7 +255,7 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); } else - ogs_warn("NF instance FSM has been finalized"); + ogs_error("NF instance FSM has been finalized"); break; diff --git a/tests/core/queue-test.c b/tests/core/queue-test.c index 501f23243..4dc1eba8b 100644 --- a/tests/core/queue-test.c +++ b/tests/core/queue-test.c @@ -166,64 +166,12 @@ static void test_queue_timeout(abts_case *tc, void *data) ogs_queue_destroy(q); } -typedef struct { - abts_case *tc; - unsigned int order; - unsigned int *next; -} queue_cleanup_item_t; - -static void queue_cleanup(void *data) -{ - queue_cleanup_item_t *item = data; - - ABTS_INT_EQUAL(item->tc, item->order, *item->next); - (*item->next)++; -} - -static void test_queue_drain(abts_case *tc, void *data) -{ - ogs_queue_t *q = ogs_queue_create(3); - queue_cleanup_item_t items[4]; - unsigned int i, next = 1; - void *value = NULL; - - ABTS_PTR_NOTNULL(tc, q); - for (i = 0; i < 4; i++) { - items[i].tc = tc; - items[i].order = i; - items[i].next = &next; - } - - for (i = 0; i < 3; i++) - ABTS_INT_EQUAL(tc, OGS_OK, ogs_queue_trypush(q, &items[i])); - ABTS_INT_EQUAL(tc, OGS_OK, ogs_queue_trypop(q, &value)); - ABTS_TRUE(tc, value == &items[0]); - /* Wrap around before termination, leaving three queued items. */ - ABTS_INT_EQUAL(tc, OGS_OK, ogs_queue_trypush(q, &items[3])); - ABTS_INT_EQUAL(tc, OGS_OK, ogs_queue_term(q)); - - ABTS_INT_EQUAL(tc, OGS_DONE, ogs_queue_trypop(q, &value)); - ABTS_INT_EQUAL(tc, OGS_DONE, ogs_queue_push(q, &items[0])); - ABTS_INT_EQUAL(tc, OGS_DONE, ogs_queue_trypush(q, &items[0])); - ABTS_INT_EQUAL(tc, OGS_DONE, - ogs_queue_timedpush(q, &items[0], ogs_time_from_msec(1))); - - ogs_queue_drain(q, queue_cleanup); - ABTS_INT_EQUAL(tc, 4, next); - ABTS_INT_EQUAL(tc, 0, ogs_queue_size(q)); - ogs_queue_drain(q, queue_cleanup); - ABTS_INT_EQUAL(tc, 4, next); - ABTS_INT_EQUAL(tc, OGS_DONE, ogs_queue_trypush(q, &items[0])); - ogs_queue_destroy(q); -} - abts_suite *test_queue(abts_suite *suite) { suite = ADD_SUITE(suite) abts_run_test(suite, test_queue_producer_consumer, NULL); abts_run_test(suite, test_queue_timeout, NULL); - abts_run_test(suite, test_queue_drain, NULL); return suite; } diff --git a/tests/registration/dereg-test.c b/tests/registration/dereg-test.c index 10de1b05e..124f04fc7 100644 --- a/tests/registration/dereg-test.c +++ b/tests/registration/dereg-test.c @@ -1896,7 +1896,6 @@ static void test7_issues4209_func(abts_case *tc, void *data) ogs_pkbuf_t *recvbuf; ogs_ngap_message_t message; int i; - uint64_t ran_ue_ngap_id, amf_ue_ngap_id; ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci; test_ue_t *test_ue = NULL; @@ -2096,33 +2095,6 @@ static void test7_issues4209_func(abts_case *tc, void *data) rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); - /* - * The first release is sent after the AMF checks the deregistration - * request. Wait for it before a new InitialUEMessage can advance - * the uplink NAS COUNT ahead of the pending deregistration. - * Receiving the old release changes the test UE's NGAP IDs, so keep - * the deregistration connection's IDs for the next InitialUEMessage. - */ - ran_ue_ngap_id = test_ue->ran_ue_ngap_id; - amf_ue_ngap_id = test_ue->amf_ue_ngap_id; - - /* OLD Receive UEContextReleaseCommand */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_UEContextRelease, - test_ue->ngap_procedure_code); - - /* Send OLD UEContextReleaseComplete */ - sendbuf = testngap_build_ue_context_release_complete(test_ue); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - test_ue->ran_ue_ngap_id = ran_ue_ngap_id; - test_ue->amf_ue_ngap_id = amf_ue_ngap_id; - /* Send Registration request */ memset(&test_ue->registration_request_param, 0, sizeof(test_ue->registration_request_param)); @@ -2144,6 +2116,20 @@ static void test7_issues4209_func(abts_case *tc, void *data) rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* OLD Receive UEContextReleaseCommand */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_UEContextRelease, + test_ue->ngap_procedure_code); + + /* Send OLD UEContextReleaseComplete */ + sendbuf = testngap_build_ue_context_release_complete(test_ue); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* Receive Authentication request */ recvbuf = testgnb_ngap_read(ngap); ABTS_PTR_NOTNULL(tc, recvbuf); @@ -2267,33 +2253,6 @@ static void test7_issues4209_func(abts_case *tc, void *data) rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); - /* - * The first release is sent after the AMF checks the deregistration - * request. Wait for it before a new InitialUEMessage can advance - * the uplink NAS COUNT ahead of the pending deregistration. - * Receiving the old release changes the test UE's NGAP IDs, so keep - * the deregistration connection's IDs for the next InitialUEMessage. - */ - ran_ue_ngap_id = test_ue->ran_ue_ngap_id; - amf_ue_ngap_id = test_ue->amf_ue_ngap_id; - - /* OLD Receive UEContextReleaseCommand */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_UEContextRelease, - test_ue->ngap_procedure_code); - - /* Send OLD UEContextReleaseComplete */ - sendbuf = testngap_build_ue_context_release_complete(test_ue); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - test_ue->ran_ue_ngap_id = ran_ue_ngap_id; - test_ue->amf_ue_ngap_id = amf_ue_ngap_id; - /* Send Registration request * - Update Registration request type * - Uplink Data Status */ @@ -2334,6 +2293,20 @@ static void test7_issues4209_func(abts_case *tc, void *data) rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* OLD Receive UEContextReleaseCommand */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_UEContextRelease, + test_ue->ngap_procedure_code); + + /* Send OLD UEContextReleaseComplete */ + sendbuf = testngap_build_ue_context_release_complete(test_ue); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* Receive InitialContextSetupRequest + * Registration accept */ recvbuf = testgnb_ngap_read(ngap); diff --git a/tests/registration/guti-test.c b/tests/registration/guti-test.c index a164d19c4..329d68f55 100644 --- a/tests/registration/guti-test.c +++ b/tests/registration/guti-test.c @@ -1247,7 +1247,6 @@ static void test_issues2839_func(abts_case *tc, void *data) ogs_ngap_message_t message; int i; - uint64_t old_ran_ue_ngap_id, old_amf_ue_ngap_id; uint64_t ran_ue_ngap_id; /* gNB-UE-NGAP-ID received from gNB */ uint64_t amf_ue_ngap_id; /* AMF-UE-NGAP-ID received from AMF */ @@ -1394,14 +1393,6 @@ static void test_issues2839_func(abts_case *tc, void *data) rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); - /* Receive Configuration update command */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_DownlinkNASTransport, - test_ue->ngap_procedure_code); - /* Send PDU session establishment request */ sess = test_sess_add_by_dnn_and_psi(test_ue, "internet", 5); ogs_assert(sess); @@ -1424,25 +1415,6 @@ static void test_issues2839_func(abts_case *tc, void *data) rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); - /* - * Wait until the AMF has processed the old connection's UL NAS - * before a new InitialUEMessage can put that connection on hold. - * Keep its NGAP setup response pending while registering again. - */ - old_ran_ue_ngap_id = test_ue->ran_ue_ngap_id; - old_amf_ue_ngap_id = test_ue->amf_ue_ngap_id; - - /* Receive PDUSessionResourceSetupRequest + - * DL NAS transport + PDU session establishment accept */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_PDUSessionResourceSetup, - test_ue->ngap_procedure_code); - ABTS_INT_EQUAL(tc, old_ran_ue_ngap_id, test_ue->ran_ue_ngap_id); - ABTS_INT_EQUAL(tc, old_amf_ue_ngap_id, test_ue->amf_ue_ngap_id); - /* Send Registration request * - Update Registration request type * - Uplink Data Status */ @@ -1467,6 +1439,14 @@ static void test_issues2839_func(abts_case *tc, void *data) rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* Receive Configuration update command */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_DownlinkNASTransport, + test_ue->ngap_procedure_code); + /* OLD Receive UEContextReleaseCommand */ recvbuf = testgnb_ngap_read(ngap); ABTS_PTR_NOTNULL(tc, recvbuf); @@ -1488,11 +1468,15 @@ static void test_issues2839_func(abts_case *tc, void *data) ran_ue_ngap_id = test_ue->ran_ue_ngap_id; amf_ue_ngap_id = test_ue->amf_ue_ngap_id; - ABTS_INT_EQUAL(tc, old_ran_ue_ngap_id + 1, ran_ue_ngap_id); - ABTS_INT_EQUAL(tc, old_amf_ue_ngap_id + 1, amf_ue_ngap_id); + /* Receive PDUSessionResourceSetupRequest + + * DL NAS transport + + * PDU session establishment accept */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); - test_ue->ran_ue_ngap_id = old_ran_ue_ngap_id; - test_ue->amf_ue_ngap_id = old_amf_ue_ngap_id; + ABTS_INT_EQUAL(tc, ran_ue_ngap_id, test_ue->ran_ue_ngap_id + 1); + ABTS_INT_EQUAL(tc, amf_ue_ngap_id, test_ue->amf_ue_ngap_id + 1); /* Send OLD UEContextReleaseComplete */ sendbuf = testngap_build_ue_context_release_complete(test_ue); diff --git a/tests/sctp/sctp-test.c b/tests/sctp/sctp-test.c index f22ed36c5..436185293 100644 --- a/tests/sctp/sctp-test.c +++ b/tests/sctp/sctp-test.c @@ -200,7 +200,9 @@ static void test4_main(void *data) size = ogs_sctp_recvdata(sctp, str, STRLEN, NULL, &sinfo); ABTS_INT_EQUAL(tc, strlen(DATASTR), size); +#if !HAVE_USRSCTP ABTS_INT_EQUAL(tc, PPID, sinfo.ppid); +#endif ogs_sctp_destroy(sctp); diff --git a/tests/unit/sbi-message-test.c b/tests/unit/sbi-message-test.c index eddc39037..73e4653d3 100644 --- a/tests/unit/sbi-message-test.c +++ b/tests/unit/sbi-message-test.c @@ -1201,12 +1201,12 @@ static void sbi_message_test12(abts_case *tc, void *data) static void sbi_message_test13(abts_case *tc, void *data) { const char *cases[] = { - ("{\"authType\":\"5G_AKA\",\"5gAuthData\":{" + "{\"authType\":\"5G_AKA\",\"5gAuthData\":{" "\"rand\":\"00112233445566778899aabbccddeeff\"," "\"hxresStar\":\"00112233445566778899aabbccddeeff\"," - "\"autn\":\"00112233445566778899aabbccddeeff\"},\"_links\":{}}"), - ("{\"authType\":\"EAP_AKA_PRIME\"," - "\"5gAuthData\":\"cGF5bG9hZA==\",\"_links\":{}}"), + "\"autn\":\"00112233445566778899aabbccddeeff\"},\"_links\":{}}", + "{\"authType\":\"EAP_AKA_PRIME\"," + "\"5gAuthData\":\"cGF5bG9hZA==\",\"_links\":{}}", "{\"authType\":\"EAP_AKA_PRIME\",\"5gAuthData\":null,\"_links\":{}}" }; OpenAPI_ue_authentication_ctx_t *ctx, *copy;