Merge remote-tracking branch 'origin/add-ci-ue-rrc-idle-test' into integration_2025_w22 (!3277)

Add CI test to force RRC IDLE and new connection setup with 5G-S-TMSI

This MR is a follow up to !2725 (merged)..

The primary goal is to introduce a CI test that enforces the following behavior:
- Forces the UE to enter RRC_IDLE state.
- Validates the UE's re-connection procedure using the 5G-S-TMSI as the UE
  identity.
This commit is contained in:
Jaroslava Fiedlerova
2025-05-27 19:30:08 +02:00
17 changed files with 336 additions and 86 deletions
+3
View File
@@ -2562,6 +2562,9 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc,
nr_pdcp_release_drb(rrc->ue_id, i);
}
}
// stop TUN threads and clean up SDAP entities
nr_sdap_delete_ue_entities(rrc->ue_id);
for (int i = 1; i < NR_NUM_SRB; i++) {
if (rrc->Srb[i] != RB_NOT_PRESENT) {
rrc->Srb[i] = RB_NOT_PRESENT;
+20 -3
View File
@@ -121,8 +121,21 @@ static void *sdap_tun_read_thread(void *arg)
while (!entity->stop_thread) {
len = read(entity->pdusession_sock, &rx_buf, NL_MAX_PAYLOAD);
if (len == -1) {
LOG_E(PDCP, "could not read(): errno %d %s\n", errno, strerror(errno));
return NULL;
if (errno == EINTR)
continue; // interrupted system call
if (errno == EBADF || errno == EINVAL) {
LOG_I(SDAP, "Socket closed, exiting TUN read thread for UE %ld, PDU session %d\n", entity->ue_id, entity->pdusession_id);
break;
}
LOG_E(PDCP, "read() failed: errno %d (%s)\n", errno, strerror(errno));
break;
}
if (len == 0) {
LOG_W(SDAP, "TUN socket returned EOF - exiting thread\n");
break;
}
LOG_D(SDAP, "read data of size %d\n", len);
@@ -194,6 +207,10 @@ void remove_ip_if(nr_sdap_entity_t *entity)
DevAssert(entity != NULL);
// Stop the read thread
entity->stop_thread = true;
// Close the socket: read() will get EBADF and exit
close(entity->pdusession_sock);
int ret = pthread_join(entity->pdusession_thread, NULL);
AssertFatal(ret == 0, "pthread_join() failed, errno: %d, %s\n", errno, strerror(errno));
// Bring down the IP interface
@@ -205,5 +222,5 @@ void remove_ip_if(nr_sdap_entity_t *entity)
} else {
tun_generate_ue_ifname(ifname, entity->ue_id, entity->pdusession_id != default_pdu ? entity->pdusession_id : -1);
}
tun_destroy(ifname, entity->pdusession_sock);
tun_destroy(ifname);
}
+1 -1
View File
@@ -329,7 +329,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
LOG_D(SDAP, "RX Entity offset : %d\n", offset);
if (len != size-offset)
LOG_E(SDAP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
LOG_E(SDAP, "write failed to fd %d! errno = %s\n", entity->pdusession_sock, strerror(errno));
}
}