@@ -79,6 +79,18 @@ class f1ap_du_ue_context_setup_test : public f1ap_du_test
7979 }
8080
8181 f1ap->handle_message (msg);
82+
83+ if (not ue_ctx_setup.gnb_du_ue_f1ap_id_present ) {
84+ report_fatal_error_if_not (this ->f1ap_du_cfg_handler .last_ue_creation_response .has_value (),
85+ " UE should have been created" );
86+ test_ue->f1c_bearers [srb_id_to_uint (srb_id_t ::srb1)].bearer =
87+ this ->f1ap_du_cfg_handler .last_ue_creation_response .value ().f1c_bearers_added [0 ];
88+ }
89+ }
90+
91+ void on_rrc_container_transmitted (uint32_t highest_pdcp_sn)
92+ {
93+ this ->test_ue ->f1c_bearers [LCID_SRB1].bearer ->handle_transmit_notification (highest_pdcp_sn);
8294 }
8395
8496 ue_test_context* test_ue = nullptr ;
@@ -110,6 +122,10 @@ TEST_F(f1ap_du_ue_context_setup_test, when_f1ap_receives_request_then_f1ap_respo
110122 gnb_cu_ue_f1ap_id_t {0 }, gnb_du_ue_f1ap_id_t {0 }, 1 , {drb_id_t ::drb1});
111123 start_procedure (msg);
112124
125+ // Lower layers handle RRC container.
126+ this ->f1c_gw .last_tx_f1ap_pdu = {};
127+ on_rrc_container_transmitted (1 );
128+
113129 // F1AP sends UE CONTEXT SETUP RESPONSE to CU-CP.
114130 ASSERT_EQ (this ->f1c_gw .last_tx_f1ap_pdu .pdu .type ().value , f1ap_pdu_c::types_opts::successful_outcome);
115131 ASSERT_EQ (this ->f1c_gw .last_tx_f1ap_pdu .pdu .successful_outcome ().value .type ().value ,
@@ -168,9 +184,8 @@ TEST_F(f1ap_du_ue_context_setup_test, when_f1ap_receives_request_then_new_srbs_b
168184
169185TEST_F (f1ap_du_ue_context_setup_test, when_f1ap_receives_request_without_gnb_du_ue_f1ap_id_then_ue_is_created)
170186{
171- f1ap_message msg = test_helpers::create_ue_context_setup_request (
172- gnb_cu_ue_f1ap_id_t {0 }, gnb_du_ue_f1ap_id_t {0 }, 1 , {drb_id_t ::drb1});
173- msg.pdu .init_msg ().value .ue_context_setup_request ()->gnb_du_ue_f1ap_id_present = false ;
187+ f1ap_message msg =
188+ test_helpers::create_ue_context_setup_request (gnb_cu_ue_f1ap_id_t {0 }, std::nullopt , 1 , {drb_id_t ::drb1});
174189
175190 start_procedure (msg);
176191
@@ -180,9 +195,8 @@ TEST_F(f1ap_du_ue_context_setup_test, when_f1ap_receives_request_without_gnb_du_
180195
181196TEST_F (f1ap_du_ue_context_setup_test, when_f1ap_receives_request_without_gnb_du_ue_f1ap_id_then_ue_context_is_updated)
182197{
183- f1ap_message msg = test_helpers::create_ue_context_setup_request (
184- gnb_cu_ue_f1ap_id_t {0 }, gnb_du_ue_f1ap_id_t {0 }, 1 , {drb_id_t ::drb1});
185- msg.pdu .init_msg ().value .ue_context_setup_request ()->gnb_du_ue_f1ap_id_present = false ;
198+ f1ap_message msg =
199+ test_helpers::create_ue_context_setup_request (gnb_cu_ue_f1ap_id_t {0 }, std::nullopt , 1 , {drb_id_t ::drb1});
186200
187201 start_procedure (msg);
188202
@@ -199,11 +213,11 @@ TEST_F(
199213 f1ap_du_ue_context_setup_test,
200214 when_f1ap_receives_request_without_gnb_du_ue_f1ap_id_then_ue_context_setup_response_is_sent_to_cu_cp_with_crnti_ie)
201215{
202- f1ap_message msg = test_helpers::create_ue_context_setup_request (
203- gnb_cu_ue_f1ap_id_t {0 }, gnb_du_ue_f1ap_id_t {0 }, 1 , {drb_id_t ::drb1});
204- msg.pdu .init_msg ().value .ue_context_setup_request ()->gnb_du_ue_f1ap_id_present = false ;
216+ f1ap_message msg =
217+ test_helpers::create_ue_context_setup_request (gnb_cu_ue_f1ap_id_t {0 }, std::nullopt , 1 , {drb_id_t ::drb1});
205218
206219 start_procedure (msg);
220+ on_rrc_container_transmitted (1 );
207221
208222 // F1AP sends UE CONTEXT SETUP RESPONSE to CU-CP.
209223 ASSERT_EQ (this ->f1c_gw .last_tx_f1ap_pdu .pdu .type ().value , f1ap_pdu_c::types_opts::successful_outcome);
0 commit comments