Skip to content

Commit 8101f8c

Browse files
FabianEckermannFabian Eckermann
authored andcommitted
cu_cp,f1ap: refactor handling of initial ul rrc message
1 parent a85034f commit 8101f8c

File tree

12 files changed

+160
-111
lines changed

12 files changed

+160
-111
lines changed

include/srsran/f1ap/cu_cp/f1ap_cu.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,22 @@ class f1ap_rrc_message_notifier
105105
/// This request should be made once the C-RNTI and cell of the UE is known. That generally corresponds to the moment
106106
/// a Initial UL RRC Message or a F1AP UE Context Setup Response are received.
107107
struct ue_rrc_context_creation_request {
108-
ue_index_t ue_index;
109-
rnti_t c_rnti;
110-
nr_cell_global_id_t cgi;
111-
byte_buffer du_to_cu_rrc_container;
108+
ue_index_t ue_index = ue_index_t::invalid; ///> If this is invalid, a new UE will be created.
109+
rnti_t c_rnti;
110+
nr_cell_global_id_t cgi;
111+
byte_buffer du_to_cu_rrc_container;
112112
std::optional<rrc_ue_transfer_context> prev_context;
113113
};
114114

115115
/// \brief Response by CU-CP to F1AP-CU request to create UE RRC context.
116116
struct ue_rrc_context_creation_response {
117+
ue_index_t ue_index = ue_index_t::invalid;
117118
/// Notifier to be used by the F1AP to push new RRC PDUs to the UE RRC layer.
118119
f1ap_rrc_message_notifier* f1ap_rrc_notifier = nullptr;
119120
};
120121

122+
using ue_rrc_context_creation_outcome = expected<ue_rrc_context_creation_response, byte_buffer>;
123+
121124
/// Notification from the F1AP that the loss of transaction reference information for some UEs has been lost.
122125
struct f1_ue_transaction_info_loss_event {
123126
std::vector<ue_index_t> ues_lost;
@@ -143,7 +146,7 @@ class f1ap_du_processor_notifier : public du_setup_notifier, public f1ap_common_
143146
virtual ue_index_t on_new_cu_cp_ue_required() = 0;
144147

145148
/// \brief Notifies the CU-CP that an RRC context has been created for an existing CU-CP UE.
146-
virtual ue_rrc_context_creation_response
149+
virtual ue_rrc_context_creation_outcome
147150
on_ue_rrc_context_creation_request(const ue_rrc_context_creation_request& req) = 0;
148151

149152
/// \brief Indicates the reception of a UE Context Release Request (gNB-DU initiated) as per TS 38.473

lib/cu_cp/adapters/du_processor_adapters.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ class du_processor_rrc_du_adapter : public du_processor_rrc_du_ue_notifier
157157
return rrc_du_cell_handler->handle_served_cell_list(served_cell_list);
158158
}
159159

160+
byte_buffer on_rrc_reject_required() override
161+
{
162+
srsran_assert(rrc_du_handler != nullptr, "RRC DU UE handler must not be nullptr");
163+
return rrc_du_handler->get_rrc_reject();
164+
}
165+
160166
rrc_ue_interface* on_ue_creation_request(const rrc_ue_creation_message& msg) override
161167
{
162168
srsran_assert(rrc_du_handler != nullptr, "RRC DU UE handler must not be nullptr");

lib/cu_cp/adapters/f1ap_adapters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class f1ap_du_processor_adapter : public f1ap_du_processor_notifier
4343
return du_f1ap_handler->allocate_new_ue_index();
4444
}
4545

46-
ue_rrc_context_creation_response
46+
ue_rrc_context_creation_outcome
4747
on_ue_rrc_context_creation_request(const ue_rrc_context_creation_request& req) override
4848
{
4949
srsran_assert(du_f1ap_handler != nullptr, "F1AP handler must not be nullptr");

lib/cu_cp/du_processor/du_processor.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class du_processor_f1ap_interface
4141
/// This method should be called when a C-RNTI and PCell are assigned to a UE.
4242
/// \param req Request to setup a new UE RRC context.
4343
/// \return Response to whether the request was successful or failed.
44-
virtual ue_rrc_context_creation_response
44+
virtual ue_rrc_context_creation_outcome
4545
handle_ue_rrc_context_creation_request(const ue_rrc_context_creation_request& req) = 0;
4646

4747
/// \brief Handle the reception of a F1AP UE Context Release Request and notify NGAP.
@@ -131,6 +131,10 @@ class du_processor_rrc_du_ue_notifier
131131
/// \return Returns true on success, false otherwise.
132132
virtual bool on_new_served_cell_list(const std::vector<cu_cp_du_served_cells_item>& served_cell_list) = 0;
133133

134+
/// \brief Notify RRC DU about a required RRCReject.
135+
/// \return Returns a RRC Container containing the RRCReject.
136+
virtual byte_buffer on_rrc_reject_required() = 0;
137+
134138
/// \brief Notify RRC DU to create a UE.
135139
/// \param[in] msg The UE creation message.
136140
/// \return Returns a handle to the created UE.

lib/cu_cp/du_processor/du_processor_impl.cpp

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -161,48 +161,62 @@ bool du_processor_impl::create_rrc_ue(cu_cp_ue& ue,
161161
return true;
162162
}
163163

164-
ue_rrc_context_creation_response
164+
ue_rrc_context_creation_outcome
165165
du_processor_impl::handle_ue_rrc_context_creation_request(const ue_rrc_context_creation_request& req)
166166
{
167-
srsran_assert(req.ue_index != ue_index_t::invalid, "Invalid UE index");
168167
srsran_assert(req.c_rnti != rnti_t::INVALID_RNTI, "ue={}: Invalid C-RNTI", req.ue_index);
169168

169+
ue_index_t ue_index = req.ue_index;
170+
171+
if (ue_index == ue_index_t::invalid) {
172+
// Add new CU-CP UE
173+
ue_index = ue_mng.add_ue(cfg.du_index);
174+
if (ue_index == ue_index_t::invalid) {
175+
logger.warning("CU-CP UE creation failed");
176+
return make_unexpected(rrc_du_adapter.on_rrc_reject_required());
177+
}
178+
179+
/// NOTE: From this point on the UE exists in the UE manager and must be removed if any error occurs.
180+
}
181+
182+
// Lambda, that removes the UE from the UE manager and returns a RRCReject container.
183+
auto return_failure = [this](ue_index_t ue_id) {
184+
// Remove the UE from the UE manager
185+
ue_mng.remove_ue(ue_id);
186+
// Return the RRCReject container
187+
return make_unexpected(rrc_du_adapter.on_rrc_reject_required());
188+
};
189+
170190
// Check that creation message is valid
171191
const du_cell_configuration* pcell = cfg.du_cfg_hdlr->get_context().find_cell(req.cgi);
172192
if (pcell == nullptr) {
173-
srsran_assert(ue_mng.find_ue_task_scheduler(req.ue_index) != nullptr, "ue={}: Could not find UE", req.ue_index);
174-
logger.warning("ue={}: Could not find cell with NCI={}", req.ue_index, req.cgi.nci);
175-
ue_mng.find_ue_task_scheduler(req.ue_index)
176-
->schedule_async_task(cu_cp_notifier.on_ue_removal_required(req.ue_index));
177-
return {};
193+
logger.warning("ue={}: Could not find cell with NCI={}", ue_index, req.cgi.nci);
194+
return return_failure(ue_index);
178195
}
179196
const pci_t pci = pcell->pci;
180197

181198
// Create new UE RRC context
182-
cu_cp_ue* ue = ue_mng.set_ue_du_context(req.ue_index, cfg.du_cfg_hdlr->get_context().id, pci, req.c_rnti);
199+
cu_cp_ue* ue = ue_mng.set_ue_du_context(ue_index, cfg.du_cfg_hdlr->get_context().id, pci, req.c_rnti);
183200
if (ue == nullptr) {
184-
logger.warning("ue={}: Could not create UE context", req.ue_index);
185-
return {};
201+
logger.warning("ue={}: Could not create UE context", ue_index);
202+
// A UE with the same PCI and RNTI already exists, so we don't remove it and only reject the new UE.
203+
return make_unexpected(rrc_du_adapter.on_rrc_reject_required());
186204
}
187205
ue->set_pcell_index(pcell->cell_index);
188206

189207
// Create RRC UE. If the DU-to-CU-RRC-Container is empty, the UE will be rejected.
190208
if (not create_rrc_ue(*ue, req.c_rnti, req.cgi, req.du_to_cu_rrc_container.copy(), std::move(req.prev_context))) {
191-
logger.warning("ue={}: Could not create RRC UE object", req.ue_index);
192-
return {};
209+
logger.warning("ue={}: Could not create RRC UE object", ue_index);
210+
return return_failure(ue_index);
193211
}
194-
rrc_ue_interface* rrc_ue = rrc->find_ue(req.ue_index);
195-
f1ap_rrc_ue_adapters[req.ue_index] = {};
196-
f1ap_rrc_ue_adapters.at(req.ue_index)
197-
.connect_rrc_ue(rrc_ue->get_ul_ccch_pdu_handler(), rrc_ue->get_ul_dcch_pdu_handler());
198-
199-
// Signal back to F1AP that the UE was successfully created.
200-
ue_rrc_context_creation_response response;
201-
response.f1ap_rrc_notifier = &f1ap_rrc_ue_adapters.at(req.ue_index);
212+
rrc_ue_interface* rrc_ue = rrc->find_ue(ue_index);
213+
f1ap_rrc_ue_adapters[ue_index] = {};
214+
f1ap_rrc_ue_adapters.at(ue_index).connect_rrc_ue(rrc_ue->get_ul_ccch_pdu_handler(),
215+
rrc_ue->get_ul_dcch_pdu_handler());
202216

217+
// Signal back that the UE was successfully created.
203218
logger.info("ue={} c-rnti={}: UE created", ue->get_ue_index(), req.c_rnti);
204-
205-
return response;
219+
return ue_rrc_context_creation_response{ue_index, &f1ap_rrc_ue_adapters.at(ue_index)};
206220
}
207221

208222
void du_processor_impl::handle_du_initiated_ue_context_release_request(const f1ap_ue_context_release_request& request)

lib/cu_cp/du_processor/du_processor_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class du_processor_impl : public du_processor,
6262
// du_processor_f1ap_interface
6363
du_setup_result handle_du_setup_request(const du_setup_request& req) override;
6464
ue_index_t allocate_new_ue_index() override;
65-
ue_rrc_context_creation_response
65+
ue_rrc_context_creation_outcome
6666
handle_ue_rrc_context_creation_request(const ue_rrc_context_creation_request& req) override;
6767
void handle_du_initiated_ue_context_release_request(const f1ap_ue_context_release_request& request) override;
6868
async_task<void> handle_ue_transaction_info_loss(const f1_ue_transaction_info_loss_event& request) override;

lib/f1ap/cu_cp/f1ap_cu_impl.cpp

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -239,25 +239,20 @@ void f1ap_cu_impl::handle_initial_ul_rrc_message(const init_ul_rrc_msg_transfer_
239239
logger.debug("du_ue={}: Ignoring SUL access indicator", du_ue_id);
240240
}
241241

242+
if (msg->rrc_container_rrc_setup_complete_present) {
243+
logger.debug("du_ue={}: Ignoring RRC Container RRCSetupComplete", du_ue_id);
244+
}
245+
242246
const gnb_cu_ue_f1ap_id_t cu_ue_f1ap_id = ue_ctxt_list.allocate_gnb_cu_ue_f1ap_id();
243247
if (cu_ue_f1ap_id == gnb_cu_ue_f1ap_id_t::invalid) {
244248
logger.warning("du_ue={}: Dropping InitialULRRCMessageTransfer. Cause: Failed to allocate CU-UE-F1AP-ID", du_ue_id);
245249
return;
246250
}
247251

248-
// Create CU-CP UE instance.
249-
const ue_index_t ue_index = du_processor_notifier.on_new_cu_cp_ue_required();
250-
if (ue_index == ue_index_t::invalid) {
251-
logger.warning("du_ue={}: Dropping InitialULRRCMessageTransfer. Cause: CU-CP UE creation failed",
252-
msg->gnb_du_ue_f1ap_id);
253-
return;
254-
}
255-
256-
// Update the UE RRC context (e.g. C-RNTI, PCell) in the CU-CP.
252+
// Request RRC UE creation in the DU processor.
257253
ue_rrc_context_creation_request req;
258-
req.ue_index = ue_index;
259-
req.c_rnti = crnti;
260-
req.cgi = cgi.value();
254+
req.c_rnti = crnti;
255+
req.cgi = cgi.value();
261256
if (msg->du_to_cu_rrc_container_present) {
262257
req.du_to_cu_rrc_container = byte_buffer(msg->du_to_cu_rrc_container);
263258
} else {
@@ -268,33 +263,37 @@ void f1ap_cu_impl::handle_initial_ul_rrc_message(const init_ul_rrc_msg_transfer_
268263
du_ue_id);
269264
req.du_to_cu_rrc_container = byte_buffer{};
270265
}
271-
const ue_rrc_context_creation_response resp = du_processor_notifier.on_ue_rrc_context_creation_request(req);
272-
273-
// Remove the UE if the creation was not successful
274-
if (resp.f1ap_rrc_notifier == nullptr) {
275-
logger.warning("du_ue={}: Dropping InitialULRRCMessageTransfer. Cause: UE RRC context creation failed",
276-
msg->gnb_du_ue_f1ap_id);
266+
ue_rrc_context_creation_outcome resp = du_processor_notifier.on_ue_rrc_context_creation_request(req);
267+
268+
// Reject the UE if the creation was not successful
269+
if (not resp.has_value()) {
270+
asn1::f1ap::dl_rrc_msg_transfer_s dl_rrc_msg = {};
271+
dl_rrc_msg->gnb_cu_ue_f1ap_id = gnb_cu_ue_f1ap_id_to_uint(cu_ue_f1ap_id);
272+
dl_rrc_msg->gnb_du_ue_f1ap_id = gnb_du_ue_f1ap_id_to_uint(du_ue_id);
273+
dl_rrc_msg->srb_id = srb_id_to_uint(srb_id_t::srb0);
274+
dl_rrc_msg->rrc_container = resp.error().copy();
275+
276+
// Pack message into PDU
277+
f1ap_message f1ap_dl_rrc_msg;
278+
f1ap_dl_rrc_msg.pdu.set_init_msg();
279+
f1ap_dl_rrc_msg.pdu.init_msg().load_info_obj(ASN1_F1AP_ID_DL_RRC_MSG_TRANSFER);
280+
f1ap_dl_rrc_msg.pdu.init_msg().value.dl_rrc_msg_transfer() = std::move(dl_rrc_msg);
281+
282+
// send DL RRC message
283+
tx_pdu_notifier.on_new_message(f1ap_dl_rrc_msg);
277284
return;
278285
}
279286

280287
// Create UE context and store it
281-
ue_ctxt_list.add_ue(ue_index, cu_ue_f1ap_id);
288+
ue_ctxt_list.add_ue(resp->ue_index, cu_ue_f1ap_id);
282289
ue_ctxt_list.add_du_ue_f1ap_id(cu_ue_f1ap_id, du_ue_id);
283-
ue_ctxt_list.add_rrc_notifier(ue_index, resp.f1ap_rrc_notifier);
290+
ue_ctxt_list.add_rrc_notifier(resp->ue_index, resp->f1ap_rrc_notifier);
284291
f1ap_ue_context& ue_ctxt = ue_ctxt_list[cu_ue_f1ap_id];
285292

286293
ue_ctxt.logger.log_info("Added UE context");
287294

288-
// Forward RRC container
289-
if (msg->rrc_container_rrc_setup_complete_present) {
290-
// RRC setup complete over SRB1
291-
ue_ctxt_list[cu_ue_f1ap_id].rrc_notifier->on_ul_dcch_pdu(srb_id_t::srb1,
292-
msg->rrc_container_rrc_setup_complete.copy());
293-
return;
294-
}
295-
296-
// Pass RRC container to RRC
297-
ue_ctxt_list[cu_ue_f1ap_id].rrc_notifier->on_ul_ccch_pdu(msg->rrc_container.copy());
295+
// Forward RRC container to RRC UE
296+
ue_ctxt.rrc_notifier->on_ul_ccch_pdu(byte_buffer(msg->rrc_container));
298297
}
299298

300299
void f1ap_cu_impl::handle_ul_rrc_message(const ul_rrc_msg_transfer_s& msg)

lib/f1ap/cu_cp/procedures/ue_context_setup_procedure.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ bool ue_context_setup_procedure::create_ue_rrc_context(const f1ap_ue_context_set
124124
req.du_to_cu_rrc_container = ue_ctxt_setup_resp.du_to_cu_rrc_info.cell_group_cfg.copy();
125125
req.prev_context = std::move(rrc_context);
126126

127-
ue_rrc_context_creation_response resp = du_processor_notifier.on_ue_rrc_context_creation_request(req);
128-
if (resp.f1ap_rrc_notifier == nullptr) {
127+
ue_rrc_context_creation_outcome outcome = du_processor_notifier.on_ue_rrc_context_creation_request(req);
128+
if (not outcome.has_value()) {
129129
logger.warning("Couldn't create UE RRC context in target cell");
130130
return false;
131131
}
132132

133133
// Add RRC notifier to F1AP UE context.
134-
ue_ctxt_list.add_rrc_notifier(req.ue_index, resp.f1ap_rrc_notifier);
134+
ue_ctxt_list.add_rrc_notifier(outcome->ue_index, outcome->f1ap_rrc_notifier);
135135

136-
logger.debug("ue={} Added RRC UE notifier", req.ue_index);
136+
logger.debug("ue={} Added RRC UE notifier", outcome->ue_index);
137137
}
138138

139139
return true;

tests/unittests/cu_cp/du_processor/du_processor_test.cpp

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,13 @@ TEST_F(du_processor_test, when_ue_creation_msg_valid_then_ue_added)
9898
test_helpers::generate_f1_setup_request());
9999

100100
// Generate ue_creation message
101-
ue_index_t ue_index = du_processor_obj->get_f1ap_interface().allocate_new_ue_index();
102-
ue_rrc_context_creation_request req = generate_ue_rrc_context_creation_request(
103-
ue_index, rnti_t::MIN_CRNTI, nr_cell_identity::create(gnb_id_t{411, 22}, 0).value());
101+
ue_rrc_context_creation_request req = generate_ue_rrc_context_creation_request(
102+
ue_index_t::invalid, rnti_t::MIN_CRNTI, nr_cell_identity::create(gnb_id_t{411, 22}, 0).value());
104103

105104
// Pass message to DU processor
106-
ue_rrc_context_creation_response resp =
105+
ue_rrc_context_creation_outcome outcome =
107106
du_processor_obj->get_f1ap_interface().handle_ue_rrc_context_creation_request(req);
108-
ASSERT_NE(resp.f1ap_rrc_notifier, nullptr);
107+
ASSERT_TRUE(outcome.has_value());
109108

110109
ASSERT_EQ(du_processor_obj->get_statistics_handler().get_nof_ues(), 1);
111110
}
@@ -117,14 +116,13 @@ TEST_F(du_processor_test, when_cell_id_invalid_then_ue_creation_fails)
117116
test_helpers::generate_f1_setup_request());
118117

119118
// Generate ue_creation message
120-
ue_index_t ue_index = du_processor_obj->get_f1ap_interface().allocate_new_ue_index();
121-
ue_rrc_context_creation_request req =
122-
generate_ue_rrc_context_creation_request(ue_index, rnti_t::MIN_CRNTI, nr_cell_identity::create(1).value());
119+
ue_rrc_context_creation_request req = generate_ue_rrc_context_creation_request(
120+
ue_index_t::invalid, rnti_t::MIN_CRNTI, nr_cell_identity::create(1).value());
123121

124122
// Pass message to DU processor
125-
ue_rrc_context_creation_response resp =
123+
ue_rrc_context_creation_outcome outcome =
126124
du_processor_obj->get_f1ap_interface().handle_ue_rrc_context_creation_request(req);
127-
ASSERT_EQ(resp.f1ap_rrc_notifier, nullptr);
125+
ASSERT_TRUE(not outcome.has_value());
128126
}
129127

130128
TEST_F(du_processor_test, when_ue_rrc_context_exists_then_new_ue_rrc_context_not_added)
@@ -138,20 +136,21 @@ TEST_F(du_processor_test, when_ue_rrc_context_exists_then_new_ue_rrc_context_not
138136
test_helpers::generate_f1_setup_request());
139137

140138
// Generate ue_creation message
141-
ue_index_t ue_index = du_processor_obj->get_f1ap_interface().allocate_new_ue_index();
142-
ue_rrc_context_creation_request req = generate_ue_rrc_context_creation_request(
143-
ue_index, rnti_t::MIN_CRNTI, nr_cell_identity::create(gnb_id_t{411, 22}, 0).value());
139+
ue_rrc_context_creation_request req = generate_ue_rrc_context_creation_request(
140+
ue_index_t::invalid, rnti_t::MIN_CRNTI, nr_cell_identity::create(gnb_id_t{411, 22}, 0).value());
144141

145142
// Pass message to DU processor
146-
ue_rrc_context_creation_response resp =
143+
ue_rrc_context_creation_outcome outcome =
147144
du_processor_obj->get_f1ap_interface().handle_ue_rrc_context_creation_request(req);
148-
ASSERT_NE(resp.f1ap_rrc_notifier, nullptr);
145+
ASSERT_TRUE(outcome.has_value());
149146

150147
ASSERT_EQ(du_processor_obj->get_statistics_handler().get_nof_ues(), 1);
151148

152149
// Pass same message to DU processor again
153-
resp = du_processor_obj->get_f1ap_interface().handle_ue_rrc_context_creation_request(req);
154-
ASSERT_EQ(resp.f1ap_rrc_notifier, nullptr);
150+
req.ue_index = outcome->ue_index;
151+
ue_rrc_context_creation_outcome outcome2 =
152+
du_processor_obj->get_f1ap_interface().handle_ue_rrc_context_creation_request(req);
153+
ASSERT_TRUE(not outcome2.has_value());
155154

156155
ASSERT_EQ(du_processor_obj->get_statistics_handler().get_nof_ues(), 1);
157156
}
@@ -171,15 +170,14 @@ TEST_F(du_processor_test, when_max_nof_ues_exceeded_then_ue_not_added)
171170
// Add the maximum number of UEs
172171
for (unsigned it = 0; it < ue_mng.get_ue_config().max_nof_supported_ues; it++) {
173172
// Generate ue_creation message
174-
rnti_t c_rnti = to_rnti(it + 1); // 0 is not a valid RNTI
175-
ue_index_t ue_index = du_processor_obj->get_f1ap_interface().allocate_new_ue_index();
176-
ue_rrc_context_creation_request req = generate_ue_rrc_context_creation_request(
177-
ue_index, c_rnti, nr_cell_identity::create(gnb_id_t{411, 22}, 0).value());
173+
rnti_t c_rnti = to_rnti(it + 1); // 0 is not a valid RNTI
174+
ue_rrc_context_creation_request req = generate_ue_rrc_context_creation_request(
175+
ue_index_t::invalid, c_rnti, nr_cell_identity::create(gnb_id_t{411, 22}, 0).value());
178176

179177
// Pass message to DU processor
180-
ue_rrc_context_creation_response resp =
178+
ue_rrc_context_creation_outcome outcome =
181179
du_processor_obj->get_f1ap_interface().handle_ue_rrc_context_creation_request(req);
182-
ASSERT_NE(resp.f1ap_rrc_notifier, nullptr);
180+
ASSERT_TRUE(outcome.has_value());
183181
}
184182

185183
// Reset logger loglevel
@@ -190,9 +188,13 @@ TEST_F(du_processor_test, when_max_nof_ues_exceeded_then_ue_not_added)
190188

191189
ASSERT_EQ(du_processor_obj->get_statistics_handler().get_nof_ues(), ue_mng.get_ue_config().max_nof_supported_ues);
192190

193-
// Try to allocate additional UE index
194-
ue_index_t ue_index = du_processor_obj->get_f1ap_interface().allocate_new_ue_index();
195-
ASSERT_EQ(ue_index, ue_index_t::invalid);
191+
// Try to add additional UE
192+
rnti_t c_rnti = to_rnti(ue_mng.get_ue_config().max_nof_supported_ues + 1);
193+
ue_rrc_context_creation_request req = generate_ue_rrc_context_creation_request(
194+
ue_index_t::invalid, c_rnti, nr_cell_identity::create(gnb_id_t{411, 22}, 0).value());
195+
ue_rrc_context_creation_outcome outcome =
196+
du_processor_obj->get_f1ap_interface().handle_ue_rrc_context_creation_request(req);
197+
ASSERT_TRUE(not outcome.has_value());
196198

197199
ASSERT_EQ(du_processor_obj->get_statistics_handler().get_nof_ues(), ue_mng.get_ue_config().max_nof_supported_ues);
198200
}

0 commit comments

Comments
 (0)