|
10 | 10 |
|
11 | 11 | #include "../rrc/rrc_ue_test_messages.h" |
12 | 12 | #include "cu_cp_test_helpers.h" |
13 | | -#include "lib/e1ap/common/e1ap_asn1_utils.h" |
14 | 13 | #include "srsran/asn1/f1ap/f1ap.h" |
15 | 14 | #include "srsran/ngap/ngap_types.h" |
16 | 15 | #include "srsran/ran/cu_types.h" |
@@ -466,6 +465,37 @@ TEST_F(cu_cp_test, when_unsupported_inactivity_message_received_then_ue_context_ |
466 | 465 | asn1::ngap::ngap_elem_procs_o::init_msg_c::types_opts::ue_context_release_request); |
467 | 466 | } |
468 | 467 |
|
| 468 | +////////////////////////////////////////////////////////////////////////////////////// |
| 469 | +/* AMF initiated PDU Session Release */ |
| 470 | +////////////////////////////////////////////////////////////////////////////////////// |
| 471 | + |
| 472 | +TEST_F(cu_cp_test, when_pdu_session_resource_release_command_received_then_release_command_is_sent_to_cu_up_first) |
| 473 | +{ |
| 474 | + // Test preamble |
| 475 | + du_index_t du_index = uint_to_du_index(0); |
| 476 | + gnb_cu_ue_f1ap_id_t cu_ue_id = int_to_gnb_cu_ue_f1ap_id(0); |
| 477 | + gnb_du_ue_f1ap_id_t du_ue_id = int_to_gnb_du_ue_f1ap_id(0); |
| 478 | + rnti_t crnti = to_rnti(0x4601); |
| 479 | + pci_t pci = 1; |
| 480 | + amf_ue_id_t amf_ue_id = uint_to_amf_ue_id( |
| 481 | + test_rgen::uniform_int<uint64_t>(amf_ue_id_to_uint(amf_ue_id_t::min), amf_ue_id_to_uint(amf_ue_id_t::max))); |
| 482 | + ran_ue_id_t ran_ue_id = uint_to_ran_ue_id(0); |
| 483 | + gnb_cu_cp_ue_e1ap_id_t cu_cp_ue_e1ap_id = int_to_gnb_cu_cp_ue_e1ap_id(0); |
| 484 | + gnb_cu_up_ue_e1ap_id_t cu_up_ue_e1ap_id = int_to_gnb_cu_up_ue_e1ap_id(0); |
| 485 | + |
| 486 | + test_preamble_ue_full_attach( |
| 487 | + du_index, du_ue_id, cu_ue_id, pci, crnti, amf_ue_id, ran_ue_id, cu_cp_ue_e1ap_id, cu_up_ue_e1ap_id); |
| 488 | + |
| 489 | + // Inject PduSessionResourceReleaseCommand |
| 490 | + cu_cp_obj->get_ngap_message_handler().handle_message( |
| 491 | + generate_valid_pdu_session_resource_release_command(amf_ue_id, ran_ue_id, uint_to_pdu_session_id(1))); |
| 492 | + |
| 493 | + // Check that the Bearer Context Release Command was sent to the CU-UP first |
| 494 | + ASSERT_EQ(e1ap_gw.last_tx_pdus(0).back().pdu.type(), asn1::e1ap::e1ap_pdu_c::types_opts::options::init_msg); |
| 495 | + ASSERT_EQ(e1ap_gw.last_tx_pdus(0).back().pdu.init_msg().value.type().value, |
| 496 | + asn1::e1ap::e1ap_elem_procs_o::init_msg_c::types_opts::bearer_context_release_cmd); |
| 497 | +} |
| 498 | + |
469 | 499 | ////////////////////////////////////////////////////////////////////////////////////// |
470 | 500 | /* AMF initiated UE Context Release */ |
471 | 501 | ////////////////////////////////////////////////////////////////////////////////////// |
|
0 commit comments