Revert "tests: Fix Clang warning and stabilize GUTI registration"

This reverts commit f65500c3af.
This commit is contained in:
Sukchan Lee 2026-09-29 08:58:43 +09:00
parent f65500c3af
commit cdc1805d6b
20 changed files with 77 additions and 234 deletions

View file

@ -114,13 +114,12 @@ static int queue_push(ogs_queue_t *queue, void *data, ogs_time_t timeout)
{ {
int rv; int rv;
ogs_thread_mutex_lock(&queue->one_big_mutex);
if (queue->terminated) { if (queue->terminated) {
ogs_thread_mutex_unlock(&queue->one_big_mutex);
return OGS_DONE; /* no more elements ever again */ return OGS_DONE; /* no more elements ever again */
} }
ogs_thread_mutex_lock(&queue->one_big_mutex);
if (ogs_queue_full(queue)) { if (ogs_queue_full(queue)) {
if (!timeout) { if (!timeout) {
ogs_thread_mutex_unlock(&queue->one_big_mutex); 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; return rv;
} }
} }
if (queue->terminated) { /* If we wake up and it's still empty, then we were interrupted */
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 (ogs_queue_full(queue)) { if (ogs_queue_full(queue)) {
ogs_warn("queue full (intr)"); ogs_warn("queue full (intr)");
ogs_thread_mutex_unlock(&queue->one_big_mutex); 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; int rv;
ogs_thread_mutex_lock(&queue->one_big_mutex);
if (queue->terminated) { if (queue->terminated) {
ogs_thread_mutex_unlock(&queue->one_big_mutex);
return OGS_DONE; /* no more elements ever again */ 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. */ /* Keep waiting until we wake up and find that the queue is not empty. */
if (ogs_queue_empty(queue)) { if (ogs_queue_empty(queue)) {
if (!timeout) { if (!timeout) {
@ -238,15 +237,15 @@ static int queue_pop(ogs_queue_t *queue, void **data, ogs_time_t timeout)
return rv; 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 we wake up and it's still empty, then we were interrupted */
if (ogs_queue_empty(queue)) { if (ogs_queue_empty(queue)) {
ogs_warn("queue empty (intr)"); ogs_warn("queue empty (intr)");
ogs_thread_mutex_unlock(&queue->one_big_mutex); 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); 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);
}

View file

@ -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_interrupt_all(ogs_queue_t *queue);
int ogs_queue_term(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 #ifdef __cplusplus
} }

View file

@ -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(&rcv_info, 0, sizeof rcv_info);
memset(&addr, 0, sizeof addr); memset(&addr, 0, sizeof addr);
infolen = sizeof rcv_info;
n = usrsctp_recvv(socket, msg, len, n = usrsctp_recvv(socket, msg, len,
&addr.sa, &addrlen, &addr.sa, &addrlen,
(void *)&rcv_info, (void *)&rcv_info,

View file

@ -383,7 +383,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e)
e->h.sbi.message = &sbi_message; e->h.sbi.message = &sbi_message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -81,37 +81,6 @@ int amf_initialize(void)
static ogs_timer_t *t_termination_holding = NULL; 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) static void event_termination(void)
{ {
ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL;
@ -146,9 +115,6 @@ void amf_terminate(void)
ngap_close(); ngap_close();
amf_sbi_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()); ogs_metrics_context_close(ogs_metrics_self());
amf_context_final(); amf_context_final();

View file

@ -245,7 +245,7 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e)
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -322,7 +322,7 @@ cleanup:
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -203,7 +203,7 @@ void eir_state_operational(ogs_fsm_t *s, eir_event_t *e)
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -251,7 +251,7 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e)
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -411,7 +411,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e)
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -197,7 +197,7 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e)
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -271,7 +271,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e)
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } 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 * The SEPP on the H-PLMN should send a n32c-handshake message

View file

@ -885,7 +885,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e)
e->h.sbi.message = &sbi_message; e->h.sbi.message = &sbi_message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -343,7 +343,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e)
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -255,7 +255,7 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e)
e->h.sbi.message = &message; e->h.sbi.message = &message;
ogs_fsm_dispatch(&nf_instance->sm, e); ogs_fsm_dispatch(&nf_instance->sm, e);
} else } else
ogs_warn("NF instance FSM has been finalized"); ogs_error("NF instance FSM has been finalized");
break; break;

View file

@ -166,64 +166,12 @@ static void test_queue_timeout(abts_case *tc, void *data)
ogs_queue_destroy(q); 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) abts_suite *test_queue(abts_suite *suite)
{ {
suite = ADD_SUITE(suite) suite = ADD_SUITE(suite)
abts_run_test(suite, test_queue_producer_consumer, NULL); abts_run_test(suite, test_queue_producer_consumer, NULL);
abts_run_test(suite, test_queue_timeout, NULL); abts_run_test(suite, test_queue_timeout, NULL);
abts_run_test(suite, test_queue_drain, NULL);
return suite; return suite;
} }

View file

@ -1896,7 +1896,6 @@ static void test7_issues4209_func(abts_case *tc, void *data)
ogs_pkbuf_t *recvbuf; ogs_pkbuf_t *recvbuf;
ogs_ngap_message_t message; ogs_ngap_message_t message;
int i; int i;
uint64_t ran_ue_ngap_id, amf_ue_ngap_id;
ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci; ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci;
test_ue_t *test_ue = NULL; 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); rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv); 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 */ /* Send Registration request */
memset(&test_ue->registration_request_param, 0, memset(&test_ue->registration_request_param, 0,
sizeof(test_ue->registration_request_param)); 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); rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv); 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 */ /* Receive Authentication request */
recvbuf = testgnb_ngap_read(ngap); recvbuf = testgnb_ngap_read(ngap);
ABTS_PTR_NOTNULL(tc, recvbuf); 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); rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv); 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 /* Send Registration request
* - Update Registration request type * - Update Registration request type
* - Uplink Data Status */ * - Uplink Data Status */
@ -2334,6 +2293,20 @@ static void test7_issues4209_func(abts_case *tc, void *data)
rv = testgnb_ngap_send(ngap, sendbuf); rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv); 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 + /* Receive InitialContextSetupRequest +
* Registration accept */ * Registration accept */
recvbuf = testgnb_ngap_read(ngap); recvbuf = testgnb_ngap_read(ngap);

View file

@ -1247,7 +1247,6 @@ static void test_issues2839_func(abts_case *tc, void *data)
ogs_ngap_message_t message; ogs_ngap_message_t message;
int i; 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 ran_ue_ngap_id; /* gNB-UE-NGAP-ID received from gNB */
uint64_t amf_ue_ngap_id; /* AMF-UE-NGAP-ID received from AMF */ 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); rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv); 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 */ /* Send PDU session establishment request */
sess = test_sess_add_by_dnn_and_psi(test_ue, "internet", 5); sess = test_sess_add_by_dnn_and_psi(test_ue, "internet", 5);
ogs_assert(sess); ogs_assert(sess);
@ -1424,25 +1415,6 @@ static void test_issues2839_func(abts_case *tc, void *data)
rv = testgnb_ngap_send(ngap, sendbuf); rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv); 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 /* Send Registration request
* - Update Registration request type * - Update Registration request type
* - Uplink Data Status */ * - Uplink Data Status */
@ -1467,6 +1439,14 @@ static void test_issues2839_func(abts_case *tc, void *data)
rv = testgnb_ngap_send(ngap, sendbuf); rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv); 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 */ /* OLD Receive UEContextReleaseCommand */
recvbuf = testgnb_ngap_read(ngap); recvbuf = testgnb_ngap_read(ngap);
ABTS_PTR_NOTNULL(tc, recvbuf); 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; ran_ue_ngap_id = test_ue->ran_ue_ngap_id;
amf_ue_ngap_id = test_ue->amf_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); /* Receive PDUSessionResourceSetupRequest +
ABTS_INT_EQUAL(tc, old_amf_ue_ngap_id + 1, amf_ue_ngap_id); * 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; ABTS_INT_EQUAL(tc, ran_ue_ngap_id, test_ue->ran_ue_ngap_id + 1);
test_ue->amf_ue_ngap_id = old_amf_ue_ngap_id; ABTS_INT_EQUAL(tc, amf_ue_ngap_id, test_ue->amf_ue_ngap_id + 1);
/* Send OLD UEContextReleaseComplete */ /* Send OLD UEContextReleaseComplete */
sendbuf = testngap_build_ue_context_release_complete(test_ue); sendbuf = testngap_build_ue_context_release_complete(test_ue);

View file

@ -200,7 +200,9 @@ static void test4_main(void *data)
size = ogs_sctp_recvdata(sctp, str, STRLEN, NULL, &sinfo); size = ogs_sctp_recvdata(sctp, str, STRLEN, NULL, &sinfo);
ABTS_INT_EQUAL(tc, strlen(DATASTR), size); ABTS_INT_EQUAL(tc, strlen(DATASTR), size);
#if !HAVE_USRSCTP
ABTS_INT_EQUAL(tc, PPID, sinfo.ppid); ABTS_INT_EQUAL(tc, PPID, sinfo.ppid);
#endif
ogs_sctp_destroy(sctp); ogs_sctp_destroy(sctp);

View file

@ -1201,12 +1201,12 @@ static void sbi_message_test12(abts_case *tc, void *data)
static void sbi_message_test13(abts_case *tc, void *data) static void sbi_message_test13(abts_case *tc, void *data)
{ {
const char *cases[] = { const char *cases[] = {
("{\"authType\":\"5G_AKA\",\"5gAuthData\":{" "{\"authType\":\"5G_AKA\",\"5gAuthData\":{"
"\"rand\":\"00112233445566778899aabbccddeeff\"," "\"rand\":\"00112233445566778899aabbccddeeff\","
"\"hxresStar\":\"00112233445566778899aabbccddeeff\"," "\"hxresStar\":\"00112233445566778899aabbccddeeff\","
"\"autn\":\"00112233445566778899aabbccddeeff\"},\"_links\":{}}"), "\"autn\":\"00112233445566778899aabbccddeeff\"},\"_links\":{}}",
("{\"authType\":\"EAP_AKA_PRIME\"," "{\"authType\":\"EAP_AKA_PRIME\","
"\"5gAuthData\":\"cGF5bG9hZA==\",\"_links\":{}}"), "\"5gAuthData\":\"cGF5bG9hZA==\",\"_links\":{}}",
"{\"authType\":\"EAP_AKA_PRIME\",\"5gAuthData\":null,\"_links\":{}}" "{\"authType\":\"EAP_AKA_PRIME\",\"5gAuthData\":null,\"_links\":{}}"
}; };
OpenAPI_ue_authentication_ctx_t *ctx, *copy; OpenAPI_ue_authentication_ctx_t *ctx, *copy;