From db4d8d23221cd0ea9794f84a4d53ae2d489df3d9 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 23 Aug 2024 16:36:12 +0200 Subject: [PATCH 01/87] fix handling of time start position in SRS FAPI at gNB --- openair1/PHY/NR_TRANSPORT/srs_rx.c | 16 ++++++---------- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 5 ++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 4 ++-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index 12eb6edda9..a7d975dbb7 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -67,23 +67,19 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, slot_t slot, nfapi_nr_srs_pdu_t *srs_pdu, nr_srs_info_t *nr_srs_info, - int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<num_symbols)]) { - -#ifdef SRS_DEBUG - LOG_I(NR_PHY,"Calling %s function\n", __FUNCTION__); -#endif - + int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size * (1 << srs_pdu->num_symbols)]) +{ c16_t **rxdataF = gNB->common_vars.rxdataF; const NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; const uint16_t n_symbols = (slot % RU_RX_SLOT_DEPTH) * frame_parms->symbols_per_slot; // number of symbols until this slot - const uint8_t l0 = frame_parms->symbols_per_slot - 1 - srs_pdu->time_start_position; // starting symbol in this slot - const uint64_t symbol_offset = (n_symbols+l0)*frame_parms->ofdm_symbol_size; + const uint8_t l0 = srs_pdu->time_start_position; // starting symbol in this slot + const uint64_t symbol_offset = (n_symbols + l0) * frame_parms->ofdm_symbol_size; const uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*NR_NB_SC_PER_RB; const uint8_t N_ap = 1<num_ant_ports; - const uint8_t N_symb_SRS = 1<num_symbols; - const uint8_t K_TC = 2<comb_size; + const uint8_t N_symb_SRS = 1 << srs_pdu->num_symbols; + const uint8_t K_TC = 2 << srs_pdu->comb_size; const uint16_t M_sc_b_SRS = srs_bandwidth_config[srs_pdu->config_index][srs_pdu->bandwidth_index][0] * NR_NB_SC_PER_RB/K_TC; int32_t *rx_signal; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index b5423bab23..f0faf00abd 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -613,10 +613,9 @@ static void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, uint32 if (srs) { if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) { nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu; - for(int symbol = 0; symbol<(1<num_symbols); symbol++) { + for(int symbol = 0; symbol < (1 << srs_pdu->num_symbols); symbol++) { for(rb = srs_pdu->bwp_start; rb < (srs_pdu->bwp_start+srs_pdu->bwp_size); rb++) { - rb_mask_ul[gNB->frame_parms.symbols_per_slot - srs_pdu->time_start_position - 1 + symbol][rb >> 5] |= 1U - << (rb & 31); + rb_mask_ul[srs_pdu->time_start_position + symbol][rb >> 5] |= 1U << (rb & 31); } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index 20bf3c0cf2..5045d6cbe8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -430,7 +430,7 @@ static void nr_configure_srs(nfapi_nr_srs_pdu_t *srs_pdu, srs_pdu->num_ant_ports = srs_resource->nrofSRS_Ports; srs_pdu->num_symbols = srs_resource->resourceMapping.nrofSymbols; srs_pdu->num_repetitions = srs_resource->resourceMapping.repetitionFactor; - srs_pdu->time_start_position = srs_resource->resourceMapping.startPosition; + srs_pdu->time_start_position = NR_NUMBER_OF_SYMBOLS_PER_SLOT - 1 - srs_resource->resourceMapping.startPosition; srs_pdu->config_index = srs_resource->freqHopping.c_SRS; srs_pdu->sequence_id = srs_resource->sequenceId; srs_pdu->bandwidth_index = srs_resource->freqHopping.b_SRS; @@ -472,7 +472,7 @@ static void nr_configure_srs(nfapi_nr_srs_pdu_t *srs_pdu, // TODO properly use beam allocation uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[0][buffer_index * MAX_BWP_SIZE]; - uint64_t mask = SL_to_bitmap(13 - srs_pdu->time_start_position, srs_pdu->num_symbols); + uint64_t mask = SL_to_bitmap(srs_pdu->time_start_position, srs_pdu->num_symbols); for (int i = 0; i < srs_pdu->bwp_size; ++i) vrb_map_UL[i + srs_pdu->bwp_start] |= mask; } From d994d537e91662557ca06f9e5fd2a89cc218fffa Mon Sep 17 00:00:00 2001 From: Roberto Rosca Date: Fri, 26 Jul 2024 10:43:03 +0300 Subject: [PATCH 02/87] Added sib19 structure with initialization --- openair2/GNB_APP/RRC_nr_paramsvalues.h | 14 ++++++++ openair2/GNB_APP/gnb_config.c | 34 ++++++++++++++++-- openair2/LAYER2/NR_MAC_gNB/config.c | 11 ++++++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 4 +++ openair2/RRC/NR/nr_rrc_config.c | 47 +++++++++++++++++++++++++ openair2/RRC/NR/nr_rrc_config.h | 4 +++ 7 files changed, 112 insertions(+), 3 deletions(-) diff --git a/openair2/GNB_APP/RRC_nr_paramsvalues.h b/openair2/GNB_APP/RRC_nr_paramsvalues.h index ddcd5ceafd..bfda253fbf 100644 --- a/openair2/GNB_APP/RRC_nr_paramsvalues.h +++ b/openair2/GNB_APP/RRC_nr_paramsvalues.h @@ -109,6 +109,13 @@ #define GNB_CONFIG_STRING_SSPBCHBLOCKPOWER "ssPBCH_BlockPower" #define GNB_CONFIG_STRING_CELLSPECIFICKOFFSET "cellSpecificKoffset_r17" +#define GNB_CONFIG_STRING_EPHEMERIS_POSITION_X "positionX-r17" +#define GNB_CONFIG_STRING_EPHEMERIS_POSITION_Y "positionY-r17" +#define GNB_CONFIG_STRING_EPHEMERIS_POSITION_Z "positionZ-r17" +#define GNB_CONFIG_STRING_EPHEMERIS_VELOCITY_VX "velocityVX-r17" +#define GNB_CONFIG_STRING_EPHEMERIS_VELOCITY_VY "velocityVY-r17" +#define GNB_CONFIG_STRING_EPHEMERIS_VELOCITY_VZ "velocityVZ-r17" +#define GNB_CONFIG_STRING_TA_COMMON "ta-Common-r17" #define CARRIERBANDWIDTH_OKVALUES {11,18,24,25,31,32,38,51,52,65,66,78,79,93,106,107,121,132,133,135,160,162,189,216,217,245,264,270,273} @@ -232,6 +239,13 @@ {GNB_CONFIG_STRING_NROFUPLINKSYMBOLS2,NULL,0,.i64ptr=&scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols,.defint64val=-1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_SSPBCHBLOCKPOWER,NULL,0,.i64ptr=&scc->ss_PBCH_BlockPower,.defint64val=20,TYPE_INT64,0}, \ {GNB_CONFIG_STRING_CELLSPECIFICKOFFSET,NULL,0,.i64ptr=scc->ext2->ntn_Config_r17->cellSpecificKoffset_r17,.defint64val=0,TYPE_INT64,0}, \ +{GNB_CONFIG_STRING_EPHEMERIS_POSITION_X,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionX_r17,.defint64val=LONG_MAX,TYPE_INT64,0}, \ +{GNB_CONFIG_STRING_EPHEMERIS_POSITION_Y,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionY_r17,.defint64val=LONG_MAX,TYPE_INT64,0}, \ +{GNB_CONFIG_STRING_EPHEMERIS_POSITION_Z,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionZ_r17,.defint64val=LONG_MAX,TYPE_INT64,0}, \ +{GNB_CONFIG_STRING_EPHEMERIS_VELOCITY_VX,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->velocityVX_r17,.defint64val=LONG_MAX,TYPE_INT64,0}, \ +{GNB_CONFIG_STRING_EPHEMERIS_VELOCITY_VY,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->velocityVY_r17,.defint64val=LONG_MAX,TYPE_INT64,0}, \ +{GNB_CONFIG_STRING_EPHEMERIS_VELOCITY_VZ,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->velocityVZ_r17,.defint64val=LONG_MAX,TYPE_INT64,0}, \ +{GNB_CONFIG_STRING_TA_COMMON,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ta_Info_r17->ta_Common_r17,.defint64val=-1,TYPE_INT64,0}, \ {GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing,.defintval=-1,TYPE_INT64,0}} /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 57e081b0e9..000b9f563c 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -216,6 +216,13 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { scc->ext2 = CALLOC(1, sizeof(*scc->ext2)); scc->ext2->ntn_Config_r17 = CALLOC(1, sizeof(*scc->ext2->ntn_Config_r17)); scc->ext2->ntn_Config_r17->cellSpecificKoffset_r17 = CALLOC(1, sizeof(*scc->ext2->ntn_Config_r17->cellSpecificKoffset_r17)); + + scc->ext2->ntn_Config_r17->ephemerisInfo_r17 = CALLOC(1, sizeof(*scc->ext2->ntn_Config_r17->ephemerisInfo_r17)); + scc->ext2->ntn_Config_r17->ta_Info_r17 = CALLOC(1, sizeof(*scc->ext2->ntn_Config_r17->ta_Info_r17)); + + scc->ext2->ntn_Config_r17->ephemerisInfo_r17->present = NR_EphemerisInfo_r17_PR_positionVelocity_r17; + scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17 = + CALLOC(1, sizeof(*scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17)); } // Section 4.1 in 38.213 @@ -436,8 +443,27 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc, uint64_t ssbmap) AssertFatal(*scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon < 2, "pucch_ResourceConfig should be 0 or 1 for now\n"); - if(*scc->ext2->ntn_Config_r17->cellSpecificKoffset_r17 == 0) { + if (*scc->ext2->ntn_Config_r17->cellSpecificKoffset_r17 == 0) { free(scc->ext2->ntn_Config_r17->cellSpecificKoffset_r17); + scc->ext2->ntn_Config_r17->cellSpecificKoffset_r17 = NULL; + } + if (scc->ext2->ntn_Config_r17->ta_Info_r17->ta_Common_r17 == -1) { + free(scc->ext2->ntn_Config_r17->ta_Info_r17); + scc->ext2->ntn_Config_r17->ta_Info_r17 = NULL; + } + if (scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionX_r17 == LONG_MAX + && scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionY_r17 == LONG_MAX + && scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionZ_r17 == LONG_MAX + && scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->velocityVX_r17 == LONG_MAX + && scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->velocityVY_r17 == LONG_MAX + && scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->velocityVZ_r17 == LONG_MAX) { + free(scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17); + free(scc->ext2->ntn_Config_r17->ephemerisInfo_r17); + scc->ext2->ntn_Config_r17->ephemerisInfo_r17 = NULL; + } + + if (!scc->ext2->ntn_Config_r17->cellSpecificKoffset_r17 && !scc->ext2->ntn_Config_r17->ta_Info_r17 + && !scc->ext2->ntn_Config_r17->ephemerisInfo_r17) { free(scc->ext2->ntn_Config_r17); free(scc->ext2); scc->ext2 = NULL; @@ -1447,9 +1473,11 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) f1ap_served_cell_info_t info; read_du_cell_info(cfg, NODE_IS_DU(node_type), &gnb_id, &gnb_du_id, &name, &info, 1); - if (get_softmodem_params()->sa) + if (get_softmodem_params()->sa) { nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac); - + nr_mac_configure_sib19(RC.nrmac[0]); + } + // read F1 Setup information from config and generated MIB/SIB1 // and store it at MAC for sending later NR_BCCH_BCH_Message_t *mib = RC.nrmac[0]->common_channels[0].mib; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index e0e11c5f2f..944d4af46d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -709,6 +709,17 @@ void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_ AssertFatal(cc->sib1_bcch_length > 0, "could not encode SIB1\n"); } +void nr_mac_configure_sib19(gNB_MAC_INST *nrmac) +{ + AssertFatal(get_softmodem_params()->sa > 0, "error: SIB19 only applicable for SA\n"); + NR_COMMON_channels_t *cc = &nrmac->common_channels[0]; + NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; + NR_BCCH_DL_SCH_Message_t *sib19 = get_SIB19_NR(scc); + cc->sib19 = sib19; + cc->sib19_bcch_length = encode_SIB19_NR(sib19, cc->sib19_bcch_pdu, sizeof(cc->sib19_bcch_pdu)); + AssertFatal(cc->sib19_bcch_length > 0, "could not encode SIB19\n"); +} + bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup) { /* ideally, instead of this function, "users" of this function should call diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 9011e13f75..33933be4d7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -47,6 +47,7 @@ void nr_mac_send_f1_setup_req(void); void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, const nr_mac_config_t *mac_config); void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac); +void nr_mac_configure_sib19(gNB_MAC_INST *nrmac); bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup); bool nr_mac_prepare_ra_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index ea696faa71..51e403ae49 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -260,6 +260,7 @@ typedef struct { frame_type_t frame_type; NR_BCCH_BCH_Message_t *mib; NR_BCCH_DL_SCH_Message_t *sib1; + NR_BCCH_DL_SCH_Message_t *sib19; NR_ServingCellConfigCommon_t *ServingCellConfigCommon; /// pre-configured ServingCellConfig that is default for every UE NR_ServingCellConfig_t *pre_ServingCellConfig; @@ -268,6 +269,9 @@ typedef struct { /// Outgoing BCCH pdu for PHY uint8_t sib1_bcch_pdu[NR_MAX_SIB_LENGTH / 8]; int sib1_bcch_length; + /// used for sib19 data + uint8_t sib19_bcch_pdu[NR_MAX_SIB_LENGTH / 8]; + int sib19_bcch_length; /// Template for RA computations NR_RA_t ra[NR_NB_RA_PROC_MAX]; /// VRB map for common channels diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 5631da4c0e..b5e75eba50 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -2454,6 +2454,53 @@ int encode_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1, uint8_t *buffer, int max_buff return (enc_rval.encoded + 7) / 8; } +NR_BCCH_DL_SCH_Message_t *get_SIB19_NR(const NR_ServingCellConfigCommon_t *scc) +{ + NR_BCCH_DL_SCH_Message_t *sib_message = CALLOC(1, sizeof(NR_BCCH_DL_SCH_Message_t)); + sib_message->message.present = NR_BCCH_DL_SCH_MessageType_PR_c1; + sib_message->message.choice.c1 = CALLOC(1,sizeof(struct NR_BCCH_DL_SCH_MessageType__c1)); + sib_message->message.choice.c1->present = NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformation; + sib_message->message.choice.c1->choice.systemInformation = CALLOC(1,sizeof(struct NR_SystemInformation)); + + struct NR_SystemInformation *sib = sib_message->message.choice.c1->choice.systemInformation; + sib->criticalExtensions.present = NR_SystemInformation__criticalExtensions_PR_systemInformation; + sib->criticalExtensions.choice.systemInformation = CALLOC(1, sizeof(struct NR_SystemInformation_IEs)); + + struct NR_SystemInformation_IEs *ies = sib->criticalExtensions.choice.systemInformation; + + SystemInformation_IEs__sib_TypeAndInfo__Member *sib19 = NULL; + sib19 = CALLOC(1, sizeof(SystemInformation_IEs__sib_TypeAndInfo__Member)); + sib19->present = NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib19_v1700; + sib19->choice.sib19_v1700 = CALLOC(1, sizeof(struct NR_SIB19_r17)); + + // use ntn-config from NR_ServingCellConfigCommon_t + const int copy_result = asn_copy(&asn_DEF_NR_NTN_Config_r17, (void **) &sib19->choice.sib19_v1700->ntn_Config_r17, scc->ext2->ntn_Config_r17); + AssertFatal(copy_result == 0, "Was unable to copy ntn_Config_r17 from scc to SIB19 structure\n"); + + asn1cSeqAdd(&ies->sib_TypeAndInfo.list, sib19); + + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { + xer_fprint(stdout, &asn_DEF_NR_BCCH_DL_SCH_Message, sib_message); + } + + return sib_message; +} + +int encode_SIB19_NR(NR_BCCH_DL_SCH_Message_t *sib19, uint8_t *buffer, int max_buffer_size) +{ + asn_enc_rval_t enc_rval; + + enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_DL_SCH_Message, NULL, sib19, buffer, 150); + AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded); + + return ((enc_rval.encoded + 7) / 8); +} + +void free_SIB19_NR(NR_BCCH_DL_SCH_Message_t *sib19) +{ + ASN_STRUCT_FREE(asn_DEF_NR_BCCH_DL_SCH_Message, sib19); +} + static NR_PhysicalCellGroupConfig_t *configure_phy_cellgroup(void) { NR_PhysicalCellGroupConfig_t *physicalCellGroupConfig = calloc(1, sizeof(*physicalCellGroupConfig)); diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index e3f4fed7cb..87640834e5 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -74,6 +74,10 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc, void free_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1); int encode_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1, uint8_t *buffer, int max_buffer_size); +NR_BCCH_DL_SCH_Message_t *get_SIB19_NR(const NR_ServingCellConfigCommon_t *scc); +int encode_SIB19_NR(NR_BCCH_DL_SCH_Message_t *sib19, uint8_t *buffer, int max_buffer_size); +void free_SIB19_NR(NR_BCCH_DL_SCH_Message_t *sib19); + NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid, const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfig_t *servingcellconfigdedicated, From b9d2f916bc7e154bf2e4d6e26da8b7b640210f6a Mon Sep 17 00:00:00 2001 From: Roberto Rosca Date: Mon, 29 Jul 2024 13:16:01 +0300 Subject: [PATCH 03/87] Added scheduling info for sib19 to sib1 --- openair2/RRC/NR/nr_rrc_config.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index b5e75eba50..1c3b3d0dc8 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -2244,6 +2244,29 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc, asn1cSeqAdd(&sib1->si_SchedulingInfo->schedulingInfoList.list,schedulingInfo);*/ + // sib19 scheduling info + // this condition ensures ntn-config is initialized + if (scc->ext2 && scc->ext2->ntn_Config_r17) { + sib1->nonCriticalExtension = CALLOC(1, sizeof(struct NR_SIB1_v1610_IEs)); + sib1->nonCriticalExtension->nonCriticalExtension = CALLOC(1, sizeof(struct NR_SIB1_v1630_IEs)); + sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension = CALLOC(1, sizeof(struct NR_SIB1_v1700_IEs)); + + struct NR_SI_SchedulingInfo_v1700 *sib_v17_scheduling_info = CALLOC(1, sizeof(struct NR_SI_SchedulingInfo_v1700)); + + struct NR_SchedulingInfo2_r17 *si_schedulinginfo2_r17 = CALLOC(1, sizeof(struct NR_SchedulingInfo2_r17)); + si_schedulinginfo2_r17->si_BroadcastStatus_r17 = NR_SchedulingInfo2_r17__si_BroadcastStatus_r17_broadcasting; + si_schedulinginfo2_r17->si_WindowPosition_r17 = 2; + si_schedulinginfo2_r17->si_Periodicity_r17 = NR_SchedulingInfo2_r17__si_Periodicity_r17_rf16; + + struct NR_SIB_TypeInfo_v1700 *sib_type_info = CALLOC(1, sizeof(struct NR_SIB_TypeInfo_v1700)); + sib_type_info->sibType_r17.present = NR_SIB_TypeInfo_v1700__sibType_r17_PR_type1_r17; + sib_type_info->sibType_r17.choice.type1_r17 = NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType19; + + asn1cSeqAdd(&si_schedulinginfo2_r17->sib_MappingInfo_r17.list, sib_type_info); + asn1cSeqAdd(&sib_v17_scheduling_info->schedulingInfoList2_r17.list, si_schedulinginfo2_r17); + sib1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700 = sib_v17_scheduling_info; + } + // servingCellConfigCommon asn1cCalloc(sib1->servingCellConfigCommon, ServCellCom); NR_BWP_DownlinkCommon_t *initialDownlinkBWP = &ServCellCom->downlinkConfigCommon.initialDownlinkBWP; @@ -2434,7 +2457,10 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc, // nonCriticalExtension // TODO: add nonCriticalExtension - //xer_fprint(stdout, &asn_DEF_NR_SIB1, (const void*)sib1_message->message.choice.c1->choice.systemInformationBlockType1); + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { + xer_fprint(stdout, &asn_DEF_NR_SIB1, sib1_message->message.choice.c1->choice.systemInformationBlockType1); + } + return sib1_message; } From a197c0a41a4ed3b3214091f36d4ddc1b4fcf83bc Mon Sep 17 00:00:00 2001 From: Roberto Rosca Date: Mon, 5 Aug 2024 15:45:53 +0300 Subject: [PATCH 04/87] Schedule SIB19 based on scheduling info from SIB1 --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 2 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 6 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 6 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 400 +++++++++++++++++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 16 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 9 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 15 + openair2/RRC/NR/nr_rrc_config.c | 2 +- 10 files changed, 445 insertions(+), 15 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index b2fd085285..4ce1571390 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -231,6 +231,8 @@ NR_tda_info_t get_info_from_tda_tables(default_table_type_t table_type, int dmrs_TypeA_Position, int normal_CP); +NR_tda_info_t set_tda_info_from_list(NR_PDSCH_TimeDomainResourceAllocationList_t *tdalist, int tda_index); + default_table_type_t get_default_table_type(int mux_pattern); void fill_coresetZero(NR_ControlResourceSet_t *coreset0, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ad18ead1f4..5158a3c237 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -262,9 +262,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_ // This schedules MIB schedule_nr_mib(module_idP, frame, slot, &sched_info->DL_req); - // This schedules SIB1 - if (get_softmodem_params()->sa == 1) + // This schedules SIB1 and SIB19 + if (get_softmodem_params()->sa == 1) { schedule_nr_sib1(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req); + schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req); + } // This schedule PRACH if we are not in phy_test mode if (get_softmodem_params()->phy_test == 0) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 160cde63f5..e42cc0bf9d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -673,7 +673,7 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP, ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu_rel15 = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, &ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, &ra->sched_pdcch, false); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1335,7 +1335,7 @@ static void nr_generate_Msg2(module_id_t module_idP, dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, &ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, &ra->sched_pdcch, false); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1577,7 +1577,7 @@ static void prepare_dl_pdus(gNB_MAC_INST *nr_mac, dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, &ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, &ra->sched_pdcch, false); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 4e3133aff3..87b95f2e71 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -398,6 +398,128 @@ static uint32_t schedule_control_sib1(module_id_t module_id, return TBS; } + +static uint32_t schedule_control_other_si(module_id_t module_id, + int CC_id, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, + int time_domain_allocation, + NR_pdsch_dmrs_t *dmrs_parms, + NR_tda_info_t *tda_info, + uint8_t candidate_idx, + uint16_t num_total_bytes) +{ + gNB_MAC_INST *gNB_mac = RC.nrmac[module_id]; + NR_COMMON_channels_t *cc = &gNB_mac->common_channels[CC_id]; + NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; + uint16_t *vrb_map = cc->vrb_map; + + if (gNB_mac->sched_osi == NULL){ + gNB_mac->sched_osi = calloc(1, sizeof(NR_UE_sched_osi_ctrl_t)); + struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; + NR_SearchSpaceId_t osi_SearchSpace = *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation; + AssertFatal(commonSearchSpaceList->list.count > 0, "common SearchSpace list has 0 elements\n"); + for (int i = 0; i < commonSearchSpaceList->list.count; i++) { + NR_SearchSpace_t * ss = commonSearchSpaceList->list.array[i]; + if (ss->searchSpaceId == osi_SearchSpace) + gNB_mac->sched_osi->search_space = ss; + } + AssertFatal(gNB_mac->sched_osi->search_space!=NULL,"SearchSpace cannot be null for RA\n"); + + gNB_mac->sched_osi->coreset = get_coreset(gNB_mac, scc, NULL, gNB_mac->sched_osi->search_space, NR_SearchSpace__searchSpaceType_PR_common); + gNB_mac->sched_osi->sched_pdcch = set_pdcch_structure(NULL, + gNB_mac->sched_osi->search_space, + gNB_mac->sched_osi->coreset, + scc, + NULL, + type0_PDCCH_CSS_config); + } + + NR_sched_pdsch_t *pdsch = &gNB_mac->sched_osi->sched_pdsch; + pdsch->time_domain_allocation = time_domain_allocation; + pdsch->dmrs_parms = *dmrs_parms; + pdsch->tda_info = *tda_info; + pdsch->mcs = 0; // starting from mcs 0 + gNB_mac->sched_osi->num_total_bytes = num_total_bytes; + + uint8_t nr_of_candidates; + + for (int i=0; i<3; i++) { + find_aggregation_candidates(&gNB_mac->sched_osi->aggregation_level, &nr_of_candidates, gNB_mac->sched_ctrlCommon->search_space,4<0) break; // choosing the lower value of aggregation level available + } + AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); + gNB_mac->sched_osi->cce_index = find_pdcch_candidate(gNB_mac, + CC_id, + gNB_mac->sched_osi->aggregation_level, + nr_of_candidates, + &gNB_mac->sched_osi->sched_pdcch, + gNB_mac->sched_osi->coreset, + 0); + + AssertFatal(gNB_mac->sched_osi->cce_index >= 0, "Could not find CCE for coreset0\n"); + + const uint16_t bwpSize = type0_PDCCH_CSS_config->num_rbs; + int rbStart = type0_PDCCH_CSS_config->cset_start_rb; + + // Calculate number of PRB_DMRS + uint8_t N_PRB_DMRS = pdsch->dmrs_parms.N_PRB_DMRS; + uint16_t dmrs_length = pdsch->dmrs_parms.N_DMRS_SLOT; + LOG_D(MAC,"dlDmrsSymbPos %x\n",pdsch->dmrs_parms.dl_dmrs_symb_pos); + int mcsTableIdx = 0; + int rbSize = 0; + uint32_t TBS = 0; + do { + if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols))) + rbSize++; + else{ + if (pdsch->mcs<10) + pdsch->mcs++; + else + break; + } + TBS = nr_compute_tbs(nr_get_Qm_dl(pdsch->mcs, mcsTableIdx), + nr_get_code_rate_dl(pdsch->mcs, mcsTableIdx), + rbSize, tda_info->nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3; + } while (TBS < gNB_mac->sched_osi->num_total_bytes); + + if (TBS < gNB_mac->sched_osi->num_total_bytes) { + for (int rb = 0; rb < bwpSize; rb++) + LOG_I(NR_MAC, "vrb_map[%d] %x\n", rbStart + rb, vrb_map[rbStart + rb]); + } + AssertFatal( + TBS >= gNB_mac->sched_osi->num_total_bytes, + "Couldn't allocate enough resources for %d bytes in SIB1 PDSCH (rbStart %d, rbSize %d, bwpSize %d SLmask %x - [%d,%d])\n", + gNB_mac->sched_osi->num_total_bytes, + rbStart, + rbSize, + bwpSize, + SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols), + tda_info->startSymbolIndex, + tda_info->nrOfSymbols); + + pdsch->rbSize = rbSize; + pdsch->rbStart = 0; + + LOG_D(NR_MAC,"mcs = %i\n", pdsch->mcs); + LOG_D(NR_MAC,"startSymbolIndex = %i\n", tda_info->startSymbolIndex); + LOG_D(NR_MAC,"nrOfSymbols = %i\n", tda_info->nrOfSymbols); + LOG_D(NR_MAC, "rbSize = %i\n", pdsch->rbSize); + LOG_D(NR_MAC,"TBS = %i\n", TBS); + LOG_D(NR_MAC,"dmrs_length %d\n",dmrs_length); + LOG_D(NR_MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); + LOG_D(NR_MAC,"mappingtype = %d\n", tda_info->mapping_type); + // Mark the corresponding RBs as used + fill_pdcch_vrb_map(gNB_mac, + CC_id, + &gNB_mac->sched_osi->sched_pdcch, + gNB_mac->sched_osi->cce_index, + gNB_mac->sched_osi->aggregation_level); + for (int rb = 0; rb < pdsch->rbSize; rb++) { + vrb_map[rb + rbStart] |= SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols); + } + return TBS; +} + static void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, nfapi_nr_dl_tti_request_body_t *dl_req, int pdu_index, @@ -419,7 +541,8 @@ static void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; nr_configure_pdcch(pdcch_pdu_rel15, gNB_mac->sched_ctrlCommon->coreset, - &gNB_mac->sched_ctrlCommon->sched_pdcch); + &gNB_mac->sched_ctrlCommon->sched_pdcch, + false); nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); @@ -543,6 +666,155 @@ static void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, LOG_D(MAC,"numDlDci: %i\n", pdcch_pdu_rel15->numDlDci); } + +static void nr_fill_nfapi_dl_other_si_pdu(int Mod_idP, + nfapi_nr_dl_tti_request_body_t *dl_req, + int pdu_index, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, + uint32_t TBS, + int StartSymbolIndex, + int NrOfSymbols) +{ + gNB_MAC_INST *gNB_mac = RC.nrmac[Mod_idP]; + NR_COMMON_channels_t *cc = gNB_mac->common_channels; + NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; + int mcsTableIdx = 0; + NR_sched_pdsch_t *pdsch = &gNB_mac->sched_osi->sched_pdsch; + nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; + memset((void*)dl_tti_pdcch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); + dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE; + dl_tti_pdcch_pdu->PDUSize = (uint16_t)(4+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); + dl_req->nPDUs += 1; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; + nr_configure_pdcch(pdcch_pdu_rel15, + gNB_mac->sched_osi->coreset, + &gNB_mac->sched_osi->sched_pdcch, + true); + + nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; + memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); + dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE; + dl_tti_pdsch_pdu->PDUSize = (uint16_t)(4+sizeof(nfapi_nr_dl_tti_pdsch_pdu)); + dl_req->nPDUs += 1; + nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15; + + pdsch_pdu_rel15->precodingAndBeamforming.num_prgs=0; + pdsch_pdu_rel15->precodingAndBeamforming.prg_size=0; + pdsch_pdu_rel15->precodingAndBeamforming.dig_bf_interfaces=0; + pdsch_pdu_rel15->precodingAndBeamforming.prgs_list[0].pm_idx = 0; + pdsch_pdu_rel15->precodingAndBeamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx = 0; + + pdcch_pdu_rel15->CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1; + + pdsch_pdu_rel15->pduBitmap = 0; + pdsch_pdu_rel15->rnti = SI_RNTI; + pdsch_pdu_rel15->pduIndex = pdu_index; + + pdsch_pdu_rel15->BWPSize = type0_PDCCH_CSS_config->num_rbs; + pdsch_pdu_rel15->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; + + pdsch_pdu_rel15->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; + pdsch_pdu_rel15->CyclicPrefix = 0; + + pdsch_pdu_rel15->NrOfCodewords = 1; + pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(pdsch->mcs, mcsTableIdx); + pdsch_pdu_rel15->qamModOrder[0] = nr_get_Qm_dl(pdsch->mcs, mcsTableIdx); + pdsch_pdu_rel15->mcsIndex[0] = pdsch->mcs; + pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx; + pdsch_pdu_rel15->rvIndex[0] = nr_rv_round_map[0]; + pdsch_pdu_rel15->dataScramblingId = *scc->physCellId; + pdsch_pdu_rel15->nrOfLayers = 1; + pdsch_pdu_rel15->transmissionScheme = 0; + pdsch_pdu_rel15->refPoint = 1; + pdsch_pdu_rel15->dmrsConfigType = 0; + pdsch_pdu_rel15->dlDmrsScramblingId = *scc->physCellId; + pdsch_pdu_rel15->SCID = 0; + pdsch_pdu_rel15->numDmrsCdmGrpsNoData = pdsch->dmrs_parms.numDmrsCdmGrpsNoData; + pdsch_pdu_rel15->dmrsPorts = 1; + pdsch_pdu_rel15->resourceAlloc = 1; + pdsch_pdu_rel15->rbStart = pdsch->rbStart; + pdsch_pdu_rel15->rbSize = pdsch->rbSize; + pdsch_pdu_rel15->VRBtoPRBMapping = 0; + pdsch_pdu_rel15->TBSize[0] = TBS; + pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex; + pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols; + pdsch_pdu_rel15->dlDmrsSymbPos = pdsch->dmrs_parms.dl_dmrs_symb_pos; + LOG_D(NR_MAC,"sib19:bwpStart %d, bwpSize %d\n",pdsch_pdu_rel15->BWPStart,pdsch_pdu_rel15->BWPSize); + LOG_D(NR_MAC,"sib19:rbStart %d, rbSize %d\n",pdsch_pdu_rel15->rbStart,pdsch_pdu_rel15->rbSize); + LOG_D(NR_MAC,"sib19:dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos); + + pdsch_pdu_rel15->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(0, + pdsch_pdu_rel15->BWPSize, + 1); + pdsch_pdu_rel15->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS<<3,pdsch_pdu_rel15->targetCodeRate[0]); + + /* Fill PDCCH DL DCI PDU */ + nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci]; + pdcch_pdu_rel15->numDlDci++; + dci_pdu->RNTI = SI_RNTI; + dci_pdu->ScramblingId = *scc->physCellId; + dci_pdu->ScramblingRNTI = 0; + dci_pdu->AggregationLevel = gNB_mac->sched_osi->aggregation_level; + dci_pdu->CceIndex = gNB_mac->sched_osi->cce_index; + dci_pdu->beta_PDCCH_1_0 = 0; + dci_pdu->powerControlOffsetSS = 1; + + /* DCI payload */ + dci_pdu_rel15_t dci_payload; + memset(&dci_payload, 0, sizeof(dci_pdu_rel15_t)); + + dci_payload.bwp_indicator.val = 0; + + // frequency domain assignment + dci_payload.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0( + pdsch_pdu_rel15->rbSize, pdsch_pdu_rel15->rbStart, type0_PDCCH_CSS_config->num_rbs); + + dci_payload.time_domain_assignment.val = gNB_mac->sched_osi->sched_pdsch.time_domain_allocation; + dci_payload.mcs = pdsch->mcs; + dci_payload.rv = pdsch_pdu_rel15->rvIndex[0]; + dci_payload.harq_pid.val = 0; + dci_payload.ndi = 0; + dci_payload.dai[0].val = 0; + dci_payload.tpc = 0; // table 7.2.1-1 in 38.213 + dci_payload.pucch_resource_indicator = 0; + dci_payload.pdsch_to_harq_feedback_timing_indicator.val = 0; + dci_payload.antenna_ports.val = 0; + dci_payload.dmrs_sequence_initialization.val = pdsch_pdu_rel15->SCID; + dci_payload.system_info_indicator = 1; + + int dci_format = NR_DL_DCI_FORMAT_1_0; + int rnti_type = TYPE_SI_RNTI_; + + fill_dci_pdu_rel15(NULL, + NULL, + NULL, + &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci - 1], + &dci_payload, + dci_format, + rnti_type, + 0, + gNB_mac->sched_osi->search_space, + gNB_mac->sched_osi->coreset, + 0, + gNB_mac->cset0_bwp_size); + + + LOG_D(MAC,"BWPSize: %i\n", pdcch_pdu_rel15->BWPSize); + LOG_D(MAC,"BWPStart: %i\n", pdcch_pdu_rel15->BWPStart); + LOG_D(MAC,"SubcarrierSpacing: %i\n", pdcch_pdu_rel15->SubcarrierSpacing); + LOG_D(MAC,"CyclicPrefix: %i\n", pdcch_pdu_rel15->CyclicPrefix); + LOG_D(MAC,"StartSymbolIndex: %i\n", pdcch_pdu_rel15->StartSymbolIndex); + LOG_D(MAC,"DurationSymbols: %i\n", pdcch_pdu_rel15->DurationSymbols); + for(int n=0;n<6;n++) LOG_D(MAC,"FreqDomainResource[%i]: %x\n",n, pdcch_pdu_rel15->FreqDomainResource[n]); + LOG_D(MAC,"CceRegMappingType: %i\n", pdcch_pdu_rel15->CceRegMappingType); + LOG_D(MAC,"RegBundleSize: %i\n", pdcch_pdu_rel15->RegBundleSize); + LOG_D(MAC,"InterleaverSize: %i\n", pdcch_pdu_rel15->InterleaverSize); + LOG_D(MAC,"CoreSetType: %i\n", pdcch_pdu_rel15->CoreSetType); + LOG_D(MAC,"ShiftIndex: %i\n", pdcch_pdu_rel15->ShiftIndex); + LOG_D(MAC,"precoderGranularity: %i\n", pdcch_pdu_rel15->precoderGranularity); + LOG_D(MAC,"numDlDci: %i\n", pdcch_pdu_rel15->numDlDci); +} + void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, @@ -643,3 +915,129 @@ void schedule_nr_sib1(module_id_t module_idP, } } } + +void schedule_nr_sib19(module_id_t module_idP, + frame_t frameP, + sub_frame_t slotP, + nfapi_nr_dl_tti_request_t *DL_req, + nfapi_nr_tx_data_request_t *TX_req) +{ + /* already mutex protected: held in gNB_dlsch_ulsch_scheduler() */ + // TODO: Get these values from RRC + + const int CC_id = 0; + uint8_t candidate_idx = 0; + + gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP]; + NR_ServingCellConfigCommon_t *scc = gNB_mac->common_channels[CC_id].ServingCellConfigCommon; + NR_COMMON_channels_t *cc = &gNB_mac->common_channels[0]; + + // get sib19 scheduling info from sib1 + struct NR_SI_SchedulingInfo_v1700* si_schedulinginfo2_r17 = cc->sib1->message.choice.c1->choice.systemInformationBlockType1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700; + struct NR_SchedulingInfo2_r17* sib19_sched_info = NULL; + + bool found = false; + for (int i = 0; i < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.count; i++) + { + for (int j= 0; j < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]->sib_MappingInfo_r17.list.count; j++) + { + if (si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]->sib_MappingInfo_r17.list.array[j]->sibType_r17.choice.type1_r17 == + NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType19) + { + found = true; + sib19_sched_info = si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]; + break; + } + } + if (found) + break; + } + + if (!found) + { + LOG_D(GNB_APP, "SIB1 does not contain scheduling info for SIB19\n"); + return; + } + + // convert periodicity enum type into actual frames number + int frame = 8 << sib19_sched_info->si_Periodicity_r17; + + int time_domain_allocation = 1; // row 0 of pdsch tda common table + int L_max; + switch (scc->ssb_PositionsInBurst->present) { + case 1: + L_max = 4; + break; + case 2: + L_max = 8; + break; + case 3: + L_max = 64; + break; + default: + AssertFatal(0,"SSB bitmap size value %d undefined (allowed values 1,2,3)\n", + scc->ssb_PositionsInBurst->present); + } + + const int window_length = 10; + for (int i=0; itype0_PDCCH_CSS_config[i]; + if(((frameP - 1) % frame == 0) && + (slotP == ((sib19_sched_info->si_WindowPosition_r17 % window_length) - 1)) && + (type0_PDCCH_CSS_config->num_rbs > 0)) + { + + LOG_D(NR_MAC,"(%d.%d) SIB19 transmission: ssb_index %d\n", frameP, slotP, type0_PDCCH_CSS_config->ssb_index); + + NR_tda_info_t tda_info = set_tda_info_from_list(scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList, time_domain_allocation); + LOG_D(NR_MAC,"tda_info.startSymbolIndex: %d, tda_info.nrOfSymbols: %d\n", tda_info.startSymbolIndex, tda_info.nrOfSymbols); + + AssertFatal((tda_info.startSymbolIndex + tda_info.nrOfSymbols) < 14, "SIB19 TDA %d would cause overlap with CSI-RS. Please select a different SIB1 TDA.\n", time_domain_allocation); + + NR_pdsch_dmrs_t dmrs_parms = get_dl_dmrs_params(scc, + NULL, + &tda_info, + 1); + + // Configure sched_osi for SIB19 + uint32_t TBS = schedule_control_other_si(module_idP, CC_id, + type0_PDCCH_CSS_config, + time_domain_allocation, + &dmrs_parms, + &tda_info, + candidate_idx, + cc->sib19_bcch_length); + + nfapi_nr_dl_tti_request_body_t *dl_req = &DL_req->dl_tti_request_body; + int pdu_index = gNB_mac->pdu_index[0]++; + nr_fill_nfapi_dl_other_si_pdu(module_idP, dl_req, pdu_index, type0_PDCCH_CSS_config, TBS, tda_info.startSymbolIndex, tda_info.nrOfSymbols); + + const int ntx_req = TX_req->Number_of_PDUs; + nfapi_nr_pdu_t *tx_req = &TX_req->pdu_list[ntx_req]; + + // Data to be transmitted + memcpy(tx_req->TLVs[0].value.direct, cc->sib19_bcch_pdu, TBS); + xer_fprint(stdout, &asn_DEF_NR_BCCH_DL_SCH_Message,(void *)cc->sib19); + + tx_req->PDU_length = TBS; + tx_req->PDU_index = pdu_index; + tx_req->num_TLV = 1; + tx_req->TLVs[0].length = TBS + 2; + TX_req->Number_of_PDUs++; + TX_req->SFN = frameP; + TX_req->Slot = slotP; + + type0_PDCCH_CSS_config->active = false; + + T(T_GNB_MAC_DL_PDU_WITH_DATA, + T_INT(module_idP), + T_INT(CC_id), + T_INT(0xffff), + T_INT(frameP), + T_INT(slotP), + T_INT(0 /* harq_pid */), + T_BUFFER(cc->sib19_bcch_pdu, cc->sib19_bcch_length)); + } + } +} \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 334c263501..c7f2a97212 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1074,7 +1074,7 @@ void nr_schedule_ue_spec(module_id_t module_id, pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; LOG_D(NR_MAC,"Trying to configure DL pdcch for UE %04x, bwp %d, cs %d\n", UE->rnti, bwp_id, coresetid); NR_ControlResourceSet_t *coreset = sched_ctrl->coreset; - nr_configure_pdcch(pdcch_pdu, coreset, &sched_ctrl->sched_pdcch); + nr_configure_pdcch(pdcch_pdu, coreset, &sched_ctrl->sched_pdcch, false); gNB_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5bc2a97fd7..f5c322ecaa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -870,7 +870,8 @@ int nr_get_default_pucch_res(int pucch_ResourceCommon) { void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_ControlResourceSet_t *coreset, - NR_sched_pdcch_t *pdcch) { + NR_sched_pdcch_t *pdcch, + bool otherSI) { pdcch_pdu->BWPSize = pdcch->BWPSize; @@ -892,12 +893,17 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, pdcch_pdu->InterleaverSize = pdcch->InterleaverSize; pdcch_pdu->ShiftIndex = pdcch->ShiftIndex; - if(coreset->controlResourceSetId == 0) { - pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1; - } else{ + if (otherSI) { pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; } - + else { + if (coreset->controlResourceSetId == 0) { + pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1; + } else { + pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; + } + } + //precoderGranularity pdcch_pdu->precoderGranularity = coreset->precoderGranularity; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index d091d486ff..77ad81a67e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -2558,7 +2558,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n ul_dci_request_pdu->PDUSize = (uint8_t)(4+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(pdcch_pdu, coreset, &sched_ctrl->sched_pdcch); + nr_configure_pdcch(pdcch_pdu, coreset, &sched_ctrl->sched_pdcch, false); pdcch_pdu_coreset[coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 33933be4d7..5ab125eade 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -87,6 +87,12 @@ void schedule_nr_sib1(module_id_t module_idP, nfapi_nr_dl_tti_request_t *DL_req, nfapi_nr_tx_data_request_t *TX_req); +void schedule_nr_sib19(module_id_t module_idP, + frame_t frameP, + sub_frame_t slotP, + nfapi_nr_dl_tti_request_t *DL_req, + nfapi_nr_tx_data_request_t *TX_req); + void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, nfapi_nr_dl_tti_request_t *DL_req); /* \brief main UL scheduler function. Calls a preprocessor to decide on @@ -203,7 +209,8 @@ void find_search_space(int ss_type, void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_ControlResourceSet_t *coreset, - NR_sched_pdcch_t *pdcch); + NR_sched_pdcch_t *pdcch, + bool otherSI); NR_sched_pdcch_t set_pdcch_structure(gNB_MAC_INST *gNB_mac, NR_SearchSpace_t *ss, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 51e403ae49..1306652033 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -667,6 +667,19 @@ typedef struct { seq_arr_t lc_config; } NR_UE_sched_ctrl_t; +typedef struct { + NR_SearchSpace_t *search_space; + NR_ControlResourceSet_t *coreset; + + NR_sched_pdcch_t sched_pdcch; + NR_sched_pdsch_t sched_pdsch; + + uint32_t num_total_bytes; + + int cce_index; + uint8_t aggregation_level; +} NR_UE_sched_osi_ctrl_t; + typedef struct { uicc_t *uicc; } NRUEcontext_t; @@ -881,7 +894,9 @@ typedef struct gNB_MAC_INST_s { nr_mac_config_t radio_config; + NR_UE_sched_osi_ctrl_t *sched_osi; NR_UE_sched_ctrl_t *sched_ctrlCommon; + uint16_t cset0_bwp_start; uint16_t cset0_bwp_size; NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config[64]; diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 1c3b3d0dc8..2042d0d1f1 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -2256,7 +2256,7 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc, struct NR_SchedulingInfo2_r17 *si_schedulinginfo2_r17 = CALLOC(1, sizeof(struct NR_SchedulingInfo2_r17)); si_schedulinginfo2_r17->si_BroadcastStatus_r17 = NR_SchedulingInfo2_r17__si_BroadcastStatus_r17_broadcasting; si_schedulinginfo2_r17->si_WindowPosition_r17 = 2; - si_schedulinginfo2_r17->si_Periodicity_r17 = NR_SchedulingInfo2_r17__si_Periodicity_r17_rf16; + si_schedulinginfo2_r17->si_Periodicity_r17 = NR_SchedulingInfo2_r17__si_Periodicity_r17_rf8; struct NR_SIB_TypeInfo_v1700 *sib_type_info = CALLOC(1, sizeof(struct NR_SIB_TypeInfo_v1700)); sib_type_info->sibType_r17.present = NR_SIB_TypeInfo_v1700__sibType_r17_PR_type1_r17; From 8bc2271001f221f4ca48422b3503a8b2101c12d7 Mon Sep 17 00:00:00 2001 From: Roberto Rosca Date: Tue, 6 Aug 2024 13:39:53 +0300 Subject: [PATCH 05/87] conf parameters added (commented) + schedule sib19 only if parameters present in conf file --- openair2/GNB_APP/gnb_config.c | 3 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 6 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 31 +++++++++---------- openair2/RRC/NR/nr_rrc_config.c | 4 +-- .../gnb.sa.band66.fr1.25PRB.usrpx300.conf | 7 +++++ 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 000b9f563c..d1ed728f35 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1475,7 +1475,8 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) if (get_softmodem_params()->sa) { nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac); - nr_mac_configure_sib19(RC.nrmac[0]); + if (scc->ext2 && scc->ext2->ntn_Config_r17) + nr_mac_configure_sib19(RC.nrmac[0]); } // read F1 Setup information from config and generated MIB/SIB1 diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 5158a3c237..2b3003a0ec 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -262,10 +262,12 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_ // This schedules MIB schedule_nr_mib(module_idP, frame, slot, &sched_info->DL_req); - // This schedules SIB1 and SIB19 + // This schedules SIB1 + // SIB19 will be scheduled if ntn_Config_r17 is initialized if (get_softmodem_params()->sa == 1) { schedule_nr_sib1(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req); - schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req); + if (cc->sib19) + schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req); } // This schedule PRACH if we are not in phy_test mode diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 87b95f2e71..92826e31ce 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -398,7 +398,6 @@ static uint32_t schedule_control_sib1(module_id_t module_id, return TBS; } - static uint32_t schedule_control_other_si(module_id_t module_id, int CC_id, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, @@ -413,7 +412,7 @@ static uint32_t schedule_control_other_si(module_id_t module_id, NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; uint16_t *vrb_map = cc->vrb_map; - if (gNB_mac->sched_osi == NULL){ + if (gNB_mac->sched_osi == NULL) { gNB_mac->sched_osi = calloc(1, sizeof(NR_UE_sched_osi_ctrl_t)); struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; NR_SearchSpaceId_t osi_SearchSpace = *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation; @@ -471,7 +470,7 @@ static uint32_t schedule_control_other_si(module_id_t module_id, do { if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols))) rbSize++; - else{ + else { if (pdsch->mcs<10) pdsch->mcs++; else @@ -744,8 +743,8 @@ static void nr_fill_nfapi_dl_other_si_pdu(int Mod_idP, LOG_D(NR_MAC,"sib19:dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos); pdsch_pdu_rel15->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(0, - pdsch_pdu_rel15->BWPSize, - 1); + pdsch_pdu_rel15->BWPSize, + 1); pdsch_pdu_rel15->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS<<3,pdsch_pdu_rel15->targetCodeRate[0]); /* Fill PDCCH DL DCI PDU */ @@ -933,17 +932,19 @@ void schedule_nr_sib19(module_id_t module_idP, NR_COMMON_channels_t *cc = &gNB_mac->common_channels[0]; // get sib19 scheduling info from sib1 - struct NR_SI_SchedulingInfo_v1700* si_schedulinginfo2_r17 = cc->sib1->message.choice.c1->choice.systemInformationBlockType1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700; - struct NR_SchedulingInfo2_r17* sib19_sched_info = NULL; + struct NR_SI_SchedulingInfo_v1700 *si_schedulinginfo2_r17 = cc->sib1->message.choice.c1->choice.systemInformationBlockType1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700; + struct NR_SchedulingInfo2_r17 *sib19_sched_info = NULL; + + if (!si_schedulinginfo2_r17) { + LOG_E(GNB_APP, "SIB1 does not contain si_SchedulingInfo_v1700\n"); + return; + } bool found = false; - for (int i = 0; i < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.count; i++) - { - for (int j= 0; j < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]->sib_MappingInfo_r17.list.count; j++) - { + for (int i = 0; i < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.count; i++) { + for (int j= 0; j < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]->sib_MappingInfo_r17.list.count; j++) { if (si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]->sib_MappingInfo_r17.list.array[j]->sibType_r17.choice.type1_r17 == - NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType19) - { + NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType19) { found = true; sib19_sched_info = si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]; break; @@ -985,8 +986,7 @@ void schedule_nr_sib19(module_id_t module_idP, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config = &gNB_mac->type0_PDCCH_CSS_config[i]; if(((frameP - 1) % frame == 0) && (slotP == ((sib19_sched_info->si_WindowPosition_r17 % window_length) - 1)) && - (type0_PDCCH_CSS_config->num_rbs > 0)) - { + (type0_PDCCH_CSS_config->num_rbs > 0)) { LOG_D(NR_MAC,"(%d.%d) SIB19 transmission: ssb_index %d\n", frameP, slotP, type0_PDCCH_CSS_config->ssb_index); @@ -1018,7 +1018,6 @@ void schedule_nr_sib19(module_id_t module_idP, // Data to be transmitted memcpy(tx_req->TLVs[0].value.direct, cc->sib19_bcch_pdu, TBS); - xer_fprint(stdout, &asn_DEF_NR_BCCH_DL_SCH_Message,(void *)cc->sib19); tx_req->PDU_length = TBS; tx_req->PDU_index = pdu_index; diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 2042d0d1f1..e3f310a4c9 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -2245,7 +2245,7 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc, asn1cSeqAdd(&sib1->si_SchedulingInfo->schedulingInfoList.list,schedulingInfo);*/ // sib19 scheduling info - // this condition ensures ntn-config is initialized + // ensure ntn-config is initialized if (scc->ext2 && scc->ext2->ntn_Config_r17) { sib1->nonCriticalExtension = CALLOC(1, sizeof(struct NR_SIB1_v1610_IEs)); sib1->nonCriticalExtension->nonCriticalExtension = CALLOC(1, sizeof(struct NR_SIB1_v1630_IEs)); @@ -2458,7 +2458,7 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc, // TODO: add nonCriticalExtension if (LOG_DEBUGFLAG(DEBUG_ASN1)) { - xer_fprint(stdout, &asn_DEF_NR_SIB1, sib1_message->message.choice.c1->choice.systemInformationBlockType1); + xer_fprint(stdout, &asn_DEF_NR_BCCH_DL_SCH_Message, sib1_message); } return sib1_message; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf index 07beb41fb0..4e3ddd7f4a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf @@ -165,6 +165,13 @@ gNBs = #ntn_Config_r17 # cellSpecificKoffset_r17 = 478; # GEO satellite # cellSpecificKoffset_r17 = 40; # LEO satellite +# ta-Common-r17 = 29319745; +# positionX-r17 = 0; +# positionY-r17 = 0; +# positionZ-r17 = 32433846; +# velocityVX-r17 = 0; +# velocityVY-r17 = 0; +# velocityVZ-r17 = 0; } ); From dfbedadd5f389e7db20e545e9d877b643da965c8 Mon Sep 17 00:00:00 2001 From: Raghavendra Dinavahi Date: Wed, 18 Sep 2024 17:16:44 +0200 Subject: [PATCH 06/87] Use nr_slot_fep for sidelink, removed sl_nr_slot_fep --- openair1/PHY/MODULATION/modulation_UE.h | 9 +- openair1/PHY/MODULATION/slot_fep_nr.c | 106 ++---------------- .../PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c | 2 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 12 +- .../SCHED_NR_UE/phy_procedures_nr_ue_sl.c | 5 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 2 +- 6 files changed, 20 insertions(+), 116 deletions(-) diff --git a/openair1/PHY/MODULATION/modulation_UE.h b/openair1/PHY/MODULATION/modulation_UE.h index 68d4c2c5a2..b5849e21db 100644 --- a/openair1/PHY/MODULATION/modulation_UE.h +++ b/openair1/PHY/MODULATION/modulation_UE.h @@ -53,13 +53,8 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, unsigned char symbol, c16_t rxdataF[][frame_parms->samples_per_slot_wCP], - uint32_t linktype); -int sl_nr_slot_fep(PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, - unsigned char symbol, - unsigned char Ns, - uint32_t sample_offset, - c16_t rxdataF[][ue->SL_UE_PHY_PARAMS.sl_frame_params.samples_per_slot_wCP]); + uint32_t linktype, + uint32_t sample_offset); int nr_slot_fep_init_sync(const NR_DL_FRAME_PARMS *frame_parms, unsigned char symbol, diff --git a/openair1/PHY/MODULATION/slot_fep_nr.c b/openair1/PHY/MODULATION/slot_fep_nr.c index faee44cc9e..6cb0a05b93 100644 --- a/openair1/PHY/MODULATION/slot_fep_nr.c +++ b/openair1/PHY/MODULATION/slot_fep_nr.c @@ -34,108 +34,13 @@ #define LOG_I(A,B...) printf(A) #endif*/ -int sl_nr_slot_fep(PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, - unsigned char symbol, - unsigned char Ns, - uint32_t sample_offset, - c16_t rxdataF[][ue->SL_UE_PHY_PARAMS.sl_frame_params.samples_per_slot_wCP]) -{ - NR_DL_FRAME_PARMS *frame_params = &ue->SL_UE_PHY_PARAMS.sl_frame_params; - NR_UE_COMMON *common_vars = &ue->common_vars; - - AssertFatal(symbol < frame_params->symbols_per_slot, - "slot_fep: symbol must be between 0 and %d\n", - frame_params->symbols_per_slot - 1); - AssertFatal(Ns < frame_params->slots_per_frame, "slot_fep: Ns must be between 0 and %d\n", frame_params->slots_per_frame - 1); - - unsigned int nb_prefix_samples = frame_params->nb_prefix_samples; - unsigned int nb_prefix_samples0 = frame_params->nb_prefix_samples0; - - dft_size_idx_t dftsize = get_dft(frame_params->ofdm_symbol_size); - // This is for misalignment issues - int32_t tmp_dft_in[8192] __attribute__((aligned(32))); - - unsigned int rx_offset = frame_params->get_samples_slot_timestamp(Ns, frame_params, 0); - unsigned int abs_symbol = Ns * frame_params->symbols_per_slot + symbol; - - rx_offset += sample_offset; - - for (int idx_symb = Ns * frame_params->symbols_per_slot; idx_symb <= abs_symbol; idx_symb++) - rx_offset += (idx_symb % (0x7 << frame_params->numerology_index)) ? nb_prefix_samples : nb_prefix_samples0; - rx_offset += frame_params->ofdm_symbol_size * symbol; - - // use OFDM symbol from within 1/8th of the CP to avoid ISI - rx_offset -= (nb_prefix_samples / frame_params->ofdm_offset_divisor); - -#ifdef SL_DEBUG_SLOT_FEP - // if (ue->frame <100) - LOG_I(PHY, - "slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u\n", - Ns, - symbol, - nb_prefix_samples, - nb_prefix_samples0, - rx_offset); -#endif - - for (unsigned char aa = 0; aa < frame_params->nb_antennas_rx; aa++) { - memset(&rxdataF[aa][frame_params->ofdm_symbol_size * symbol], 0, frame_params->ofdm_symbol_size * sizeof(int32_t)); - - int16_t *rxdata_ptr = (int16_t *)&common_vars->rxdata[aa][rx_offset]; - - // if input to dft is not 256-bit aligned - if ((rx_offset & 7) != 0) { - memcpy((void *)&tmp_dft_in[0], (void *)&common_vars->rxdata[aa][rx_offset], frame_params->ofdm_symbol_size * sizeof(int32_t)); - - rxdata_ptr = (int16_t *)tmp_dft_in; - } - - dft(dftsize, rxdata_ptr, (int16_t *)&rxdataF[aa][frame_params->ofdm_symbol_size * symbol], 1); - - int symb_offset = (Ns % frame_params->slots_per_subframe) * frame_params->symbols_per_slot; - int32_t rot2 = ((uint32_t *)frame_params->symbol_rotation[2])[symbol + symb_offset]; - ((int16_t *)&rot2)[1] = -((int16_t *)&rot2)[1]; - -#ifdef SL_DEBUG_SLOT_FEP - // if (ue->frame <100) - LOG_I(PHY, - "slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", - Ns, - symbol, - rx_offset, - symbol + symb_offset, - ((int16_t *)&rot2)[0], - ((int16_t *)&rot2)[1]); -#endif - - rotate_cpx_vector((c16_t *)&rxdataF[aa][frame_params->ofdm_symbol_size * symbol], - (c16_t *)&rot2, - (c16_t *)&rxdataF[aa][frame_params->ofdm_symbol_size * symbol], - frame_params->ofdm_symbol_size, - 15); - - int16_t *shift_rot = (int16_t *)frame_params->timeshift_symbol_rotation; - - multadd_cpx_vector((int16_t *)&rxdataF[aa][frame_params->ofdm_symbol_size * symbol], - shift_rot, - (int16_t *)&rxdataF[aa][frame_params->ofdm_symbol_size * symbol], - 1, - frame_params->ofdm_symbol_size, - 15); - } - - LOG_D(PHY, "SIDELINK RX: Slot FEP: done for symbol:%d\n", symbol); - - return 0; -} - int nr_slot_fep(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *frame_parms, const UE_nr_rxtx_proc_t *proc, unsigned char symbol, c16_t rxdataF[][frame_parms->samples_per_slot_wCP], - uint32_t linktype) + uint32_t linktype, + uint32_t sample_offset) { NR_UE_COMMON *common_vars = &ue->common_vars; int Ns = proc->nr_slot_rx; @@ -148,6 +53,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, if (ue->is_synchronized) { nb_prefix_samples = frame_parms->nb_prefix_samples; nb_prefix_samples0 = frame_parms->nb_prefix_samples0; + AssertFatal(sample_offset == 0, "Sample offset if syncronised should be 0\n"); } else { nb_prefix_samples = frame_parms->nb_prefix_samples; nb_prefix_samples0 = frame_parms->nb_prefix_samples; @@ -163,14 +69,16 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, rx_offset += (idx_symb%(0x7<numerology_index)) ? nb_prefix_samples : nb_prefix_samples0; rx_offset += frame_parms->ofdm_symbol_size * symbol; + rx_offset += sample_offset; + // use OFDM symbol from within 1/8th of the CP to avoid ISI rx_offset -= (nb_prefix_samples / frame_parms->ofdm_offset_divisor); -//#ifdef DEBUG_FEP +#ifdef DEBUG_FEP // if (ue->frame <100) LOG_D(PHY,"slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u energy %d\n", Ns, symbol, nb_prefix_samples, nb_prefix_samples0, rx_offset, dB_fixed(signal_energy((int32_t *)&common_vars->rxdata[0][rx_offset],frame_parms->ofdm_symbol_size))); - //#endif +#endif for (unsigned char aa=0; aanb_antennas_rx; aa++) { int16_t *rxdata_ptr = (int16_t *)&common_vars->rxdata[aa][rx_offset]; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c index d8e1e7d548..c9483db2c1 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c @@ -447,7 +447,7 @@ nr_initial_sync_t sl_nr_slss_search(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc, /* In order to achieve correct processing for NR prefix samples is forced to 0 and then restored after function call */ for (int symbol = 0; symbol < SL_NR_NUMSYM_SLSS_NORMAL_CP; symbol++) { - sl_nr_slot_fep(UE, NULL, symbol, 0, sync_params->ssb_offset, rxdataF); + nr_slot_fep(UE, frame_parms, proc, symbol, rxdataF, link_type_sl, sync_params->ssb_offset); } sl_nr_extract_sss(UE, NULL, &metric_tdd_ncp, &phase_tdd_ncp, rxdataF); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index ce2c6c3153..ea41ba21cc 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -907,7 +907,7 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_ __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][fp->ofdm_symbol_size]; for (int i=1; i<4; i++) { - nr_slot_fep(ue, fp, proc, (ssb_start_symbol + i) % (fp->symbols_per_slot), rxdataF, link_type_dl); + nr_slot_fep(ue, fp, proc, (ssb_start_symbol + i) % (fp->symbols_per_slot), rxdataF, link_type_dl, 0); nr_pbch_channel_estimation(&ue->frame_parms, NULL, @@ -971,7 +971,7 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_ { for(int j = prs_config->SymbolStart; j < (prs_config->SymbolStart+prs_config->NumPRSSymbols); j++) { - nr_slot_fep(ue, fp, proc, (j % fp->symbols_per_slot), rxdataF, link_type_dl); + nr_slot_fep(ue, fp, proc, (j % fp->symbols_per_slot), rxdataF, link_type_dl, 0); } nr_prs_channel_estimation(gNB_id, rsc_id, i, ue, proc, fp, rxdataF); } @@ -1000,7 +1000,7 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_ uint8_t nb_symb_pdcch = phy_pdcch_config->nb_search_space > 0 ? phy_pdcch_config->pdcch_config[0].coreset.duration : 0; for (uint16_t l=0; lcsiim_vars[gNB_id]->csiim_config_pdu.l_csiim[symb_idx]; if (!slot_fep_map[symb]) { - nr_slot_fep(ue, &ue->frame_parms, proc, symb, rxdataF, link_type_dl); + nr_slot_fep(ue, &ue->frame_parms, proc, symb, rxdataF, link_type_dl, 0); slot_fep_map[symb] = true; } } @@ -1063,7 +1063,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ for(int symb = 0; symb < NR_SYMBOLS_PER_SLOT; symb++) { if(is_csi_rs_in_symbol(ue->csirs_vars[gNB_id]->csirs_config_pdu, symb)) { if (!slot_fep_map[symb]) { - nr_slot_fep(ue, &ue->frame_parms, proc, symb, rxdataF, link_type_dl); + nr_slot_fep(ue, &ue->frame_parms, proc, symb, rxdataF, link_type_dl, 0); slot_fep_map[symb] = true; } } @@ -1082,7 +1082,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ for (int m = start_symb_sch; m < (nb_symb_sch + start_symb_sch) ; m++) { if (!slot_fep_map[m]) { - nr_slot_fep(ue, &ue->frame_parms, proc, m, rxdataF, link_type_dl); + nr_slot_fep(ue, &ue->frame_parms, proc, m, rxdataF, link_type_dl, 0); slot_fep_map[m] = true; } } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c index 8a409e8ef5..37e6251fe8 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c @@ -149,7 +149,8 @@ static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue, } else { result = decoded_pdu; sl_phy_params->psbch.rx_ok++; - LOG_I(NR_PHY, "%d:%d PSBCH RX:OK. RSRP: %d dB/RE\n", proc->frame_rx, proc->nr_slot_rx, sl_phy_params->psbch.rsrp_dB_per_RE); + LOG_I(NR_PHY, "[UE%d] %d:%d PSBCH RX:OK. RSRP: %d dB/RE\n", + ue->Mod_id, proc->frame_rx, proc->nr_slot_rx, sl_phy_params->psbch.rsrp_dB_per_RE); } nr_fill_sl_indication(&sl_indication, &rx_ind, NULL, proc, ue, phy_data); @@ -191,7 +192,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr const int numsym = (fp->Ncp) ? SL_NR_NUM_SYMBOLS_SSB_EXT_CP : SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP; for (int sym = 0; sym < numsym;) { - nr_slot_fep(ue, fp, proc, sym, rxdataF, link_type_sl); + nr_slot_fep(ue, fp, proc, sym, rxdataF, link_type_sl, 0); start_meas(&sl_phy_params->channel_estimation_stats); nr_pbch_channel_estimation(fp, diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 9d5a787051..94972e913c 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -799,7 +799,7 @@ int main(int argc, char **argv) proc.nr_slot_rx = ssb_slot; proc.gNB_id = 0; for (int i = UE->symbol_offset + 1; i < UE->symbol_offset + 4; i++) { - nr_slot_fep(UE, frame_parms, &proc, i % frame_parms->symbols_per_slot, rxdataF, link_type_dl); + nr_slot_fep(UE, frame_parms, &proc, i % frame_parms->symbols_per_slot, rxdataF, link_type_dl,0); nr_pbch_channel_estimation(&UE->frame_parms, &UE->SL_UE_PHY_PARAMS, From b6b3cc519748ef686ce04b1288960485b1ac05ac Mon Sep 17 00:00:00 2001 From: Roberto Rosca Date: Tue, 13 Aug 2024 11:17:22 +0300 Subject: [PATCH 07/87] Refactor SIB scheduling - refactor nr_fill_nfapi_dl_SIB_pdu to use it on both SIB1 and OtherSI - extract tbs related calculations into function get_tbs to avoid duplicates - moved OtherSI search space initializations to nr_mac_config_scc --- openair2/LAYER2/NR_MAC_gNB/config.c | 20 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 570 +++++++----------- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 14 +- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 7 +- 5 files changed, 246 insertions(+), 367 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 944d4af46d..e4cd0d4ef0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -694,9 +694,29 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, c NR_RA_t *ra = &cc->ra[n]; nr_clear_ra_proc(ra); } + + nr_fill_sched_osi(nrmac, scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon); NR_SCHED_UNLOCK(&nrmac->sched_lock); } +void nr_fill_sched_osi(gNB_MAC_INST *nrmac, const struct NR_SetupRelease_PDCCH_ConfigCommon *pdcch_ConfigCommon) +{ + NR_SearchSpaceId_t *osi_SearchSpace = pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation; + if (osi_SearchSpace) { + nrmac->sched_osi = CALLOC(1, sizeof(*nrmac->sched_osi)); + + struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList = + pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; + AssertFatal(commonSearchSpaceList->list.count > 0, "common SearchSpace list has 0 elements\n"); + for (int i = 0; i < commonSearchSpaceList->list.count; i++) { + NR_SearchSpace_t *ss = commonSearchSpaceList->list.array[i]; + if (ss->searchSpaceId == *osi_SearchSpace) + nrmac->sched_osi->search_space = ss; + } + AssertFatal(nrmac->sched_osi->search_space != NULL, "SearchSpace cannot be null for OSI\n"); + } +} + void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac) { AssertFatal(get_softmodem_params()->sa > 0, "error: SIB1 only applicable for SA\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 2b3003a0ec..fd059bc1be 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -267,7 +267,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_ if (get_softmodem_params()->sa == 1) { schedule_nr_sib1(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req); if (cc->sib19) - schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req); + schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req, cc->sib19_bcch_length, cc->sib19_bcch_pdu); } // This schedule PRACH if we are not in phy_test mode diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 92826e31ce..18ce58f2d4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -276,6 +276,75 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, } } +uint32_t get_tbs(NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, + NR_sched_pdsch_t *pdsch, + uint32_t num_total_bytes, + uint16_t *vrb_map) +{ + NR_tda_info_t *tda_info = &pdsch->tda_info; + + const uint16_t bwpSize = type0_PDCCH_CSS_config->num_rbs; + int rbStart = type0_PDCCH_CSS_config->cset_start_rb; + + // Calculate number of PRB_DMRS + uint8_t N_PRB_DMRS = pdsch->dmrs_parms.N_PRB_DMRS; + uint16_t dmrs_length = pdsch->dmrs_parms.N_DMRS_SLOT; + LOG_D(MAC, "dlDmrsSymbPos %x\n", pdsch->dmrs_parms.dl_dmrs_symb_pos); + int mcsTableIdx = 0; + int rbSize = 0; + uint32_t TBS = 0; + do { + if (rbSize < bwpSize && !(vrb_map[rbStart + rbSize] & SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols))) + rbSize++; + else { + if (pdsch->mcs < 10) + pdsch->mcs++; + else + break; + } + TBS = nr_compute_tbs(nr_get_Qm_dl(pdsch->mcs, mcsTableIdx), + nr_get_code_rate_dl(pdsch->mcs, mcsTableIdx), + rbSize, + tda_info->nrOfSymbols, + N_PRB_DMRS * dmrs_length, + 0, + 0, + 1) + >> 3; + } while (TBS < num_total_bytes); + + if (TBS < num_total_bytes) { + for (int rb = 0; rb < bwpSize; rb++) + LOG_I(NR_MAC, "vrb_map[%d] %x\n", rbStart + rb, vrb_map[rbStart + rb]); + } + AssertFatal( + TBS >= num_total_bytes, + "Couldn't allocate enough resources for %d bytes in SIB PDSCH (rbStart %d, rbSize %d, bwpSize %d SLmask %x - [%d,%d])\n", + num_total_bytes, + rbStart, + rbSize, + bwpSize, + SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols), + tda_info->startSymbolIndex, + tda_info->nrOfSymbols); + + pdsch->rbSize = rbSize; + pdsch->rbStart = 0; + + LOG_D( + NR_MAC, + "mcs=%i, startSymbolIndex = %i, nrOfSymbols = %i, rbSize = %i, TBS = %i, dmrs_length %d, N_PRB_DMRS = %d, mappingtype = %d\n", + pdsch->mcs, + tda_info->startSymbolIndex, + tda_info->nrOfSymbols, + pdsch->rbSize, + TBS, + dmrs_length, + N_PRB_DMRS, + tda_info->mapping_type); + return TBS; +} + static uint32_t schedule_control_sib1(module_id_t module_id, int CC_id, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, @@ -335,56 +404,8 @@ static uint32_t schedule_control_sib1(module_id_t module_id, AssertFatal(gNB_mac->sched_ctrlCommon->cce_index >= 0, "Could not find CCE for coreset0\n"); - const uint16_t bwpSize = type0_PDCCH_CSS_config->num_rbs; - int rbStart = type0_PDCCH_CSS_config->cset_start_rb; + uint32_t TBS = get_tbs(type0_PDCCH_CSS_config, &gNB_mac->sched_ctrlCommon->sched_pdsch, gNB_mac->sched_ctrlCommon->num_total_bytes, vrb_map); - // Calculate number of PRB_DMRS - uint8_t N_PRB_DMRS = pdsch->dmrs_parms.N_PRB_DMRS; - uint16_t dmrs_length = pdsch->dmrs_parms.N_DMRS_SLOT; - LOG_D(MAC,"dlDmrsSymbPos %x\n",pdsch->dmrs_parms.dl_dmrs_symb_pos); - int mcsTableIdx = 0; - int rbSize = 0; - uint32_t TBS = 0; - do { - if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols))) - rbSize++; - else{ - if (pdsch->mcs<10) - pdsch->mcs++; - else - break; - } - TBS = nr_compute_tbs(nr_get_Qm_dl(pdsch->mcs, mcsTableIdx), - nr_get_code_rate_dl(pdsch->mcs, mcsTableIdx), - rbSize, tda_info->nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3; - } while (TBS < gNB_mac->sched_ctrlCommon->num_total_bytes); - - if (TBS < gNB_mac->sched_ctrlCommon->num_total_bytes) { - for (int rb = 0; rb < bwpSize; rb++) - LOG_I(NR_MAC, "vrb_map[%d] %x\n", rbStart + rb, vrb_map[rbStart + rb]); - } - AssertFatal( - TBS >= gNB_mac->sched_ctrlCommon->num_total_bytes, - "Couldn't allocate enough resources for %d bytes in SIB1 PDSCH (rbStart %d, rbSize %d, bwpSize %d SLmask %x - [%d,%d])\n", - gNB_mac->sched_ctrlCommon->num_total_bytes, - rbStart, - rbSize, - bwpSize, - SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols), - tda_info->startSymbolIndex, - tda_info->nrOfSymbols); - - pdsch->rbSize = rbSize; - pdsch->rbStart = 0; - - LOG_D(NR_MAC,"mcs = %i\n", pdsch->mcs); - LOG_D(NR_MAC,"startSymbolIndex = %i\n", tda_info->startSymbolIndex); - LOG_D(NR_MAC,"nrOfSymbols = %i\n", tda_info->nrOfSymbols); - LOG_D(NR_MAC, "rbSize = %i\n", pdsch->rbSize); - LOG_D(NR_MAC,"TBS = %i\n", TBS); - LOG_D(NR_MAC,"dmrs_length %d\n",dmrs_length); - LOG_D(NR_MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); - LOG_D(NR_MAC,"mappingtype = %d\n", tda_info->mapping_type); // Mark the corresponding RBs as used fill_pdcch_vrb_map(gNB_mac, CC_id, @@ -393,44 +414,31 @@ static uint32_t schedule_control_sib1(module_id_t module_id, gNB_mac->sched_ctrlCommon->aggregation_level, beam); for (int rb = 0; rb < pdsch->rbSize; rb++) { - vrb_map[rb + rbStart] |= SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols); + vrb_map[rb + type0_PDCCH_CSS_config->cset_start_rb] |= SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols); } return TBS; } static uint32_t schedule_control_other_si(module_id_t module_id, - int CC_id, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, - int time_domain_allocation, - NR_pdsch_dmrs_t *dmrs_parms, - NR_tda_info_t *tda_info, - uint8_t candidate_idx, - uint16_t num_total_bytes) + int CC_id, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, + int time_domain_allocation, + NR_pdsch_dmrs_t *dmrs_parms, + NR_tda_info_t *tda_info, + uint8_t candidate_idx, + int beam, + uint16_t num_total_bytes) { gNB_MAC_INST *gNB_mac = RC.nrmac[module_id]; NR_COMMON_channels_t *cc = &gNB_mac->common_channels[CC_id]; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; - uint16_t *vrb_map = cc->vrb_map; + uint16_t *vrb_map = cc->vrb_map[beam]; - if (gNB_mac->sched_osi == NULL) { - gNB_mac->sched_osi = calloc(1, sizeof(NR_UE_sched_osi_ctrl_t)); - struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; - NR_SearchSpaceId_t osi_SearchSpace = *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation; - AssertFatal(commonSearchSpaceList->list.count > 0, "common SearchSpace list has 0 elements\n"); - for (int i = 0; i < commonSearchSpaceList->list.count; i++) { - NR_SearchSpace_t * ss = commonSearchSpaceList->list.array[i]; - if (ss->searchSpaceId == osi_SearchSpace) - gNB_mac->sched_osi->search_space = ss; - } - AssertFatal(gNB_mac->sched_osi->search_space!=NULL,"SearchSpace cannot be null for RA\n"); - - gNB_mac->sched_osi->coreset = get_coreset(gNB_mac, scc, NULL, gNB_mac->sched_osi->search_space, NR_SearchSpace__searchSpaceType_PR_common); - gNB_mac->sched_osi->sched_pdcch = set_pdcch_structure(NULL, - gNB_mac->sched_osi->search_space, - gNB_mac->sched_osi->coreset, - scc, - NULL, - type0_PDCCH_CSS_config); + if (!gNB_mac->sched_osi->coreset) { + gNB_mac->sched_osi->coreset = + get_coreset(gNB_mac, scc, NULL, gNB_mac->sched_osi->search_space, NR_SearchSpace__searchSpaceType_PR_common); + gNB_mac->sched_osi->sched_pdcch = + set_pdcch_structure(NULL, gNB_mac->sched_osi->search_space, gNB_mac->sched_osi->coreset, scc, NULL, type0_PDCCH_CSS_config); } NR_sched_pdsch_t *pdsch = &gNB_mac->sched_osi->sched_pdsch; @@ -442,109 +450,77 @@ static uint32_t schedule_control_other_si(module_id_t module_id, uint8_t nr_of_candidates; - for (int i=0; i<3; i++) { - find_aggregation_candidates(&gNB_mac->sched_osi->aggregation_level, &nr_of_candidates, gNB_mac->sched_ctrlCommon->search_space,4<0) break; // choosing the lower value of aggregation level available + for (int i = 0; i < 3; i++) { + find_aggregation_candidates(&gNB_mac->sched_osi->aggregation_level, + &nr_of_candidates, + gNB_mac->sched_ctrlCommon->search_space, + 4 << i); + if (nr_of_candidates > 0) + break; // choosing the lower value of aggregation level available } - AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); + AssertFatal(nr_of_candidates > 0, "nr_of_candidates is 0\n"); gNB_mac->sched_osi->cce_index = find_pdcch_candidate(gNB_mac, - CC_id, - gNB_mac->sched_osi->aggregation_level, - nr_of_candidates, - &gNB_mac->sched_osi->sched_pdcch, - gNB_mac->sched_osi->coreset, - 0); + CC_id, + gNB_mac->sched_osi->aggregation_level, + nr_of_candidates, + beam, + &gNB_mac->sched_osi->sched_pdcch, + gNB_mac->sched_osi->coreset, + 0); AssertFatal(gNB_mac->sched_osi->cce_index >= 0, "Could not find CCE for coreset0\n"); - const uint16_t bwpSize = type0_PDCCH_CSS_config->num_rbs; - int rbStart = type0_PDCCH_CSS_config->cset_start_rb; - // Calculate number of PRB_DMRS - uint8_t N_PRB_DMRS = pdsch->dmrs_parms.N_PRB_DMRS; - uint16_t dmrs_length = pdsch->dmrs_parms.N_DMRS_SLOT; - LOG_D(MAC,"dlDmrsSymbPos %x\n",pdsch->dmrs_parms.dl_dmrs_symb_pos); - int mcsTableIdx = 0; - int rbSize = 0; - uint32_t TBS = 0; - do { - if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols))) - rbSize++; - else { - if (pdsch->mcs<10) - pdsch->mcs++; - else - break; - } - TBS = nr_compute_tbs(nr_get_Qm_dl(pdsch->mcs, mcsTableIdx), - nr_get_code_rate_dl(pdsch->mcs, mcsTableIdx), - rbSize, tda_info->nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3; - } while (TBS < gNB_mac->sched_osi->num_total_bytes); - - if (TBS < gNB_mac->sched_osi->num_total_bytes) { - for (int rb = 0; rb < bwpSize; rb++) - LOG_I(NR_MAC, "vrb_map[%d] %x\n", rbStart + rb, vrb_map[rbStart + rb]); - } - AssertFatal( - TBS >= gNB_mac->sched_osi->num_total_bytes, - "Couldn't allocate enough resources for %d bytes in SIB1 PDSCH (rbStart %d, rbSize %d, bwpSize %d SLmask %x - [%d,%d])\n", - gNB_mac->sched_osi->num_total_bytes, - rbStart, - rbSize, - bwpSize, - SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols), - tda_info->startSymbolIndex, - tda_info->nrOfSymbols); - - pdsch->rbSize = rbSize; - pdsch->rbStart = 0; - - LOG_D(NR_MAC,"mcs = %i\n", pdsch->mcs); - LOG_D(NR_MAC,"startSymbolIndex = %i\n", tda_info->startSymbolIndex); - LOG_D(NR_MAC,"nrOfSymbols = %i\n", tda_info->nrOfSymbols); - LOG_D(NR_MAC, "rbSize = %i\n", pdsch->rbSize); - LOG_D(NR_MAC,"TBS = %i\n", TBS); - LOG_D(NR_MAC,"dmrs_length %d\n",dmrs_length); - LOG_D(NR_MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); - LOG_D(NR_MAC,"mappingtype = %d\n", tda_info->mapping_type); + uint32_t TBS = get_tbs(type0_PDCCH_CSS_config, &gNB_mac->sched_osi->sched_pdsch, gNB_mac->sched_osi->num_total_bytes, vrb_map); // Mark the corresponding RBs as used fill_pdcch_vrb_map(gNB_mac, CC_id, &gNB_mac->sched_osi->sched_pdcch, gNB_mac->sched_osi->cce_index, - gNB_mac->sched_osi->aggregation_level); + gNB_mac->sched_osi->aggregation_level, + beam); for (int rb = 0; rb < pdsch->rbSize; rb++) { - vrb_map[rb + rbStart] |= SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols); + vrb_map[rb + type0_PDCCH_CSS_config->cset_start_rb] |= SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols); } return TBS; } -static void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, - nfapi_nr_dl_tti_request_body_t *dl_req, - int pdu_index, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, - uint32_t TBS, - int StartSymbolIndex, - int NrOfSymbols) +static void nr_fill_nfapi_dl_SIB_pdu(int Mod_idP, + NR_UE_sched_osi_ctrl_t *sched_osi, + NR_UE_sched_ctrl_t *sched_ctrlCommon, + nfapi_nr_dl_tti_request_body_t *dl_req, + int pdu_index, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, + uint32_t TBS, + int StartSymbolIndex, + int NrOfSymbols) { + // will set data according to SIB type (SIB1/OtherSI) + NR_sched_pdsch_t *pdsch = (sched_ctrlCommon ? &sched_ctrlCommon->sched_pdsch : &sched_osi->sched_pdsch); + NR_sched_pdcch_t *pdcch = (sched_ctrlCommon ? &sched_ctrlCommon->sched_pdcch : &sched_osi->sched_pdcch); + NR_SearchSpace_t *search_space = (sched_ctrlCommon ? sched_ctrlCommon->search_space : sched_osi->search_space); + NR_ControlResourceSet_t *coreset = (sched_ctrlCommon ? sched_ctrlCommon->coreset : sched_osi->coreset); + uint8_t aggregation_level = (sched_ctrlCommon ? sched_ctrlCommon->aggregation_level : sched_osi->aggregation_level); + int cce_index = (sched_ctrlCommon ? sched_ctrlCommon->cce_index : sched_osi->cce_index); + gNB_MAC_INST *gNB_mac = RC.nrmac[Mod_idP]; NR_COMMON_channels_t *cc = gNB_mac->common_channels; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; int mcsTableIdx = 0; - NR_sched_pdsch_t *pdsch = &gNB_mac->sched_ctrlCommon->sched_pdsch; + nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; - memset((void*)dl_tti_pdcch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); + memset(dl_tti_pdcch_pdu, 0, sizeof(*dl_tti_pdcch_pdu)); dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE; dl_tti_pdcch_pdu->PDUSize = (uint16_t)(4+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; nr_configure_pdcch(pdcch_pdu_rel15, - gNB_mac->sched_ctrlCommon->coreset, - &gNB_mac->sched_ctrlCommon->sched_pdcch, - false); + coreset, + pdcch, + sched_ctrlCommon ? false : true); nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; - memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); + memset(dl_tti_pdsch_pdu, 0, sizeof(*dl_tti_pdcch_pdu)); dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE; dl_tti_pdsch_pdu->PDUSize = (uint16_t)(4+sizeof(nfapi_nr_dl_tti_pdsch_pdu)); dl_req->nPDUs += 1; @@ -591,156 +567,14 @@ static void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex; pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols; pdsch_pdu_rel15->dlDmrsSymbPos = pdsch->dmrs_parms.dl_dmrs_symb_pos; - LOG_D(NR_MAC,"sib1:bwpStart %d, bwpSize %d\n",pdsch_pdu_rel15->BWPStart,pdsch_pdu_rel15->BWPSize); - LOG_D(NR_MAC,"sib1:rbStart %d, rbSize %d\n",pdsch_pdu_rel15->rbStart,pdsch_pdu_rel15->rbSize); - LOG_D(NR_MAC,"sib1:dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos); - pdsch_pdu_rel15->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(0, - pdsch_pdu_rel15->BWPSize, - 1); - pdsch_pdu_rel15->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS<<3,pdsch_pdu_rel15->targetCodeRate[0]); - - /* Fill PDCCH DL DCI PDU */ - nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci]; - pdcch_pdu_rel15->numDlDci++; - dci_pdu->RNTI = SI_RNTI; - dci_pdu->ScramblingId = *scc->physCellId; - dci_pdu->ScramblingRNTI = 0; - dci_pdu->AggregationLevel = gNB_mac->sched_ctrlCommon->aggregation_level; - dci_pdu->CceIndex = gNB_mac->sched_ctrlCommon->cce_index; - dci_pdu->beta_PDCCH_1_0 = 0; - dci_pdu->powerControlOffsetSS = 1; - - /* DCI payload */ - dci_pdu_rel15_t dci_payload; - memset(&dci_payload, 0, sizeof(dci_pdu_rel15_t)); - - dci_payload.bwp_indicator.val = 0; - - // frequency domain assignment - dci_payload.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0( - pdsch_pdu_rel15->rbSize, pdsch_pdu_rel15->rbStart, type0_PDCCH_CSS_config->num_rbs); - - dci_payload.time_domain_assignment.val = gNB_mac->sched_ctrlCommon->sched_pdsch.time_domain_allocation; - dci_payload.mcs = pdsch->mcs; - dci_payload.rv = pdsch_pdu_rel15->rvIndex[0]; - dci_payload.harq_pid.val = 0; - dci_payload.ndi = 0; - dci_payload.dai[0].val = 0; - dci_payload.tpc = 0; // table 7.2.1-1 in 38.213 - dci_payload.pucch_resource_indicator = 0; - dci_payload.pdsch_to_harq_feedback_timing_indicator.val = 0; - dci_payload.antenna_ports.val = 0; - dci_payload.dmrs_sequence_initialization.val = pdsch_pdu_rel15->SCID; - - int dci_format = NR_DL_DCI_FORMAT_1_0; - int rnti_type = TYPE_SI_RNTI_; - - fill_dci_pdu_rel15(NULL, - NULL, - NULL, - &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci - 1], - &dci_payload, - dci_format, - rnti_type, - 0, - gNB_mac->sched_ctrlCommon->search_space, - gNB_mac->sched_ctrlCommon->coreset, - 0, // parameter not needed for DCI 1_0 - gNB_mac->cset0_bwp_size); - - LOG_D(MAC,"BWPSize: %i\n", pdcch_pdu_rel15->BWPSize); - LOG_D(MAC,"BWPStart: %i\n", pdcch_pdu_rel15->BWPStart); - LOG_D(MAC,"SubcarrierSpacing: %i\n", pdcch_pdu_rel15->SubcarrierSpacing); - LOG_D(MAC,"CyclicPrefix: %i\n", pdcch_pdu_rel15->CyclicPrefix); - LOG_D(MAC,"StartSymbolIndex: %i\n", pdcch_pdu_rel15->StartSymbolIndex); - LOG_D(MAC,"DurationSymbols: %i\n", pdcch_pdu_rel15->DurationSymbols); - for(int n=0;n<6;n++) LOG_D(MAC,"FreqDomainResource[%i]: %x\n",n, pdcch_pdu_rel15->FreqDomainResource[n]); - LOG_D(MAC,"CceRegMappingType: %i\n", pdcch_pdu_rel15->CceRegMappingType); - LOG_D(MAC,"RegBundleSize: %i\n", pdcch_pdu_rel15->RegBundleSize); - LOG_D(MAC,"InterleaverSize: %i\n", pdcch_pdu_rel15->InterleaverSize); - LOG_D(MAC,"CoreSetType: %i\n", pdcch_pdu_rel15->CoreSetType); - LOG_D(MAC,"ShiftIndex: %i\n", pdcch_pdu_rel15->ShiftIndex); - LOG_D(MAC,"precoderGranularity: %i\n", pdcch_pdu_rel15->precoderGranularity); - LOG_D(MAC,"numDlDci: %i\n", pdcch_pdu_rel15->numDlDci); -} - - -static void nr_fill_nfapi_dl_other_si_pdu(int Mod_idP, - nfapi_nr_dl_tti_request_body_t *dl_req, - int pdu_index, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, - uint32_t TBS, - int StartSymbolIndex, - int NrOfSymbols) -{ - gNB_MAC_INST *gNB_mac = RC.nrmac[Mod_idP]; - NR_COMMON_channels_t *cc = gNB_mac->common_channels; - NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; - int mcsTableIdx = 0; - NR_sched_pdsch_t *pdsch = &gNB_mac->sched_osi->sched_pdsch; - nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; - memset((void*)dl_tti_pdcch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); - dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE; - dl_tti_pdcch_pdu->PDUSize = (uint16_t)(4+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); - dl_req->nPDUs += 1; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(pdcch_pdu_rel15, - gNB_mac->sched_osi->coreset, - &gNB_mac->sched_osi->sched_pdcch, - true); - - nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; - memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); - dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE; - dl_tti_pdsch_pdu->PDUSize = (uint16_t)(4+sizeof(nfapi_nr_dl_tti_pdsch_pdu)); - dl_req->nPDUs += 1; - nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15; - - pdsch_pdu_rel15->precodingAndBeamforming.num_prgs=0; - pdsch_pdu_rel15->precodingAndBeamforming.prg_size=0; - pdsch_pdu_rel15->precodingAndBeamforming.dig_bf_interfaces=0; - pdsch_pdu_rel15->precodingAndBeamforming.prgs_list[0].pm_idx = 0; - pdsch_pdu_rel15->precodingAndBeamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx = 0; - - pdcch_pdu_rel15->CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1; - - pdsch_pdu_rel15->pduBitmap = 0; - pdsch_pdu_rel15->rnti = SI_RNTI; - pdsch_pdu_rel15->pduIndex = pdu_index; - - pdsch_pdu_rel15->BWPSize = type0_PDCCH_CSS_config->num_rbs; - pdsch_pdu_rel15->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; - - pdsch_pdu_rel15->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; - pdsch_pdu_rel15->CyclicPrefix = 0; - - pdsch_pdu_rel15->NrOfCodewords = 1; - pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(pdsch->mcs, mcsTableIdx); - pdsch_pdu_rel15->qamModOrder[0] = nr_get_Qm_dl(pdsch->mcs, mcsTableIdx); - pdsch_pdu_rel15->mcsIndex[0] = pdsch->mcs; - pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx; - pdsch_pdu_rel15->rvIndex[0] = nr_rv_round_map[0]; - pdsch_pdu_rel15->dataScramblingId = *scc->physCellId; - pdsch_pdu_rel15->nrOfLayers = 1; - pdsch_pdu_rel15->transmissionScheme = 0; - pdsch_pdu_rel15->refPoint = 1; - pdsch_pdu_rel15->dmrsConfigType = 0; - pdsch_pdu_rel15->dlDmrsScramblingId = *scc->physCellId; - pdsch_pdu_rel15->SCID = 0; - pdsch_pdu_rel15->numDmrsCdmGrpsNoData = pdsch->dmrs_parms.numDmrsCdmGrpsNoData; - pdsch_pdu_rel15->dmrsPorts = 1; - pdsch_pdu_rel15->resourceAlloc = 1; - pdsch_pdu_rel15->rbStart = pdsch->rbStart; - pdsch_pdu_rel15->rbSize = pdsch->rbSize; - pdsch_pdu_rel15->VRBtoPRBMapping = 0; - pdsch_pdu_rel15->TBSize[0] = TBS; - pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex; - pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols; - pdsch_pdu_rel15->dlDmrsSymbPos = pdsch->dmrs_parms.dl_dmrs_symb_pos; - LOG_D(NR_MAC,"sib19:bwpStart %d, bwpSize %d\n",pdsch_pdu_rel15->BWPStart,pdsch_pdu_rel15->BWPSize); - LOG_D(NR_MAC,"sib19:rbStart %d, rbSize %d\n",pdsch_pdu_rel15->rbStart,pdsch_pdu_rel15->rbSize); - LOG_D(NR_MAC,"sib19:dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos); + LOG_D(NR_MAC, + "OtherSI:bwpStart %d, bwpSize %d, rbStart %d, rbSize %d, dlDmrsSymbPos = 0x%x\n", + pdsch_pdu_rel15->BWPStart, + pdsch_pdu_rel15->BWPSize, + pdsch_pdu_rel15->rbStart, + pdsch_pdu_rel15->rbSize, + pdsch_pdu_rel15->dlDmrsSymbPos); pdsch_pdu_rel15->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(0, pdsch_pdu_rel15->BWPSize, @@ -753,8 +587,8 @@ static void nr_fill_nfapi_dl_other_si_pdu(int Mod_idP, dci_pdu->RNTI = SI_RNTI; dci_pdu->ScramblingId = *scc->physCellId; dci_pdu->ScramblingRNTI = 0; - dci_pdu->AggregationLevel = gNB_mac->sched_osi->aggregation_level; - dci_pdu->CceIndex = gNB_mac->sched_osi->cce_index; + dci_pdu->AggregationLevel = aggregation_level; + dci_pdu->CceIndex = cce_index; dci_pdu->beta_PDCCH_1_0 = 0; dci_pdu->powerControlOffsetSS = 1; @@ -768,7 +602,7 @@ static void nr_fill_nfapi_dl_other_si_pdu(int Mod_idP, dci_payload.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0( pdsch_pdu_rel15->rbSize, pdsch_pdu_rel15->rbStart, type0_PDCCH_CSS_config->num_rbs); - dci_payload.time_domain_assignment.val = gNB_mac->sched_osi->sched_pdsch.time_domain_allocation; + dci_payload.time_domain_assignment.val = pdsch->time_domain_allocation; dci_payload.mcs = pdsch->mcs; dci_payload.rv = pdsch_pdu_rel15->rvIndex[0]; dci_payload.harq_pid.val = 0; @@ -779,7 +613,7 @@ static void nr_fill_nfapi_dl_other_si_pdu(int Mod_idP, dci_payload.pdsch_to_harq_feedback_timing_indicator.val = 0; dci_payload.antenna_ports.val = 0; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu_rel15->SCID; - dci_payload.system_info_indicator = 1; + dci_payload.system_info_indicator = sched_ctrlCommon ? 0 : 1; int dci_format = NR_DL_DCI_FORMAT_1_0; int rnti_type = TYPE_SI_RNTI_; @@ -792,26 +626,28 @@ static void nr_fill_nfapi_dl_other_si_pdu(int Mod_idP, dci_format, rnti_type, 0, - gNB_mac->sched_osi->search_space, - gNB_mac->sched_osi->coreset, + search_space, + coreset, 0, gNB_mac->cset0_bwp_size); - - LOG_D(MAC,"BWPSize: %i\n", pdcch_pdu_rel15->BWPSize); - LOG_D(MAC,"BWPStart: %i\n", pdcch_pdu_rel15->BWPStart); - LOG_D(MAC,"SubcarrierSpacing: %i\n", pdcch_pdu_rel15->SubcarrierSpacing); - LOG_D(MAC,"CyclicPrefix: %i\n", pdcch_pdu_rel15->CyclicPrefix); - LOG_D(MAC,"StartSymbolIndex: %i\n", pdcch_pdu_rel15->StartSymbolIndex); - LOG_D(MAC,"DurationSymbols: %i\n", pdcch_pdu_rel15->DurationSymbols); - for(int n=0;n<6;n++) LOG_D(MAC,"FreqDomainResource[%i]: %x\n",n, pdcch_pdu_rel15->FreqDomainResource[n]); - LOG_D(MAC,"CceRegMappingType: %i\n", pdcch_pdu_rel15->CceRegMappingType); - LOG_D(MAC,"RegBundleSize: %i\n", pdcch_pdu_rel15->RegBundleSize); - LOG_D(MAC,"InterleaverSize: %i\n", pdcch_pdu_rel15->InterleaverSize); - LOG_D(MAC,"CoreSetType: %i\n", pdcch_pdu_rel15->CoreSetType); - LOG_D(MAC,"ShiftIndex: %i\n", pdcch_pdu_rel15->ShiftIndex); - LOG_D(MAC,"precoderGranularity: %i\n", pdcch_pdu_rel15->precoderGranularity); - LOG_D(MAC,"numDlDci: %i\n", pdcch_pdu_rel15->numDlDci); + LOG_D(MAC, + "BWPSize: %3i, BWPStart: %3i, SubcarrierSpacing: %i, CyclicPrefix: %i, StartSymbolIndex: %i, DurationSymbols: %i, " + "CceRegMappingType: %i, RegBundleSize: %i, InterleaverSize: %i, CoreSetType: %i, ShiftIndex: %i, precoderGranularity: %i, " + "numDlDci: %i\n", + pdcch_pdu_rel15->BWPSize, + pdcch_pdu_rel15->BWPStart, + pdcch_pdu_rel15->SubcarrierSpacing, + pdcch_pdu_rel15->CyclicPrefix, + pdcch_pdu_rel15->StartSymbolIndex, + pdcch_pdu_rel15->DurationSymbols, + pdcch_pdu_rel15->CceRegMappingType, + pdcch_pdu_rel15->RegBundleSize, + pdcch_pdu_rel15->InterleaverSize, + pdcch_pdu_rel15->CoreSetType, + pdcch_pdu_rel15->ShiftIndex, + pdcch_pdu_rel15->precoderGranularity, + pdcch_pdu_rel15->numDlDci); } void schedule_nr_sib1(module_id_t module_idP, @@ -885,7 +721,15 @@ void schedule_nr_sib1(module_id_t module_idP, nfapi_nr_dl_tti_request_body_t *dl_req = &DL_req->dl_tti_request_body; int pdu_index = gNB_mac->pdu_index[0]++; - nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, pdu_index, type0_PDCCH_CSS_config, TBS, tda_info.startSymbolIndex, tda_info.nrOfSymbols); + nr_fill_nfapi_dl_SIB_pdu(module_idP, + NULL, + gNB_mac->sched_ctrlCommon, + dl_req, + pdu_index, + type0_PDCCH_CSS_config, + TBS, + tda_info.startSymbolIndex, + tda_info.nrOfSymbols); const int ntx_req = TX_req->Number_of_PDUs; nfapi_nr_pdu_t *tx_req = &TX_req->pdu_list[ntx_req]; @@ -915,14 +759,30 @@ void schedule_nr_sib1(module_id_t module_idP, } } +struct NR_SchedulingInfo2_r17 *find_sib19_sched_info(const struct NR_SI_SchedulingInfo_v1700 *si_schedulinginfo2_r17) +{ + for (int i = 0; i < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.count; i++) { + const struct NR_SIB_Mapping_v1700 *sib_MappingInfo_r17 = + &si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]->sib_MappingInfo_r17; + for (int j = 0; j < sib_MappingInfo_r17->list.count; j++) { + if (sib_MappingInfo_r17->list.array[j]->sibType_r17.choice.type1_r17 + == NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType19) { + return si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]; + } + } + } + return NULL; +} + void schedule_nr_sib19(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, nfapi_nr_dl_tti_request_t *DL_req, - nfapi_nr_tx_data_request_t *TX_req) + nfapi_nr_tx_data_request_t *TX_req, + int sib19_bcch_length, + uint8_t *sib19_bcch_pdu) { /* already mutex protected: held in gNB_dlsch_ulsch_scheduler() */ - // TODO: Get these values from RRC const int CC_id = 0; uint8_t candidate_idx = 0; @@ -931,35 +791,23 @@ void schedule_nr_sib19(module_id_t module_idP, NR_ServingCellConfigCommon_t *scc = gNB_mac->common_channels[CC_id].ServingCellConfigCommon; NR_COMMON_channels_t *cc = &gNB_mac->common_channels[0]; + // there is no reason to execute further if sched_osi not initialized + if (!gNB_mac->sched_osi) + return; + // get sib19 scheduling info from sib1 struct NR_SI_SchedulingInfo_v1700 *si_schedulinginfo2_r17 = cc->sib1->message.choice.c1->choice.systemInformationBlockType1->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->si_SchedulingInfo_v1700; - struct NR_SchedulingInfo2_r17 *sib19_sched_info = NULL; - if (!si_schedulinginfo2_r17) { LOG_E(GNB_APP, "SIB1 does not contain si_SchedulingInfo_v1700\n"); return; } - bool found = false; - for (int i = 0; i < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.count; i++) { - for (int j= 0; j < si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]->sib_MappingInfo_r17.list.count; j++) { - if (si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]->sib_MappingInfo_r17.list.array[j]->sibType_r17.choice.type1_r17 == - NR_SIB_TypeInfo_v1700__sibType_r17__type1_r17_sibType19) { - found = true; - sib19_sched_info = si_schedulinginfo2_r17->schedulingInfoList2_r17.list.array[i]; - break; - } - } - if (found) - break; - } - - if (!found) - { + struct NR_SchedulingInfo2_r17 *sib19_sched_info = find_sib19_sched_info(si_schedulinginfo2_r17); + if (!sib19_sched_info) { LOG_D(GNB_APP, "SIB1 does not contain scheduling info for SIB19\n"); return; } - + // convert periodicity enum type into actual frames number int frame = 8 << sib19_sched_info->si_Periodicity_r17; @@ -988,6 +836,9 @@ void schedule_nr_sib19(module_id_t module_idP, (slotP == ((sib19_sched_info->si_WindowPosition_r17 % window_length) - 1)) && (type0_PDCCH_CSS_config->num_rbs > 0)) { + const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + NR_beam_alloc_t beam = beam_allocation_procedure(&gNB_mac->beam_info, frameP, slotP, i, n_slots_frame); + AssertFatal(beam.idx >= 0, "Cannot allocate SIB19 corresponding to SSB %d in any available beam\n", i); LOG_D(NR_MAC,"(%d.%d) SIB19 transmission: ssb_index %d\n", frameP, slotP, type0_PDCCH_CSS_config->ssb_index); NR_tda_info_t tda_info = set_tda_info_from_list(scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList, time_domain_allocation); @@ -1001,23 +852,34 @@ void schedule_nr_sib19(module_id_t module_idP, 1); // Configure sched_osi for SIB19 - uint32_t TBS = schedule_control_other_si(module_idP, CC_id, - type0_PDCCH_CSS_config, - time_domain_allocation, - &dmrs_parms, - &tda_info, - candidate_idx, - cc->sib19_bcch_length); + uint32_t TBS = schedule_control_other_si(module_idP, + CC_id, + type0_PDCCH_CSS_config, + time_domain_allocation, + &dmrs_parms, + &tda_info, + candidate_idx, + beam.idx, + sib19_bcch_length); nfapi_nr_dl_tti_request_body_t *dl_req = &DL_req->dl_tti_request_body; int pdu_index = gNB_mac->pdu_index[0]++; - nr_fill_nfapi_dl_other_si_pdu(module_idP, dl_req, pdu_index, type0_PDCCH_CSS_config, TBS, tda_info.startSymbolIndex, tda_info.nrOfSymbols); + + nr_fill_nfapi_dl_SIB_pdu(module_idP, + gNB_mac->sched_osi, + NULL, + dl_req, + pdu_index, + type0_PDCCH_CSS_config, + TBS, + tda_info.startSymbolIndex, + tda_info.nrOfSymbols); const int ntx_req = TX_req->Number_of_PDUs; nfapi_nr_pdu_t *tx_req = &TX_req->pdu_list[ntx_req]; // Data to be transmitted - memcpy(tx_req->TLVs[0].value.direct, cc->sib19_bcch_pdu, TBS); + memcpy(tx_req->TLVs[0].value.direct, sib19_bcch_pdu, TBS); tx_req->PDU_length = TBS; tx_req->PDU_index = pdu_index; @@ -1032,11 +894,11 @@ void schedule_nr_sib19(module_id_t module_idP, T(T_GNB_MAC_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), - T_INT(0xffff), + T_INT(SI_RNTI), T_INT(frameP), T_INT(slotP), T_INT(0 /* harq_pid */), - T_BUFFER(cc->sib19_bcch_pdu, cc->sib19_bcch_length)); + T_BUFFER(sib19_bcch_pdu, sib19_bcch_length)); } } } \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index f5c322ecaa..6d0dc01112 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -893,17 +893,9 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, pdcch_pdu->InterleaverSize = pdcch->InterleaverSize; pdcch_pdu->ShiftIndex = pdcch->ShiftIndex; - if (otherSI) { - pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; - } - else { - if (coreset->controlResourceSetId == 0) { - pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1; - } else { - pdcch_pdu->CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; - } - } - + pdcch_pdu->CoreSetType = + (otherSI || coreset->controlResourceSetId != 0) ? NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG : NFAPI_NR_CSET_CONFIG_MIB_SIB1; + //precoderGranularity pdcch_pdu->precoderGranularity = coreset->precoderGranularity; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 5ab125eade..a869e172fd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -46,6 +46,7 @@ void mac_top_init_gNB(ngran_node_t node_type, void nr_mac_send_f1_setup_req(void); void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, const nr_mac_config_t *mac_config); +void nr_fill_sched_osi(gNB_MAC_INST *nrmac, const struct NR_SetupRelease_PDCCH_ConfigCommon *pdcch_ConfigCommon); void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac); void nr_mac_configure_sib19(gNB_MAC_INST *nrmac); @@ -91,7 +92,11 @@ void schedule_nr_sib19(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, nfapi_nr_dl_tti_request_t *DL_req, - nfapi_nr_tx_data_request_t *TX_req); + nfapi_nr_tx_data_request_t *TX_req, + int sib19_bcch_length, + uint8_t *sib19_bcch_pdu); + +struct NR_SchedulingInfo2_r17* find_sib19_sched_info(const struct NR_SI_SchedulingInfo_v1700*); void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, nfapi_nr_dl_tti_request_t *DL_req); From 385999dc5e7a936492f2194d3520edfdb2cb476d Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 9 Aug 2024 12:21:47 +0200 Subject: [PATCH 08/87] logging improvements --- .../PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index ee83cccad0..40e8395b14 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -509,9 +509,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, int32_t median[MAX_ANT][MAX_ANT]; for (int aatx = 0; aatx < nl; aatx++) for (int aarx = 0; aarx < n_rx; aarx++) { - // LOG_I(PHY, "nb_rb %d len %d avg_%d_%d Power per SC is %d\n",nb_rb, len,aarx, aatx,avg[aatx*n_rx+aarx]); avgs = cmax(avgs, avg[aatx][aarx]); - // LOG_I(PHY, "avgs Power per SC is %d\n", avgs); + LOG_D(PHY, "nb_rb %d avg_%d_%d Power per SC is %d\n", nb_rb_pdsch, aarx, aatx, avg[aatx][aarx]); + LOG_D(PHY, "avgs Power per SC is %d\n", avgs); median[aatx][aarx] = avg[aatx][aarx]; } if (nl > 1) { @@ -523,7 +523,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } } *log2_maxh = (log2_approx(avgs) / 2) + 1; - // LOG_I(PHY, "avgs Power per SC is %d lg2_maxh %d\n", avgs, log2_maxh); LOG_D(PHY, "[DLSCH] AbsSubframe %d.%d log2_maxh = %d (%d)\n", frame % 1024, nr_slot_rx, *log2_maxh, avgs); } stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_LEVEL_STATS); @@ -1099,10 +1098,9 @@ void nr_dlsch_channel_level(uint32_t rx_size_symbol, simde__m128i *dl_ch128, avg128D; //nb_rb*nre = y * 2^x int16_t x = factor2(len); - int16_t y = (len)>>x; - LOG_D(NR_PHY, "%s: %d = %d * 2^(%d)\n", __func__, len, y, x); + int16_t y = (len) >> x; uint32_t nb_rb_0 = len / NR_NB_SC_PER_RB + ((len % NR_NB_SC_PER_RB) ? 1 : 0); - + LOG_D(NR_PHY, "nb_rb_0 %d len %d = %d * 2^(%d)\n", nb_rb_0, len, y, x); for (int aatx = 0; aatx < n_tx; aatx++) { for (int aarx = 0; aarx < n_rx; aarx++) { //clear average level @@ -1118,7 +1116,7 @@ void nr_dlsch_channel_level(uint32_t rx_size_symbol, } int32_t *tmp = (int32_t *)&avg128D; avg[aatx][aarx] = ((int64_t)tmp[0] + tmp[1] + tmp[2] + tmp[3]) / y; - // printf("Channel level : %d\n",avg[(aatx<<1)+aarx]); + LOG_D(PHY, "Channel level: %d\n", avg[aatx][aarx]); } } } @@ -1152,7 +1150,7 @@ static void nr_dlsch_channel_level_median(uint32_t rx_size_symbol, } median[aatx][aarx] = (max + min) >> 1; - //printf("Channel level median [%d]: %d max = %d min = %d\n",aatx*n_rx + aarx, median[aatx*n_rx + aarx],max,min); + LOG_D(PHY, "Channel level median [%d][%d]: %d max = %ld min = %ld\n", aatx, aarx, median[aatx][aarx], max, min); } } } From 196effa1144fa32b3d57ba8648d850297c36287c Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 23 Sep 2024 11:54:48 +0200 Subject: [PATCH 09/87] fix PMI extraction, X1 and X2 order was wrong --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index d7fb5611ac..bf33bfbac6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -675,8 +675,8 @@ static void tci_handling(NR_UE_info_t *UE, frame_t frame, slot_t slot) static uint8_t pickandreverse_bits(uint8_t *payload, uint16_t bitlen, uint8_t start_bit) { uint8_t rev_bits = 0; - for (int i=0; i>((start_bit+i)%8))&0x01)<<(bitlen-i-1); + for (int i = 0; i < bitlen; i++) + rev_bits |= ((payload[(start_bit + i) / 8] >> ((start_bit + i) % 8)) & 0x01) << (bitlen - i - 1); return rev_bits; } @@ -819,18 +819,18 @@ static uint8_t evaluate_pmi_report(uint8_t *payload, { int x1_bitlen = csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]; int x2_bitlen = csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; - int tot_bitlen = x1_bitlen + x2_bitlen; //in case of 2 port CSI configuration x1 is empty and the information bits are in x2 - int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits); - - sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi & ((1 << x1_bitlen) - 1); - sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi >> x1_bitlen) & ((1 << x2_bitlen) - 1); - LOG_D(MAC,"PMI Report: X1 %d X2 %d\n", + int starting_bit = cumul_bits; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = pickandreverse_bits(payload, x1_bitlen, starting_bit); + starting_bit += x1_bitlen; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = pickandreverse_bits(payload, x2_bitlen, starting_bit); + LOG_D(NR_MAC, + "PMI Report: X1 %d X2 %d\n", sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1, sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2); - return tot_bitlen; + return x1_bitlen + x2_bitlen; } static int evaluate_li_report(uint8_t *payload, From d304865489a4ff2614dda5347325c27fb9695336 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 9 Aug 2024 12:29:13 +0200 Subject: [PATCH 10/87] fix for log2_approx to approximate to the nearest neighbor, instead of ceil --- openair1/PHY/TOOLS/log2_approx.c | 56 +++++++++++++------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/openair1/PHY/TOOLS/log2_approx.c b/openair1/PHY/TOOLS/log2_approx.c index acd1534857..5b4d069663 100644 --- a/openair1/PHY/TOOLS/log2_approx.c +++ b/openair1/PHY/TOOLS/log2_approx.c @@ -21,56 +21,46 @@ unsigned char log2_approx(unsigned int x) { + unsigned char l2 = 0; + unsigned int tmp = x >> 1; - int i; - unsigned char l2; + while (tmp) { + l2++; + tmp >>= 1; + } - l2=0; + if (l2) + l2 += (x >> (l2 - 1)) & 1; - for (i=0; i<31; i++) - if ((x&(1<> 1; - int i; - unsigned char l2; + while (tmp) { + l2++; + tmp >>= 1; + } - l2=0; + if (l2) + l2 += (x >> (l2 - 1)) & 1; - for (i=0; i<63; i++) - if ((x&(((long long int) 1)< Date: Mon, 12 Aug 2024 13:08:55 +0200 Subject: [PATCH 11/87] use SIMDE intrinsic to count leading zeroes and make rounding exact --- openair1/PHY/TOOLS/log2_approx.c | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/openair1/PHY/TOOLS/log2_approx.c b/openair1/PHY/TOOLS/log2_approx.c index 5b4d069663..4b95fc7978 100644 --- a/openair1/PHY/TOOLS/log2_approx.c +++ b/openair1/PHY/TOOLS/log2_approx.c @@ -19,18 +19,19 @@ * contact@openairinterface.org */ +#include + unsigned char log2_approx(unsigned int x) { - unsigned char l2 = 0; - unsigned int tmp = x >> 1; + const unsigned int round_val = 3037000499U; // 2^31.5 + if (!x) + return 0; - while (tmp) { - l2++; - tmp >>= 1; - } - - if (l2) - l2 += (x >> (l2 - 1)) & 1; + int l2 = simde_x_clz32(x); + if (x > (round_val >> l2)) + l2 = 32 - l2; + else + l2 = 31 - l2; return l2; } @@ -50,16 +51,15 @@ unsigned char factor2(unsigned int x) unsigned char log2_approx64(unsigned long long int x) { - unsigned char l2 = 0; - unsigned long long int tmp = x >> 1; + const unsigned long long round_val = 13043817825332782212ULL; // 2^63.5 + if (!x) + return 0; - while (tmp) { - l2++; - tmp >>= 1; - } - - if (l2) - l2 += (x >> (l2 - 1)) & 1; + int l2 = simde_x_clz64(x); + if (x > (round_val >> l2)) + l2 = 64 - l2; + else + l2 = 63 - l2; return l2; } From 58a2966499b3835b24c153337b90b87707f76a5a Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 12 Aug 2024 13:21:06 +0200 Subject: [PATCH 12/87] add test for log2_approx() --- openair1/PHY/TOOLS/tests/CMakeLists.txt | 6 +++++ openair1/PHY/TOOLS/tests/test_log2_approx.cpp | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 openair1/PHY/TOOLS/tests/test_log2_approx.cpp diff --git a/openair1/PHY/TOOLS/tests/CMakeLists.txt b/openair1/PHY/TOOLS/tests/CMakeLists.txt index 2822e058fd..591dfcd430 100644 --- a/openair1/PHY/TOOLS/tests/CMakeLists.txt +++ b/openair1/PHY/TOOLS/tests/CMakeLists.txt @@ -9,3 +9,9 @@ target_link_libraries(benchmark_rotate_vector PRIVATE benchmark::benchmark UTIL add_dependencies(tests benchmark_rotate_vector) add_test(NAME benchmark_rotate_vector COMMAND ./benchmark_rotate_vector) + +add_executable(test_log2_approx test_log2_approx.cpp ../log2_approx.c) +target_link_libraries(test_log2_approx PRIVATE GTest::gtest LOG minimal_lib) +add_dependencies(tests test_log2_approx) +add_test(NAME test_log2_approx + COMMAND ./test_log2_approx) diff --git a/openair1/PHY/TOOLS/tests/test_log2_approx.cpp b/openair1/PHY/TOOLS/tests/test_log2_approx.cpp new file mode 100644 index 0000000000..23cae706f6 --- /dev/null +++ b/openair1/PHY/TOOLS/tests/test_log2_approx.cpp @@ -0,0 +1,24 @@ +#include +extern "C" { +#include "openair1/PHY/TOOLS/tools_defs.h" +#include "common/utils/LOG/log.h" +} +#include + +uint8_t log2_approx_ref(uint32_t x) +{ + return std::round(std::log2(x)); +} + +TEST(log2_approx_ref, complete) +{ + for (uint32_t i = 0; i < UINT32_MAX; i++) + EXPECT_EQ(log2_approx(i), log2_approx_ref(i)); +} + +int main(int argc, char **argv) +{ + logInit(); + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} From 4b679c07935627af21d8f4393a2bff155b96ef63 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 12 Aug 2024 14:56:11 +0200 Subject: [PATCH 13/87] add test for log2_approx64() --- openair1/PHY/TOOLS/tests/test_log2_approx.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/TOOLS/tests/test_log2_approx.cpp b/openair1/PHY/TOOLS/tests/test_log2_approx.cpp index 23cae706f6..c05540b61c 100644 --- a/openair1/PHY/TOOLS/tests/test_log2_approx.cpp +++ b/openair1/PHY/TOOLS/tests/test_log2_approx.cpp @@ -10,12 +10,28 @@ uint8_t log2_approx_ref(uint32_t x) return std::round(std::log2(x)); } -TEST(log2_approx_ref, complete) +uint8_t log2_approx64_ref(unsigned long long int x) +{ + return std::round(std::log2(static_cast(x))); +} + +TEST(log2_approx, complete) { for (uint32_t i = 0; i < UINT32_MAX; i++) EXPECT_EQ(log2_approx(i), log2_approx_ref(i)); } +TEST(log2_approx64, boundaries) +{ + for (long double i = 0; i < 64; i++) { + unsigned long long i2 = std::pow(2.0L, i + 0.5L); + for (unsigned long long j = -10; j <= 10; j++) { + unsigned long long x = i2 + j; + EXPECT_EQ(log2_approx64(x), log2_approx64_ref(x)); + } + } +} + int main(int argc, char **argv) { logInit(); From 1b97cdafcd0f54da3d5e80c79c20d313c66b1b48 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 20 Aug 2024 16:16:53 +0200 Subject: [PATCH 14/87] improve LLR scaling for better performance --- openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 10 ++++------ openair1/PHY/nr_phy_common/src/nr_phy_common.c | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 4640ff0746..af675e5d49 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -1682,15 +1682,13 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, for (int nl = 0; nl < rel15_ul->nrOfLayers; nl++) for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) - avgs = cmax(avgs, avg[nl * frame_parms->nb_antennas_rx + aarx]); - - pusch_vars->log2_maxh = (log2_approx(avgs) >> 1); + avgs = cmax(avgs, avg[nl * frame_parms->nb_antennas_rx + aarx]); if (rel15_ul->nrOfLayers == 2 && rel15_ul->qam_mod_order >= 6) pusch_vars->log2_maxh = (log2_approx(avgs) >> 1) - 3; // for MMSE - else if (rel15_ul->nrOfLayers == 1) - pusch_vars->log2_maxh = (log2_approx(avgs) >> 1) + 1 + log2_approx(frame_parms->nb_antennas_rx >> 2); - + else + pusch_vars->log2_maxh = (log2_approx(avgs) >> 1) + 1 + log2_approx(frame_parms->nb_antennas_rx >> 1); + if (pusch_vars->log2_maxh < 0) pusch_vars->log2_maxh = 0; diff --git a/openair1/PHY/nr_phy_common/src/nr_phy_common.c b/openair1/PHY/nr_phy_common/src/nr_phy_common.c index 8c45fe4e72..ef10837d2d 100644 --- a/openair1/PHY/nr_phy_common/src/nr_phy_common.c +++ b/openair1/PHY/nr_phy_common/src/nr_phy_common.c @@ -46,8 +46,8 @@ void nr_qpsk_llr(int32_t *rxdataF_comp, int16_t *llr, uint32_t nb_re) c16_t *rxF = (c16_t *)rxdataF_comp; c16_t *llr32 = (c16_t *)llr; for (int i = 0; i < nb_re; i++) { - llr32[i].r = rxF[i].r >> 3; - llr32[i].i = rxF[i].i >> 3; + llr32[i].r = rxF[i].r >> 4; + llr32[i].i = rxF[i].i >> 4; } } From 900a78fd9b235ec0782c5f9eb3e089ee12b67ae6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 22 Apr 2024 07:24:45 +0200 Subject: [PATCH 15/87] preliminary cleanup --- doc/SW_archi.md | 6 ----- openair1/PHY/INIT/nr_init_ue.c | 11 +++++--- openair1/SCHED_NR/nr_ru_procedures.c | 40 ++-------------------------- openair1/SCHED_NR/sched_nr.h | 2 -- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 6 ++--- 5 files changed, 12 insertions(+), 53 deletions(-) diff --git a/doc/SW_archi.md b/doc/SW_archi.md index 277b4e3a9e..b186bea524 100644 --- a/doc/SW_archi.md +++ b/doc/SW_archi.md @@ -98,12 +98,6 @@ The infinite loop: raw incoming data is in buffer called "rxdata" We derivate frame number, slot number, ... from the RX timestamp {: .func2} -## nr_fep_full() -"front end processing" of uplink signal -performs DFT on the signal -it computes the buffer rxdataF (for frequency) from rxdata (samples over time) -rxdataF is the rxdata in frequency domain, phase aligned -{: .func3} ## gNB_top() only compute frame numbre, slot number, ... {: .func3} diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 3985efb9b7..9f040537d0 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -499,15 +499,16 @@ void clean_UE_harq(PHY_VARS_NR_UE *UE) } -void init_N_TA_offset(PHY_VARS_NR_UE *ue){ - +void init_N_TA_offset(PHY_VARS_NR_UE *ue) +{ NR_DL_FRAME_PARMS *fp = &ue->frame_parms; // No timing offset for Sidelink, refer to 3GPP 38.211 Section 8.5 if (fp->frame_type == FDD || ue->sl_mode == 2) { ue->N_TA_offset = 0; } else { - int N_TA_offset = fp->ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 + // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 + int N_TA_offset = fp->ul_CarrierFreq < 6e9 ? 400 : 431; double factor = 1.0; switch (fp->numerology_index) { @@ -538,7 +539,9 @@ void init_N_TA_offset(PHY_VARS_NR_UE *ue){ ue->ta_frame = -1; ue->ta_slot = -1; - LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d, mu %d)\n", ue->Mod_id, ue->N_TA_offset, factor, fp->ul_CarrierFreq, fp->N_RB_DL, fp->numerology_index); + LOG_I(PHY, + "UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d, mu %d)\n", + ue->Mod_id, ue->N_TA_offset, factor, fp->ul_CarrierFreq, fp->N_RB_DL, fp->numerology_index); } } diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 16a06c6e97..2b26848170 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -224,42 +224,6 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) { stop_meas(&ru->precoding_stats); } - -void nr_fep_full(RU_t *ru, int slot) { - - RU_proc_t *proc = &ru->proc; - int l, aa; - NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; - - // if ((fp->frame_type == TDD) && - // (subframe_select(fp,proc->tti_rx) != NR_UPLINK_SLOT)) return; - - LOG_D(PHY,"In fep_full for slot = %d\n", proc->tti_rx); - - start_meas(&ru->ofdm_demod_stats); - if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 ); - - - // remove_7_5_kHz(ru,proc->tti_rx<<1); - // remove_7_5_kHz(ru,1+(proc->tti_rx<<1)); - int offset = (proc->tti_rx % RU_RX_SLOT_DEPTH) * (fp->symbols_per_slot * fp->ofdm_symbol_size); - for (l = 0; l < fp->symbols_per_slot; l++) { - for (aa = 0; aa < fp->nb_antennas_rx; aa++) { - nr_slot_fep_ul(fp, - ru->common.rxdata[aa], - &ru->common.rxdataF[aa][offset], - l, - proc->tti_rx, - ru->N_TA_offset); - } - } - - if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 ); - stop_meas(&ru->ofdm_demod_stats); - - -} - // core routine for FEP TX, called from threads in RU TX thread-pool void nr_feptx(void *arg) { @@ -363,8 +327,8 @@ void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) { } // core RX FEP routine, called by threads in RU thread-pool -void nr_fep(void* arg) { - +void nr_fep(void* arg) +{ feprx_cmd_t *feprx_cmd = (feprx_cmd_t *)arg; RU_t *ru = feprx_cmd->ru; diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index 4e1c7e2509..c31d3669a4 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -40,10 +40,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx); void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa); -void fep_full(RU_t *ru,int slot); void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx); void nr_feptx_prec_control(RU_t *ru,int frame,int tti_tx); -void nr_fep_full(RU_t *ru, int slot); void nr_fep_tp(RU_t *ru, int slot); void nr_feptx_tp(RU_t *ru, int frame_tx, int slot); void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 312d5778b3..f8a3582206 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -328,7 +328,6 @@ static void configure_dlsch(NR_UE_DLSCH_t *dlsch0, static void configure_ta_command(PHY_VARS_NR_UE *ue, fapi_nr_ta_command_pdu *ta_command_pdu) { - /* Time Alignment procedure // - UE processing capability 1 // - Setting the TA update to be applied after the reception of the TA command @@ -369,7 +368,7 @@ static void configure_ta_command(PHY_VARS_NR_UE *ue, fapi_nr_ta_command_pdu *ta_ /* Time alignment procedure */ // N_t_1 + N_t_2 + N_TA_max must be in msec const double t_subframe = 1.0; // subframe duration of 1 msec - const int ul_tx_timing_adjustment = 1 + (int)ceil(slots_per_subframe*(N_t_1 + N_t_2 + N_TA_max + 0.5)/t_subframe); + const int ul_tx_timing_adjustment = 1 + (int)ceil(slots_per_subframe * (N_t_1 + N_t_2 + N_TA_max + 0.5) / t_subframe); if (ta_command_pdu->is_rar) { ue->ta_slot = ta_command_pdu->ta_slot; @@ -383,7 +382,8 @@ static void configure_ta_command(PHY_VARS_NR_UE *ue, fapi_nr_ta_command_pdu *ta_ ue->ta_frame = ta_command_pdu->ta_frame; ue->ta_command = ta_command_pdu->ta_command; } - LOG_D(PHY,"TA command received in Frame.Slot %d.%d -- Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n", + LOG_D(PHY, + "TA command received in %d.%d Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n", ta_command_pdu->ta_frame, ta_command_pdu->ta_slot, ue->ta_frame, ue->ta_slot); } From a4945802102096004487411ba23dcffb245797ed Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 22 Apr 2024 07:49:37 +0200 Subject: [PATCH 16/87] configuring n_TimingAdvanceOffset from upper layers, if present --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 1 + openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 10 ++++++++++ openair2/LAYER2/NR_MAC_UE/config_ue.c | 20 +++++++++++++++++++ openair2/LAYER2/NR_MAC_UE/mac_defs.h | 1 + openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 8 +++++--- 6 files changed, 38 insertions(+), 3 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index 1c0c596253..f0d9b73e63 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -550,6 +550,7 @@ typedef struct { int ta_frame; int ta_slot; int ta_command; + int ta_offset; bool is_rar; } fapi_nr_ta_command_pdu; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index f8a3582206..32fa53cc60 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -382,9 +382,19 @@ static void configure_ta_command(PHY_VARS_NR_UE *ue, fapi_nr_ta_command_pdu *ta_ ue->ta_frame = ta_command_pdu->ta_frame; ue->ta_command = ta_command_pdu->ta_command; } + LOG_D(PHY, "TA command received in %d.%d Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n", ta_command_pdu->ta_frame, ta_command_pdu->ta_slot, ue->ta_frame, ue->ta_slot); + + if (ta_command_pdu->ta_offset != -1) { + // ta_offset_samples : ta_offset = samples_per_subframe : (Δf_max x N_f / 1000) + // As described in Section 4.3.1 in 38.211 + int ta_offset_samples = (ta_command_pdu->ta_offset * samples_per_subframe) / (4096 * 480); + ue->N_TA_offset = ta_offset_samples; + LOG_D(PHY, "Received N_TA offset %d from upper layers. Corresponds to %d samples.\n", + ta_command_pdu->ta_offset, ta_offset_samples); + } } static void nr_ue_scheduled_response_dl(NR_UE_MAC_INST_t *mac, diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 0958172537..a2f75f59e8 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1587,6 +1587,24 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, } } +static int get_ta_offset(long *n_TimingAdvanceOffset) +{ + if (!n_TimingAdvanceOffset) + return -1; + + switch (*n_TimingAdvanceOffset) { + case NR_ServingCellConfigCommonSIB__n_TimingAdvanceOffset_n0 : + return 0; + case NR_ServingCellConfigCommonSIB__n_TimingAdvanceOffset_n25600 : + return 25600; + case NR_ServingCellConfigCommonSIB__n_TimingAdvanceOffset_n39936 : + return 39936; + default : + AssertFatal(false, "Invalid n-TimingAdvanceOffset\n"); + } + return -1; +} + void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SI_SchedulingInfo_t *si_SchedulingInfo, @@ -1599,6 +1617,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, UPDATE_IE(mac->tdd_UL_DL_ConfigurationCommon, scc->tdd_UL_DL_ConfigurationCommon, NR_TDD_UL_DL_ConfigCommon_t); UPDATE_IE(mac->si_SchedulingInfo, si_SchedulingInfo, NR_SI_SchedulingInfo_t); UPDATE_IE(mac->si_SchedulingInfo_v1700, si_SchedulingInfo_v1700, NR_SI_SchedulingInfo_v1700_t); + mac->n_ta_offset = get_ta_offset(scc->n_TimingAdvanceOffset); config_common_ue_sa(mac, scc, cc_idP); configure_common_BWP_dl(mac, @@ -1652,6 +1671,7 @@ static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac, if (reconfigurationWithSync->spCellConfigCommon) { NR_ServingCellConfigCommon_t *scc = reconfigurationWithSync->spCellConfigCommon; + mac->n_ta_offset = get_ta_offset(scc->n_TimingAdvanceOffset); if (scc->physCellId) mac->physCellId = *scc->physCellId; mac->dmrs_TypeA_Position = scc->dmrs_TypeA_Position; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index fb727aeb5e..5777f1e437 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -576,6 +576,7 @@ typedef struct NR_UE_MAC_INST_s { int dmrs_TypeA_Position; int p_Max; int p_Max_alt; + int n_ta_offset; // -1 not present, otherwise value to be applied long pdsch_HARQ_ACK_Codebook; diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index e60c163236..506fc222a6 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -69,6 +69,7 @@ void nr_ue_init_mac(NR_UE_MAC_INST_t *mac) mac->uecap_maxMIMO_PUSCH_layers_nocb = 0; mac->p_Max = INT_MIN; mac->p_Max_alt = INT_MIN; + mac->n_ta_offset = -1; reset_mac_inst(mac); // need to inizialize because might not been setup (optional timer) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index e9a2fb58de..baf728e192 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -61,7 +61,7 @@ } static void nr_ue_prach_scheduler(NR_UE_MAC_INST_t *mac, frame_t frameP, sub_frame_t slotP); -static void schedule_ta_command(fapi_nr_dl_config_request_t *dl_config, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment); +static void schedule_ta_command(fapi_nr_dl_config_request_t *dl_config, NR_UE_MAC_INST_t *mac); static void nr_ue_fill_phr(NR_UE_MAC_INST_t *mac, NR_SINGLE_ENTRY_PHR_MAC_CE *phr, float P_CMAX, @@ -1245,7 +1245,7 @@ void nr_ue_dl_scheduler(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info ue_dci_configuration(mac, dl_config, rx_frame, rx_slot); if (mac->ul_time_alignment.ta_apply != no_ta) - schedule_ta_command(dl_config, &mac->ul_time_alignment); + schedule_ta_command(dl_config, mac); nr_scheduled_response_t scheduled_response = {.dl_config = dl_config, .module_id = mac->ue_id, @@ -3534,11 +3534,13 @@ uint8_t nr_ue_get_sdu(NR_UE_MAC_INST_t *mac, return num_sdus > 0 ? 1 : 0; } -static void schedule_ta_command(fapi_nr_dl_config_request_t *dl_config, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment) +static void schedule_ta_command(fapi_nr_dl_config_request_t *dl_config, NR_UE_MAC_INST_t *mac) { + NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &mac->ul_time_alignment; fapi_nr_ta_command_pdu *ta = &dl_config->dl_config_list[dl_config->number_pdus].ta_command_pdu; ta->ta_frame = ul_time_alignment->frame; ta->ta_slot = ul_time_alignment->slot; + ta->ta_offset = mac->n_ta_offset; ta->is_rar = ul_time_alignment->ta_apply == rar_ta; ta->ta_command = ul_time_alignment->ta_command; dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_CONFIG_TA_COMMAND; From 15279d8732ec708dd7895641ab3c788223d8552c Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 22 Apr 2024 13:52:39 +0200 Subject: [PATCH 17/87] common function for default N_TA_offset (not sure what in develop is correct) --- common/utils/nr/nr_common.c | 14 +++++++++++ common/utils/nr/nr_common.h | 2 +- executables/nr-ru.c | 41 +++---------------------------- openair1/PHY/INIT/nr_init_ue.c | 45 ++++++---------------------------- openair1/PHY/INIT/nr_parms.c | 4 +-- 5 files changed, 29 insertions(+), 77 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index f851c26eee..fafc1bcd47 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -1149,6 +1149,20 @@ void init_delay_table(uint16_t ofdm_symbol_size, } } +int set_default_nta_offset(frequency_range_t freq_range, uint32_t samples_per_subframe) +{ + // ta_offset_samples : ta_offset = samples_per_subframe : (Δf_max x N_f / 1000) + // As described in Section 4.3.1 in 38.211 + + // TODO There is no way for the UE to know about LTE-NR coexistence case + // as mentioned in Table 7.1.2-2 of 38.133 + // LTE-NR coexistence means the presence of an active LTE service in the same band as NR in current deployment + // We assume no coexistence + + uint64_t numer = (freq_range == FR1 ? 25600 : 13792) * (uint64_t)samples_per_subframe; + return numer / (4096 * 480); +} + void nr_timer_start(NR_timer_t *timer) { timer->active = true; diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 3c04bca581..1e4fecc4f5 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -177,7 +177,7 @@ bool nr_timer_is_active(const NR_timer_t *timer); */ uint32_t nr_timer_elapsed_time(const NR_timer_t *timer); - +int set_default_nta_offset(frequency_range_t freq_range, uint32_t samples_per_subframe); extern const nr_bandentry_t nr_bandtable[]; static inline int get_num_dmrs(uint16_t dmrs_mask ) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 8a29e6ac2f..7f5d193d34 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -959,43 +959,10 @@ int setup_RU_buffers(RU_t *ru) { int mu = config->ssb_config.scs_common.value; int N_RB = config->carrier_config.dl_grid_size[config->ssb_config.scs_common.value].value; - if (config->cell_config.frame_duplex_type.value == TDD) { - int N_TA_offset = config->carrier_config.uplink_frequency.value < 6000000 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 - double factor=1; - - switch (mu) { - case 0: //15 kHz scs - AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n"); - factor = fp->samples_per_subframe / 30720.0; - break; - - case 1: //30 kHz sc - AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n"); - factor = fp->samples_per_subframe / 30720.0; - break; - - case 2: //60 kHz scs - AssertFatal(1==0, "scs_common should not be 60 kHz\n"); - break; - - case 3: //120 kHz scs - AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n"); - factor = fp->samples_per_subframe / 61440.0; - break; - - case 4: //240 kHz scs - AssertFatal(N_TA_offset == 431, "scs_common 240kHz only for FR2\n"); - factor = fp->samples_per_subframe / 61440.0; - break; - - default: - AssertFatal(1==0, "Invalid scs_common!\n"); - } - - ru->N_TA_offset = (int)(N_TA_offset * factor); - LOG_I(PHY,"RU %d Setting N_TA_offset to %d samples (factor %f, UL Freq %d, N_RB %d, mu %d)\n",ru->idx,ru->N_TA_offset,factor, - config->carrier_config.uplink_frequency.value, N_RB, mu); - } else ru->N_TA_offset = 0; + ru->N_TA_offset = set_default_nta_offset(fp->freq_range, fp->samples_per_subframe); + LOG_I(PHY, + "RU %d Setting N_TA_offset to %d samples (UL Freq %d, N_RB %d, mu %d)\n", + ru->idx, ru->N_TA_offset, config->carrier_config.uplink_frequency.value, N_RB, mu); if (ru->openair0_cfg.mmapped_dma == 1) { // replace RX signal buffers with mmaped HW versions diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 9f040537d0..577f7a44d8 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -504,45 +504,16 @@ void init_N_TA_offset(PHY_VARS_NR_UE *ue) NR_DL_FRAME_PARMS *fp = &ue->frame_parms; // No timing offset for Sidelink, refer to 3GPP 38.211 Section 8.5 - if (fp->frame_type == FDD || ue->sl_mode == 2) { + if (ue->sl_mode == 2) ue->N_TA_offset = 0; - } else { - // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 - int N_TA_offset = fp->ul_CarrierFreq < 6e9 ? 400 : 431; + else + ue->N_TA_offset = set_default_nta_offset(fp->freq_range, fp->samples_per_subframe); + ue->ta_frame = -1; + ue->ta_slot = -1; - double factor = 1.0; - switch (fp->numerology_index) { - case 0: //15 kHz scs - AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n"); - factor = fp->samples_per_subframe / 30720.0; - break; - case 1: //30 kHz sc - AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n"); - factor = fp->samples_per_subframe / 30720.0; - break; - case 2: //60 kHz scs - AssertFatal(1==0, "scs_common should not be 60 kHz\n"); - break; - case 3: //120 kHz scs - AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n"); - factor = fp->samples_per_subframe / 61440.0; - break; - case 4: //240 kHz scs - AssertFatal(N_TA_offset == 431, "scs_common 240kHz only for FR2\n"); - factor = fp->samples_per_subframe / 61440.0; - break; - default: - AssertFatal(1==0, "Invalid scs_common!\n"); - } - - ue->N_TA_offset = (int)(N_TA_offset * factor); - ue->ta_frame = -1; - ue->ta_slot = -1; - - LOG_I(PHY, - "UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d, mu %d)\n", - ue->Mod_id, ue->N_TA_offset, factor, fp->ul_CarrierFreq, fp->N_RB_DL, fp->numerology_index); - } + LOG_I(PHY, + "UE %d Setting N_TA_offset to %d samples (UL Freq %lu, N_RB %d, mu %d)\n", + ue->Mod_id, ue->N_TA_offset, fp->ul_CarrierFreq, fp->N_RB_DL, fp->numerology_index); } void phy_init_nr_top(PHY_VARS_NR_UE *ue) { diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 6a2c300b72..939478f35c 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -316,7 +316,7 @@ void nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, NR_DL_FRAME_PARMS * fp->get_samples_slot_timestamp = &get_samples_slot_timestamp; fp->get_slot_from_timestamp = &get_slot_from_timestamp; fp->samples_per_frame = 10 * fp->samples_per_subframe; - fp->freq_range = (fp->dl_CarrierFreq < 6e9)? FR1 : FR2; + fp->freq_range = (fp->dl_CarrierFreq < 6e9) ? FR1 : FR2; fp->Ncp = Ncp; @@ -400,7 +400,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, fp->get_samples_per_slot = &get_samples_per_slot; fp->get_samples_slot_timestamp = &get_samples_slot_timestamp; fp->samples_per_frame = 10 * fp->samples_per_subframe; - fp->freq_range = (fp->dl_CarrierFreq < 6e9)? FR1 : FR2; + fp->freq_range = (fp->dl_CarrierFreq < 6e9) ? FR1 : FR2; uint8_t sco = 0; if (((fp->freq_range == FR1) && (config->ssb_table.ssb_subcarrier_offset < 24)) || From ee4f95fd5113d2e4b6889fe4419ef691b5a1879d Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 24 Apr 2024 12:49:00 +0200 Subject: [PATCH 18/87] improvements in handling TAG-Id --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 1 + openair2/LAYER2/NR_MAC_UE/mac_defs.h | 5 +++-- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 11 ++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index a2f75f59e8..fcbe873ad2 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -2448,6 +2448,7 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id, handle_reconfiguration_with_sync(mac, cc_idP, spCellConfig->reconfigurationWithSync); } if (scd) { + mac->tag_Id = scd->tag_Id; configure_servingcell_info(mac, scd); configure_BWPs(mac, scd); } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 5777f1e437..1079e24b05 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -424,10 +424,9 @@ typedef enum ta_type { } ta_type_t; typedef struct NR_UL_TIME_ALIGNMENT { - /// TA command and TAGID received from the gNB + /// TA command received from the gNB ta_type_t ta_apply; int ta_command; - uint32_t tag_id; int frame; int slot; } NR_UL_TIME_ALIGNMENT_t; @@ -595,6 +594,8 @@ typedef struct NR_UE_MAC_INST_s { NR_UE_HARQ_STATUS_t dl_harq_info[NR_MAX_HARQ_PROCESSES]; NR_UL_HARQ_INFO_t ul_harq_info[NR_MAX_HARQ_PROCESSES]; + NR_TAG_Id_t tag_Id; + nr_emulated_l1_t nr_ue_emul_l1; pthread_mutex_t mutex_dl_info; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index ccfa861587..d007878203 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3563,14 +3563,16 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i // 38.321 Ch6.1.3.4 mac_len = 1; - /*uint8_t ta_command = ((NR_MAC_CE_TA *)pduP)[1].TA_COMMAND; - uint8_t tag_id = ((NR_MAC_CE_TA *)pduP)[1].TAGID;*/ - const int ta = ((NR_MAC_CE_TA *)pduP)[1].TA_COMMAND; const int tag = ((NR_MAC_CE_TA *)pduP)[1].TAGID; + if (tag != mac->tag_Id) { + LOG_E(NR_MAC, "MAC CE TAG %d does not correspond to the one configured at MAC %ld\n", tag, mac->tag_Id); + done = 1; + break; + } + NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &mac->ul_time_alignment; - ul_time_alignment->tag_id = tag; ul_time_alignment->ta_command = ta; ul_time_alignment->ta_apply = adjustment_ta; @@ -3589,7 +3591,6 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i LOG_D(NR_MAC, "[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d \n", frameP, slot, ta, tag, CC_id); else LOG_I(NR_MAC, "[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d \n", frameP, slot, ta, tag, CC_id); - break; case DL_SCH_LCID_CON_RES_ID: // Clause 5.1.5 and 6.1.3.3 of 3GPP TS 38.321 version 16.2.1 Release 16 From 2a85d9905e478e64c8bce963bc39aba427162518 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 22 Apr 2024 15:02:47 +0200 Subject: [PATCH 19/87] configure TAG list --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 27 +++++++++++++++++++++----- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 2 +- openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 2 ++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index fcbe873ad2..25d226f4b7 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1959,12 +1959,29 @@ static void configure_maccellgroup(NR_UE_MAC_INST_t *mac, const NR_MAC_CellGroup } } if (mcg->tag_Config) { - // TODO TAG not handled - if(mcg->tag_Config->tag_ToAddModList) { + if (mcg->tag_Config->tag_ToReleaseList) { + for (int i = 0; i < mcg->tag_Config->tag_ToReleaseList->list.count; i++) { + for (int j = 0; j < mac->TAG_list.count; j++) { + if (*mcg->tag_Config->tag_ToReleaseList->list.array[i] == mac->TAG_list.array[j]->tag_Id) + asn_sequence_del(&mac->TAG_list, j, 1); + } + } + } + if (mcg->tag_Config->tag_ToAddModList) { for (int i = 0; i < mcg->tag_Config->tag_ToAddModList->list.count; i++) { - if (mcg->tag_Config->tag_ToAddModList->list.array[i]->timeAlignmentTimer != - NR_TimeAlignmentTimer_infinity) - LOG_E(NR_MAC, "TimeAlignmentTimer not handled\n"); + int j; + for (j = 0; j < mac->TAG_list.count; j++) { + if (mac->TAG_list.array[j]->tag_Id == mcg->tag_Config->tag_ToAddModList->list.array[i]->tag_Id) + break; + } + if (j < mac->TAG_list.count) { + UPDATE_IE(mac->TAG_list.array[j], mcg->tag_Config->tag_ToAddModList->list.array[i], NR_TAG_t); + } + else { + NR_TAG_t *local_tag = NULL; + UPDATE_IE(local_tag, mcg->tag_Config->tag_ToAddModList->list.array[i], NR_TAG_t); + ASN_SEQUENCE_ADD(&mac->TAG_list, local_tag); + } } } } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 1079e24b05..00743420a2 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -76,7 +76,6 @@ #define NR_INVALID_LCGID (NR_MAX_NUM_LCGID) #define MAX_NUM_BWP_UE 5 -#define NUM_SLOT_FRAME 10 #define NR_MAX_SR_ID 8 // SchedulingRequestId ::= INTEGER (0..7) /*!\brief value for indicating BSR Timer is not running */ @@ -595,6 +594,7 @@ typedef struct NR_UE_MAC_INST_s { NR_UL_HARQ_INFO_t ul_harq_info[NR_MAX_HARQ_PROCESSES]; NR_TAG_Id_t tag_Id; + A_SEQUENCE_OF(NR_TAG_t) TAG_list; nr_emulated_l1_t nr_ue_emul_l1; diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index 506fc222a6..4de5024b8f 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -321,6 +321,8 @@ void release_mac_configuration(NR_UE_MAC_INST_t *mac, NR_UE_MAC_reset_cause_t ca memset(&mac->ssb_measurements, 0, sizeof(mac->ssb_measurements)); memset(&mac->csirs_measurements, 0, sizeof(mac->csirs_measurements)); memset(&mac->ul_time_alignment, 0, sizeof(mac->ul_time_alignment)); + for (int i = mac->TAG_list.count; i > 0 ; i--) + asn_sequence_del(&mac->TAG_list, i - 1, 1); } void free_rach_structures(NR_UE_MAC_INST_t *nr_mac, int bwp_id) From 25b94f12b3dfc5f08b68cb9b08bbada80220025f Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 2 May 2024 11:47:42 +0200 Subject: [PATCH 20/87] configuration of timeAlignmentTimerCommon at MAC UE --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 4 +++- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 25d226f4b7..4652cb0d18 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1623,10 +1623,12 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, configure_common_BWP_dl(mac, 0, // bwp-id &scc->downlinkConfigCommon.initialDownlinkBWP); - if (scc->uplinkConfigCommon) + if (scc->uplinkConfigCommon) { + mac->timeAlignmentTimerCommon = scc->uplinkConfigCommon->timeAlignmentTimerCommon; configure_common_BWP_ul(mac, 0, // bwp-id &scc->uplinkConfigCommon->initialUplinkBWP); + } // set current BWP only if coming from non-connected state // otherwise it is just a periodically update of the SIB1 content if (mac->state < UE_CONNECTED) { diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 00743420a2..2eb6415980 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -595,6 +595,7 @@ typedef struct NR_UE_MAC_INST_s { NR_TAG_Id_t tag_Id; A_SEQUENCE_OF(NR_TAG_t) TAG_list; + NR_TimeAlignmentTimer_t timeAlignmentTimerCommon; nr_emulated_l1_t nr_ue_emul_l1; From e4a6d60dc2a4501fdc4b175d4d94690bad948a38 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 2 May 2024 18:47:05 +0200 Subject: [PATCH 21/87] implementation of time alignment timer at MAC UE --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 45 +++++++ openair2/LAYER2/NR_MAC_UE/mac_defs.h | 1 + openair2/LAYER2/NR_MAC_UE/mac_proto.h | 2 +- openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 3 +- openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 9 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 116 ++++++++++--------- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 27 +++++ 7 files changed, 142 insertions(+), 61 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 4652cb0d18..6f5cdef338 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1545,6 +1545,42 @@ static void configure_common_BWP_ul(NR_UE_MAC_INST_t *mac, int bwp_id, NR_BWP_Up } } +static void configure_timeAlignmentTimer(NR_timer_t *time_alignment_timer, NR_TimeAlignmentTimer_t timer_config, int scs) +{ + uint32_t timer_ms = 0; + switch (timer_config) { + case NR_TimeAlignmentTimer_ms500 : + timer_ms = 500; + break; + case NR_TimeAlignmentTimer_ms750 : + timer_ms = 750; + break; + case NR_TimeAlignmentTimer_ms1280 : + timer_ms = 1280; + break; + case NR_TimeAlignmentTimer_ms1920 : + timer_ms = 1920; + break; + case NR_TimeAlignmentTimer_ms2560 : + timer_ms = 2560; + break; + case NR_TimeAlignmentTimer_ms5120 : + timer_ms = 5120; + break; + case NR_TimeAlignmentTimer_ms10240 : + timer_ms = 10240; + break; + case NR_TimeAlignmentTimer_infinity : + timer_ms = UINT_MAX; + break; + default : + AssertFatal(false, "Invalid timeAlignmentTimer\n"); + } + // length of slot is (1/2^scs)ms + uint32_t n_slots = timer_ms != UINT_MAX ? (timer_ms << scs) : UINT_MAX; + nr_timer_setup(time_alignment_timer, n_slots, 1); // 1 slot update rate +} + void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t cause) { @@ -1577,6 +1613,8 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, nr_ue_mac_default_configs(mac); nr_ue_reset_sync_state(mac); release_mac_configuration(mac, cause); + // apply the timeAlignmentTimerCommon included in SIB1 + configure_timeAlignmentTimer(&mac->time_alignment_timer, mac->timeAlignmentTimerCommon, mac->current_UL_BWP->scs); // new sync with old cell ID (re-establishment on the same cell) sync_req.target_Nid_cell = mac->physCellId; sync_req.ssb_bw_scan = false; @@ -1636,6 +1674,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, AssertFatal(mac->current_DL_BWP, "Couldn't find DL-BWP0\n"); mac->current_UL_BWP = get_ul_bwp_structure(mac, 0, false); AssertFatal(mac->current_UL_BWP, "Couldn't find DL-BWP0\n"); + configure_timeAlignmentTimer(&mac->time_alignment_timer, mac->timeAlignmentTimerCommon, mac->current_UL_BWP->scs); } // Setup the SSB to Rach Occasions mapping according to the config @@ -2476,6 +2515,12 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id, if (cell_group_config->mac_CellGroupConfig) configure_maccellgroup(mac, cell_group_config->mac_CellGroupConfig); + for (int j = 0; j < mac->TAG_list.count; j++) { + // apply the Timing Advance Command for the indicated TAG + if (mac->TAG_list.array[j]->tag_Id == mac->tag_Id) + configure_timeAlignmentTimer(&mac->time_alignment_timer, mac->TAG_list.array[j]->timeAlignmentTimer, mac->current_UL_BWP->scs); + } + configure_logicalChannelBearer(mac, cell_group_config->rlc_BearerToAddModList, cell_group_config->rlc_BearerToReleaseList); diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 2eb6415980..d9c5fa2345 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -596,6 +596,7 @@ typedef struct NR_UE_MAC_INST_s { NR_TAG_Id_t tag_Id; A_SEQUENCE_OF(NR_TAG_t) TAG_list; NR_TimeAlignmentTimer_t timeAlignmentTimerCommon; + NR_timer_t time_alignment_timer; nr_emulated_l1_t nr_ue_emul_l1; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index bb42701ec3..dcd6a62f5d 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -350,7 +350,7 @@ void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac); void nr_Msg1_transmitted(NR_UE_MAC_INST_t *mac); void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac, uint8_t CC_id, frame_t frameP, slot_t slotP, uint8_t gNB_id); void nr_get_msg3_payload(NR_UE_MAC_INST_t *mac, uint8_t *buf, int TBS_max); - +void handle_time_alignment_timer_expired(NR_UE_MAC_INST_t *mac); int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, NR_PDSCH_Config_t *pdsch_Config, diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index 4de5024b8f..a60d8d2c43 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -202,6 +202,7 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac) } if (nr_mac->data_inactivity_timer) nr_timer_stop(nr_mac->data_inactivity_timer); + nr_timer_stop(&nr_mac->time_alignment_timer); nr_timer_stop(&nr_mac->ra.contention_resolution_timer); nr_timer_stop(&nr_mac->scheduling_info.sr_DelayTimer); nr_timer_stop(&nr_mac->scheduling_info.retxBSR_Timer); @@ -209,7 +210,7 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac) nr_timer_stop(&nr_mac->scheduling_info.sr_info[i].prohibitTimer); // consider all timeAlignmentTimers as expired and perform the corresponding actions in clause 5.2 - // TODO + handle_time_alignment_timer_expired(nr_mac); // set the NDIs for all uplink HARQ processes to the value 0 for (int k = 0; k < NR_MAX_HARQ_PROCESSES; k++) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index c52a67c5a2..66fbf20630 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -912,9 +912,14 @@ void nr_ra_failed(NR_UE_MAC_INST_t *mac, uint8_t CC_id, NR_PRACH_RESOURCES_t *pr prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER++; - if (prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER == ra->preambleTransMax + 1){ + // when the Contention Resolution is considered not successful + // stop timeAlignmentTimer + nr_timer_stop(&mac->time_alignment_timer); - LOG_D(MAC, "[UE %d][%d.%d] Maximum number of RACH attempts (%d) reached, selecting backoff time...\n", + if (prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER == ra->preambleTransMax + 1) { + + LOG_D(NR_MAC, + "[UE %d][%d.%d] Maximum number of RACH attempts (%d) reached, selecting backoff time...\n", mac->ue_id, frame, slot, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index d007878203..f9d23177eb 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2953,8 +2953,11 @@ void nr_ue_send_sdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info, in { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN); - LOG_D(MAC, "In [%d.%d] Handling DLSCH PDU type %d\n", - dl_info->frame, dl_info->slot, dl_info->rx_ind->rx_indication_body[pdu_id].pdu_type); + LOG_D(NR_MAC, + "In [%d.%d] Handling DLSCH PDU type %d\n", + dl_info->frame, + dl_info->slot, + dl_info->rx_ind->rx_indication_body[pdu_id].pdu_type); // Processing MAC PDU // it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs @@ -2969,10 +2972,9 @@ void nr_ue_send_sdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info, in case FAPI_NR_RX_PDU_TYPE_RAR : nr_ue_process_rar(mac, dl_info, pdu_id); break; - default: - AssertFatal(false, "Invalid PDU type\n"); + default : + AssertFatal(false, "Invalid DLSCH PDU type\n"); } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT); } @@ -3412,6 +3414,21 @@ static nr_dci_format_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, return format; } +static void set_time_alignment(NR_UE_MAC_INST_t *mac, int ta, ta_type_t type, int frame, int slot) +{ + NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &mac->ul_time_alignment; + ul_time_alignment->ta_command = ta; + ul_time_alignment->ta_apply = type; + + const int ntn_ue_koffset = get_NTN_UE_Koffset(mac->sc_info.ntn_Config_r17, mac->current_UL_BWP->scs); + const int n_slots_frame = nr_slots_per_frame[mac->current_UL_BWP->scs]; + ul_time_alignment->frame = (frame + (slot + ntn_ue_koffset) / n_slots_frame) % MAX_FRAME_NUMBER; + ul_time_alignment->slot = (slot + ntn_ue_koffset) % n_slots_frame; + + // start or restart the timeAlignmentTimer associated with the indicated TAG + nr_timer_start(&mac->time_alignment_timer); +} + /////////////////////////////////// // brief: nr_ue_process_mac_pdu // function: parsing DL PDU header @@ -3572,20 +3589,7 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i break; } - NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &mac->ul_time_alignment; - ul_time_alignment->ta_command = ta; - ul_time_alignment->ta_apply = adjustment_ta; - - const int ntn_ue_koffset = get_NTN_UE_Koffset(mac->sc_info.ntn_Config_r17, mac->current_UL_BWP->scs); - const int n_slots_frame = nr_slots_per_frame[mac->current_UL_BWP->scs]; - ul_time_alignment->frame = (frameP + (slot + ntn_ue_koffset) / n_slots_frame) % MAX_FRAME_NUMBER; - ul_time_alignment->slot = (slot + ntn_ue_koffset) % n_slots_frame; - - /* - #ifdef DEBUG_HEADER_PARSING - LOG_D(MAC, "[UE] CE %d : UE Timing Advance : %d\n", i, pduP[1]); - #endif - */ + set_time_alignment(mac, ta, adjustment_ta, frameP, slot); if (ta == 31) LOG_D(NR_MAC, "[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d \n", frameP, slot, ta, tag, CC_id); @@ -3934,13 +3938,15 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d } } - #ifdef DEBUG_RAR - LOG_D(MAC, "[DEBUG_RAR] (%d,%d) number of RAR subheader %d; number of RAR pyloads %d\n", +#ifdef DEBUG_RAR + LOG_D(NR_MAC, + "[DEBUG_RAR] (%d,%d) number of RAR subheader %d; number of RAR pyloads %d\n", frame, slot, n_subheaders, n_subPDUs); - LOG_D(MAC, "[DEBUG_RAR] Received RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for preamble %d/%d\n", + LOG_D(NR_MAC, + "[DEBUG_RAR] Received RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for preamble %d/%d\n", *(uint8_t *) rarh, rar[0], rar[1], @@ -3950,30 +3956,18 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d rar[5], rarh->RAPID, preamble_index); - #endif +#endif if (ra->RA_RAPID_found) { RAR_grant_t rar_grant; - unsigned char tpc_command; -#ifdef DEBUG_RAR - unsigned char csi_req; -#endif - - // TA command - NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &mac->ul_time_alignment; - const int ta = rar->TA2 + (rar->TA1 << 5); - ul_time_alignment->ta_command = ta; - ul_time_alignment->ta_apply = rar_ta; - - LOG_W(MAC, "received TA command %d\n", 31 + ta); #ifdef DEBUG_RAR // CSI - csi_req = (unsigned char) (rar->UL_GRANT_4 & 0x01); + unsigned char csi_req = (unsigned char) (rar->UL_GRANT_4 & 0x01); #endif // TPC - tpc_command = (unsigned char) ((rar->UL_GRANT_4 >> 1) & 0x07); + unsigned char tpc_command = (unsigned char) ((rar->UL_GRANT_4 >> 1) & 0x07); switch (tpc_command){ case 0: ra->Msg3_TPC = -6; @@ -4011,6 +4005,31 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d // frequency hopping rar_grant.freq_hopping = (unsigned char) (rar->UL_GRANT_1 >> 2); + // Schedule Msg3 + const NR_UE_UL_BWP_t *current_UL_BWP = mac->current_UL_BWP; + const NR_UE_DL_BWP_t *current_DL_BWP = mac->current_DL_BWP; + const NR_BWP_PDCCH_t *pdcch_config = &mac->config_BWP_PDCCH[current_DL_BWP->bwp_id]; + NR_tda_info_t tda_info = get_ul_tda_info(current_UL_BWP, + *pdcch_config->ra_SS->controlResourceSetId, + pdcch_config->ra_SS->searchSpaceType->present, + TYPE_RA_RNTI_, + rar_grant.Msg3_t_alloc); + if (!tda_info.valid_tda || tda_info.nrOfSymbols == 0) { + LOG_E(MAC, "Cannot schedule Msg3. Something wrong in TDA information\n"); + return; + } + const int ntn_ue_koffset = get_NTN_UE_Koffset(mac->sc_info.ntn_Config_r17, mac->current_UL_BWP->scs); + ret = nr_ue_pusch_scheduler(mac, is_Msg3, frame, slot, &frame_tx, &slot_tx, tda_info.k2 + ntn_ue_koffset); + + // TA command + // if the timeAlignmentTimer associated with this TAG is not running + if (!nr_timer_is_active(&mac->time_alignment_timer)) { + const int ta = rar->TA2 + (rar->TA1 << 5); + set_time_alignment(mac, ta, rar_ta, frame_tx, slot_tx); + LOG_W(MAC, "received TA command %d\n", 31 + ta); + } + // else ignore the received Timing Advance Command + #ifdef DEBUG_RAR LOG_I(NR_MAC, "rarh->E = 0x%x\n", rarh->E); LOG_I(NR_MAC, "rarh->T = 0x%x\n", rarh->T); @@ -4041,26 +4060,6 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d tpc_command); #endif - // Schedule Msg3 - const NR_UE_UL_BWP_t *current_UL_BWP = mac->current_UL_BWP; - const NR_UE_DL_BWP_t *current_DL_BWP = mac->current_DL_BWP; - const NR_BWP_PDCCH_t *pdcch_config = &mac->config_BWP_PDCCH[current_DL_BWP->bwp_id]; - NR_tda_info_t tda_info = get_ul_tda_info(current_UL_BWP, - *pdcch_config->ra_SS->controlResourceSetId, - pdcch_config->ra_SS->searchSpaceType->present, - TYPE_RA_RNTI_, - rar_grant.Msg3_t_alloc); - if (!tda_info.valid_tda || tda_info.nrOfSymbols == 0) { - LOG_E(MAC, "Cannot schedule Msg3. Something wrong in TDA information\n"); - return; - } - const int ntn_ue_koffset = get_NTN_UE_Koffset(mac->sc_info.ntn_Config_r17, mac->current_UL_BWP->scs); - ret = nr_ue_pusch_scheduler(mac, is_Msg3, frame, slot, &frame_tx, &slot_tx, tda_info.k2 + ntn_ue_koffset); - - const int n_slots_frame = nr_slots_per_frame[current_UL_BWP->scs]; - ul_time_alignment->frame = (frame_tx + (slot_tx + ntn_ue_koffset) / n_slots_frame) % MAX_FRAME_NUMBER; - ul_time_alignment->slot = (slot_tx + ntn_ue_koffset) % n_slots_frame; - if (ret != -1) { uint16_t rnti = mac->crnti; // Upon successful reception, set the T-CRNTI to the RAR value if the RA preamble is selected among the contention-based RA Preambles @@ -4090,6 +4089,9 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d } else { ra->t_crnti = 0; + // TODO if the Random Access Preamble was not selected by the MAC entity + // among the contention-based Random Access Preamble + // apply the Timing Advance Command and start or restart the timeAlignmentTimer } return; } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index baf728e192..d742f7cc9a 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -152,6 +152,30 @@ static void trigger_regular_bsr(NR_UE_MAC_INST_t *mac, NR_LogicalChannelIdentity nr_timer_stop(&mac->scheduling_info.sr_DelayTimer); } +void handle_time_alignment_timer_expired(NR_UE_MAC_INST_t *mac) +{ + // flush all HARQ buffers for all Serving Cells + for (int k = 0; k < NR_MAX_HARQ_PROCESSES; k++) { + memset(&mac->dl_harq_info[k], 0, sizeof(NR_UE_HARQ_STATUS_t)); + memset(&mac->ul_harq_info[k], 0, sizeof(NR_UL_HARQ_INFO_t)); + mac->dl_harq_info[k].last_ndi = -1; // initialize to invalid value + mac->ul_harq_info[k].last_ndi = -1; // initialize to invalid value + } + // release PUCCH for all Serving Cells; + // release SRS for all Serving Cells; + release_PUCCH_SRS(mac); + // clear any configured downlink assignments and uplink grants; + int scs = mac->current_UL_BWP ? mac->current_UL_BWP->scs : get_softmodem_params()->numerology; + if (mac->dl_config_request) + memset(mac->dl_config_request, 0, sizeof(*mac->dl_config_request)); + if (mac->ul_config_request) + clear_ul_config_request(mac, scs); + // clear any PUSCH resources for semi-persistent CSI reporting + // TODO we don't have semi-persistent CSI reporting + // maintain N_TA + // TODO not sure what to do here +} + void update_mac_timers(NR_UE_MAC_INST_t *mac) { if (mac->data_inactivity_timer) { @@ -159,6 +183,9 @@ void update_mac_timers(NR_UE_MAC_INST_t *mac) if (inactivity_timer_expired) nr_mac_rrc_inactivity_timer_ind(mac->ue_id); } + bool alignment_timer_expired = nr_timer_tick(&mac->time_alignment_timer); + if (alignment_timer_expired) + handle_time_alignment_timer_expired(mac); nr_timer_tick(&mac->ra.contention_resolution_timer); for (int j = 0; j < NR_MAX_SR_ID; j++) nr_timer_tick(&mac->scheduling_info.sr_info[j].prohibitTimer); From 3166f203837b1f2a6317b7d00ac2466c554216c4 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 2 May 2024 19:29:35 +0200 Subject: [PATCH 22/87] trigger RA DL or UL data arrival during RRC_CONNECTED when UL synchronisation status is non-synchronised --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 3 +++ openair2/LAYER2/NR_MAC_UE/mac_proto.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 13 +---------- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 5 +++++ openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 23 ++++++++++++++++++++ 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 6f5cdef338..fab0fb7a7c 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1578,7 +1578,10 @@ static void configure_timeAlignmentTimer(NR_timer_t *time_alignment_timer, NR_Ti } // length of slot is (1/2^scs)ms uint32_t n_slots = timer_ms != UINT_MAX ? (timer_ms << scs) : UINT_MAX; + bool timer_was_active = nr_timer_is_active(time_alignment_timer); nr_timer_setup(time_alignment_timer, n_slots, 1); // 1 slot update rate + if (timer_was_active) + nr_timer_start(time_alignment_timer); } void nr_rrc_mac_config_req_reset(module_id_t module_id, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index dcd6a62f5d..e2d6125145 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -349,6 +349,7 @@ void free_rach_structures(NR_UE_MAC_INST_t *nr_mac, int bwp_id); void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac); void nr_Msg1_transmitted(NR_UE_MAC_INST_t *mac); void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac, uint8_t CC_id, frame_t frameP, slot_t slotP, uint8_t gNB_id); +void trigger_MAC_UE_RA(NR_UE_MAC_INST_t *mac); void nr_get_msg3_payload(NR_UE_MAC_INST_t *mac, uint8_t *buf, int TBS_max); void handle_time_alignment_timer_expired(NR_UE_MAC_INST_t *mac); int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 66fbf20630..6272c4c33f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -936,23 +936,12 @@ void nr_ra_failed(NR_UE_MAC_INST_t *mac, uint8_t CC_id, NR_PRACH_RESOURCES_t *pr } } -void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac) +void trigger_MAC_UE_RA(NR_UE_MAC_INST_t *mac) { LOG_W(NR_MAC, "Triggering new RA procedure for UE with RNTI %x\n", mac->crnti); mac->state = UE_SYNC; reset_ra(mac, false); mac->ra.msg3_C_RNTI = true; - // release PUCCH for all Serving Cells; - // release SRS for all Serving Cells; - release_PUCCH_SRS(mac); - // clear any configured downlink assignments and uplink grants; - int scs = mac->current_UL_BWP->scs; - if (mac->dl_config_request) - memset(mac->dl_config_request, 0, sizeof(*mac->dl_config_request)); - if (mac->ul_config_request) - clear_ul_config_request(mac, scs); - // clear any PUSCH resources for semi-persistent CSI reporting - // TODO we don't have semi-persistent CSI reporting } void prepare_msg4_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index f9d23177eb..32d0dc72cf 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2967,6 +2967,11 @@ void nr_ue_send_sdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info, in // DCCH logical channel, or CCCH logical channel if (mac->data_inactivity_timer) nr_timer_start(mac->data_inactivity_timer); + // DL data arrival during RRC_CONNECTED when UL synchronisation status is "non-synchronised" + if (!nr_timer_is_active(&mac->time_alignment_timer) && mac->state == UE_CONNECTED && !get_softmodem_params()->phy_test) { + trigger_MAC_UE_RA(mac); + break; + } nr_ue_process_mac_pdu(mac, dl_info, pdu_id); break; case FAPI_NR_RX_PDU_TYPE_RAR : diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index d742f7cc9a..84a35dcf52 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1298,6 +1298,24 @@ static bool check_pucchres_for_pending_SR(NR_PUCCH_Config_t *pucch_Config, int t return false; } +void schedule_RA_after_SR_failure(NR_UE_MAC_INST_t *mac) +{ + if (get_softmodem_params()->phy_test) + return; // cannot trigger RA in phytest mode + trigger_MAC_UE_RA(mac); + // release PUCCH for all Serving Cells; + // release SRS for all Serving Cells; + release_PUCCH_SRS(mac); + // clear any configured downlink assignments and uplink grants; + int scs = mac->current_UL_BWP->scs; + if (mac->dl_config_request) + memset(mac->dl_config_request, 0, sizeof(*mac->dl_config_request)); + if (mac->ul_config_request) + clear_ul_config_request(mac, scs); + // clear any PUSCH resources for semi-persistent CSI reporting + // TODO we don't have semi-persistent CSI reporting +} + static void nr_update_sr(NR_UE_MAC_INST_t *mac) { NR_UE_SCHEDULING_INFO *sched_info = &mac->scheduling_info; @@ -1486,6 +1504,11 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info) } else { if (ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator && (mac->state == UE_CONNECTED || (ra->ra_state == nrRA_WAIT_RAR && ra->cfra))) { + if (!nr_timer_is_active(&mac->time_alignment_timer) && mac->state == UE_CONNECTED && !get_softmodem_params()->phy_test) { + // UL data arrival during RRC_CONNECTED when UL synchronisation status is "non-synchronised" + trigger_MAC_UE_RA(mac); + return; + } // Getting IP traffic to be transmitted int tx_power = ulcfg_pdu->pusch_config_pdu.tx_power; int P_CMAX = nr_get_Pcmax(mac->p_Max, From e1218f9b3fa939e922c783ff79820b903bd5c38c Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 23 Sep 2024 18:24:45 +0200 Subject: [PATCH 23/87] use n_TimingAdvanceOffset according to what set in the RU for FDD CI test with COTS UE --- ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf b/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf index ab5cd5ac69..fb227fbaab 100644 --- a/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf +++ b/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf @@ -118,7 +118,8 @@ gNBs = pucchGroupHopping = 0; hoppingId = 40; p0_nominal = -70; - n_TimingAdvanceOffset = 0; + # TimingAdvanceOffset_n25600 + n_TimingAdvanceOffset = 1; ssb_PositionsInBurst_Bitmap = 1; From af1158140e8e7cec9337c419fb5d6a3491f06c81 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 24 Sep 2024 15:46:05 +0200 Subject: [PATCH 24/87] fix(docker): making tini download platform specific to support ARM64 native builds Signed-off-by: Raphael Defosseux --- docker/Dockerfile.base.rhel9 | 3 ++- docker/Dockerfile.base.rocky | 4 ++-- docker/Dockerfile.base.ubuntu22 | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile.base.rhel9 b/docker/Dockerfile.base.rhel9 index dee50127ac..784ac534c3 100644 --- a/docker/Dockerfile.base.rhel9 +++ b/docker/Dockerfile.base.rhel9 @@ -29,6 +29,7 @@ FROM registry.access.redhat.com/ubi9/ubi:latest AS ran-base LABEL MAINTAINER OpenAirInterface ARG NEEDED_GIT_PROXY +ARG TARGETARCH ENV TZ=Europe/Paris ENV BUILD_UHD_FROM_SOURCE=True ENV UHD_VERSION=4.4.0.0 @@ -68,7 +69,7 @@ RUN rm -f /etc/rhsm-host && \ # Add "Tini - A tiny but valid init for containers", https://github.com/krallin/tini # it will be copied into target containers, to print exit numbers and handle signals properly ENV TINI_VERSION=v0.19.0 -ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini RUN chmod +x /tini # In some network environments, GIT proxy is required diff --git a/docker/Dockerfile.base.rocky b/docker/Dockerfile.base.rocky index 44be527344..2d83389418 100644 --- a/docker/Dockerfile.base.rocky +++ b/docker/Dockerfile.base.rocky @@ -27,7 +27,7 @@ ARG BASE_IMAGE=docker.io/rockylinux:9 FROM $BASE_IMAGE AS ran-base - +ARG TARGETARCH ENV TZ=Europe/Paris ENV BUILD_UHD_FROM_SOURCE=True ENV UHD_VERSION=4.4.0.0 @@ -63,7 +63,7 @@ RUN dnf install 'dnf-command(config-manager)' -y && \ # Add "Tini - A tiny but valid init for containers", https://github.com/krallin/tini # it will be copied into target containers, to print exit numbers and handle signals properly ENV TINI_VERSION=v0.19.0 -ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini RUN chmod +x /tini # Copying only the needed files to create ran-base diff --git a/docker/Dockerfile.base.ubuntu22 b/docker/Dockerfile.base.ubuntu22 index f23cf01ac0..ad237a3ac2 100644 --- a/docker/Dockerfile.base.ubuntu22 +++ b/docker/Dockerfile.base.ubuntu22 @@ -28,6 +28,7 @@ FROM ubuntu:jammy AS ran-base ARG NEEDED_GIT_PROXY +ARG TARGETARCH ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris ENV BUILD_UHD_FROM_SOURCE=True @@ -58,7 +59,7 @@ RUN apt-get update && \ # Add "Tini - A tiny but valid init for containers", https://github.com/krallin/tini # it will be copied into target containers, to print exit numbers and handle signals properly ENV TINI_VERSION=v0.19.0 -ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini RUN chmod +x /tini # In some network environments, GIT proxy is required From 114ea60c4284d891f464bf4de3132db4c4791369 Mon Sep 17 00:00:00 2001 From: Raghavendra Dinavahi Date: Wed, 18 Sep 2024 18:04:56 +0200 Subject: [PATCH 25/87] removed nr_slot_fep_init_sync and used nr_slot_fep in UE --- openair1/PHY/MODULATION/modulation_UE.h | 18 +-- openair1/PHY/MODULATION/nr_modulation.h | 12 +- openair1/PHY/MODULATION/slot_fep_nr.c | 145 +++++------------- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 7 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c | 9 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 19 ++- .../SCHED_NR_UE/phy_procedures_nr_ue_sl.c | 10 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 9 +- 8 files changed, 90 insertions(+), 139 deletions(-) diff --git a/openair1/PHY/MODULATION/modulation_UE.h b/openair1/PHY/MODULATION/modulation_UE.h index b5849e21db..690858fee5 100644 --- a/openair1/PHY/MODULATION/modulation_UE.h +++ b/openair1/PHY/MODULATION/modulation_UE.h @@ -49,19 +49,13 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, int reset_freq_est); int nr_slot_fep(PHY_VARS_NR_UE *ue, - NR_DL_FRAME_PARMS *frame_parms, - const UE_nr_rxtx_proc_t *proc, - unsigned char symbol, + const NR_DL_FRAME_PARMS *frame_parms, + unsigned int slot, + unsigned int symbol, c16_t rxdataF[][frame_parms->samples_per_slot_wCP], - uint32_t linktype, - uint32_t sample_offset); - -int nr_slot_fep_init_sync(const NR_DL_FRAME_PARMS *frame_parms, - unsigned char symbol, - int sample_offset, - const c16_t **rxdata, - c16_t rxdataF[][frame_parms->samples_per_slot_wCP], - int link_type); + enum nr_Link linktype, + uint32_t sample_offset, + c16_t **rxdata); int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue, unsigned char l, diff --git a/openair1/PHY/MODULATION/nr_modulation.h b/openair1/PHY/MODULATION/nr_modulation.h index 691ef7b7dd..a8715b8c84 100644 --- a/openair1/PHY/MODULATION/nr_modulation.h +++ b/openair1/PHY/MODULATION/nr_modulation.h @@ -120,14 +120,14 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp); void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp); -void apply_nr_rotation_RX(NR_DL_FRAME_PARMS *frame_parms, - c16_t *rxdataF, - c16_t *rot, - int slot, +void apply_nr_rotation_RX(const NR_DL_FRAME_PARMS *frame_parms, + c16_t *rxdataF, + const c16_t *rot, + int slot, int nb_rb, int soffset, - int first_symbol, - int nsymb); + int first_symbol, + int nsymb); /*! \brief Perform NR precoding. TS 38.211 V15.4.0 subclause 6.3.1.5 @param[in] datatx_F_precoding, Pointer to n_layers*re data array diff --git a/openair1/PHY/MODULATION/slot_fep_nr.c b/openair1/PHY/MODULATION/slot_fep_nr.c index 6cb0a05b93..bd61d100f8 100644 --- a/openair1/PHY/MODULATION/slot_fep_nr.c +++ b/openair1/PHY/MODULATION/slot_fep_nr.c @@ -35,37 +35,43 @@ #endif*/ int nr_slot_fep(PHY_VARS_NR_UE *ue, - NR_DL_FRAME_PARMS *frame_parms, - const UE_nr_rxtx_proc_t *proc, - unsigned char symbol, + const NR_DL_FRAME_PARMS *frame_parms, + unsigned int slot, + unsigned int symbol, c16_t rxdataF[][frame_parms->samples_per_slot_wCP], - uint32_t linktype, - uint32_t sample_offset) + enum nr_Link linktype, + uint32_t sample_offset, + c16_t **rxdata) { - NR_UE_COMMON *common_vars = &ue->common_vars; - int Ns = proc->nr_slot_rx; AssertFatal(symbol < frame_parms->symbols_per_slot, "slot_fep: symbol must be between 0 and %d\n", frame_parms->symbols_per_slot-1); - AssertFatal(Ns < frame_parms->slots_per_frame, "slot_fep: Ns must be between 0 and %d\n", frame_parms->slots_per_frame-1); + AssertFatal(slot < frame_parms->slots_per_frame, "slot_fep: Ns must be between 0 and %d\n", frame_parms->slots_per_frame - 1); + bool is_sl = (linktype == link_type_sl) ? true : false; + bool is_synchronized = (ue) ? ue->is_synchronized : false; unsigned int nb_prefix_samples; unsigned int nb_prefix_samples0; - if (ue->is_synchronized) { + // For Sidelink 16 frames worth of samples is processed to find SSB, for 5G-NR 2. + unsigned int total_samples = (is_sl) ? 16 * frame_parms->samples_per_frame : 2 * frame_parms->samples_per_frame; + + int N_RB = (is_sl) ? frame_parms->N_RB_SL : frame_parms->N_RB_DL; + + if (is_synchronized || is_sl) { nb_prefix_samples = frame_parms->nb_prefix_samples; nb_prefix_samples0 = frame_parms->nb_prefix_samples0; - AssertFatal(sample_offset == 0, "Sample offset if syncronised should be 0\n"); } else { nb_prefix_samples = frame_parms->nb_prefix_samples; nb_prefix_samples0 = frame_parms->nb_prefix_samples; + AssertFatal(slot == 0, "Slot should be 0\n"); } dft_size_idx_t dftsize = get_dft(frame_parms->ofdm_symbol_size); // This is for misalignment issues int32_t tmp_dft_in[8192] __attribute__ ((aligned (32))); - unsigned int rx_offset = frame_parms->get_samples_slot_timestamp(Ns,frame_parms,0); - unsigned int abs_symbol = Ns * frame_parms->symbols_per_slot + symbol; - for (int idx_symb = Ns*frame_parms->symbols_per_slot; idx_symb <= abs_symbol; idx_symb++) + unsigned int rx_offset = frame_parms->get_samples_slot_timestamp(slot, frame_parms, 0); + unsigned int abs_symbol = slot * frame_parms->symbols_per_slot + symbol; + for (int idx_symb = slot * frame_parms->symbols_per_slot; idx_symb <= abs_symbol; idx_symb++) rx_offset += (idx_symb%(0x7<numerology_index)) ? nb_prefix_samples : nb_prefix_samples0; rx_offset += frame_parms->ofdm_symbol_size * symbol; @@ -81,107 +87,39 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, #endif for (unsigned char aa=0; aanb_antennas_rx; aa++) { - int16_t *rxdata_ptr = (int16_t *)&common_vars->rxdata[aa][rx_offset]; + int16_t *rxdata_ptr = (int16_t *)&rxdata[aa][rx_offset]; - // if input to dft is not 256-bit aligned - if ((rx_offset & 7) != 0) { - memcpy((void *)&tmp_dft_in[0], - (void *)&common_vars->rxdata[aa][rx_offset], - frame_parms->ofdm_symbol_size * sizeof(int32_t)); + rx_offset %= total_samples; - rxdata_ptr = (int16_t *)tmp_dft_in; - } - - start_meas_nr_ue_phy(ue, RX_DFT_STATS); - dft(dftsize, - rxdata_ptr, - (int16_t *)&rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], - 1); - stop_meas_nr_ue_phy(ue, RX_DFT_STATS); - - apply_nr_rotation_RX(frame_parms, rxdataF[aa], frame_parms->symbol_rotation[linktype], Ns, frame_parms->N_RB_DL, 0, symbol, 1); - } - -#ifdef DEBUG_FEP - printf("slot_fep: done\n"); -#endif - - return 0; -} - -int nr_slot_fep_init_sync(const NR_DL_FRAME_PARMS *frame_parms, - unsigned char symbol, - int sample_offset, - const c16_t **rxdata, - c16_t rxdataF[][frame_parms->samples_per_slot_wCP], - int link_type) -{ - int Ns = 0; - - AssertFatal(symbol < frame_parms->symbols_per_slot, "slot_fep: symbol must be between 0 and %d\n", frame_parms->symbols_per_slot-1); - AssertFatal(Ns < frame_parms->slots_per_frame, "slot_fep: Ns must be between 0 and %d\n", frame_parms->slots_per_frame-1); - - unsigned int nb_prefix_samples = frame_parms->nb_prefix_samples; - unsigned int frame_length_samples = frame_parms->samples_per_frame; - - dft_size_idx_t dftsize = get_dft(frame_parms->ofdm_symbol_size); - // This is for misalignment issues - int32_t tmp_dft_in[8192] __attribute__ ((aligned (32))); - - unsigned int slot_offset = frame_parms->get_samples_slot_timestamp(Ns,frame_parms,0); - unsigned int rx_offset = sample_offset + slot_offset; - rx_offset += (frame_parms->ofdm_symbol_size + nb_prefix_samples) * symbol + nb_prefix_samples; - -#ifdef DEBUG_FEP - // if (ue->frame <100) - printf("slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, slot_offset %u, sample_offset %d,rx_offset %u, frame_length_samples %u\n", - Ns, symbol, nb_prefix_samples, nb_prefix_samples0, slot_offset, sample_offset, rx_offset, frame_length_samples); -#endif - - for (unsigned char aa=0; aanb_antennas_rx; aa++) { - - int16_t *rxdata_ptr; - rx_offset%=frame_length_samples*2; - - if (rx_offset+frame_parms->ofdm_symbol_size > frame_length_samples*2 ) { + // This happens only during initial sync + if (rx_offset + frame_parms->ofdm_symbol_size > total_samples) { // rxdata is 2 frames len // we have to wrap on the end - memcpy((void *)&tmp_dft_in[0], (void *)&rxdata[aa][rx_offset], (frame_length_samples * 2 - rx_offset) * sizeof(int32_t)); - memcpy((void *)&tmp_dft_in[frame_length_samples * 2 - rx_offset], + memcpy((void *)&tmp_dft_in[0], (void *)&rxdata[aa][rx_offset], (total_samples - rx_offset) * sizeof(int32_t)); + memcpy((void *)&tmp_dft_in[total_samples - rx_offset], (void *)&rxdata[aa][0], - (frame_parms->ofdm_symbol_size - (frame_length_samples * 2 - rx_offset)) * sizeof(int32_t)); + (frame_parms->ofdm_symbol_size - (total_samples - rx_offset)) * sizeof(int32_t)); rxdata_ptr = (int16_t *)tmp_dft_in; - } else if ((rx_offset & 7) != 0) { - - // if input to dft is not 256-bit aligned + } else if ((rx_offset & 7) != 0) { // if input to dft is not 256-bit aligned memcpy((void *)&tmp_dft_in[0], (void *)&rxdata[aa][rx_offset], frame_parms->ofdm_symbol_size * sizeof(int32_t)); + rxdata_ptr = (int16_t *)tmp_dft_in; - - } else { - - // use dft input from RX buffer directly - rxdata_ptr = (int16_t *)&rxdata[aa][rx_offset]; } + if (ue) + start_meas_nr_ue_phy(ue, RX_DFT_STATS); + dft(dftsize, rxdata_ptr, (int16_t *)&rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], 1); - int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; - c16_t rot2 = frame_parms->symbol_rotation[link_type][symbol + symb_offset]; - rot2.i=-rot2.i; + if (ue) + stop_meas_nr_ue_phy(ue, RX_DFT_STATS); -#ifdef DEBUG_FEP - // if (ue->frame <100) - printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset, - symbol+symb_offset,rot2.r,rot2.i); -#endif - - c16_t *this_symbol = &rxdataF[aa][frame_parms->ofdm_symbol_size*symbol]; - rotate_cpx_vector(this_symbol, &rot2, this_symbol, frame_parms->ofdm_symbol_size, 15); + apply_nr_rotation_RX(frame_parms, rxdataF[aa], frame_parms->symbol_rotation[linktype], slot, N_RB, 0, symbol, 1); } #ifdef DEBUG_FEP @@ -191,7 +129,6 @@ int nr_slot_fep_init_sync(const NR_DL_FRAME_PARMS *frame_parms, return 0; } - int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, int32_t *rxdata, int32_t *rxdataF, @@ -251,14 +188,14 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, return 0; } -void apply_nr_rotation_RX(NR_DL_FRAME_PARMS *frame_parms, - c16_t *rxdataF, - c16_t *rot, - int slot, +void apply_nr_rotation_RX(const NR_DL_FRAME_PARMS *frame_parms, + c16_t *rxdataF, + const c16_t *rot, + int slot, int nb_rb, int soffset, - int first_symbol, - int nsymb) + int first_symbol, + int nsymb) { AssertFatal(first_symbol + nsymb <= NR_NUMBER_OF_SYMBOLS_PER_SLOT, "First symbol %d and number of symbol %d not compatible with number of symbols in a slot %d\n", @@ -270,7 +207,7 @@ void apply_nr_rotation_RX(NR_DL_FRAME_PARMS *frame_parms, c16_t rot2 = rot[symbol + symb_offset]; rot2.i = -rot2.i; LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n", slot, symb_offset, rot2.r, rot2.i); - c16_t *shift_rot = frame_parms->timeshift_symbol_rotation; + const c16_t *shift_rot = frame_parms->timeshift_symbol_rotation; c16_t *this_symbol = &rxdataF[soffset + (frame_parms->ofdm_symbol_size * symbol)]; if (nb_rb & 1) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index d08a1ed5f3..88e77b0840 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -244,12 +244,7 @@ void nr_scan_ssb(void *arg) const uint32_t rxdataF_sz = fp->samples_per_slot_wCP; __attribute__((aligned(32))) c16_t rxdataF[fp->nb_antennas_rx][rxdataF_sz]; for (int i = 0; i < NR_N_SYMBOLS_SSB; i++) - nr_slot_fep_init_sync(fp, - i, - frame_id * fp->samples_per_frame + ssbInfo->ssbOffset, - (const c16_t **)rxdata, - rxdataF, - link_type_dl); + nr_slot_fep(NULL, fp, 0, i, rxdataF, link_type_dl, frame_id * fp->samples_per_frame + ssbInfo->ssbOffset, (c16_t **)rxdata); int freq_offset_sss = 0; int32_t metric_tdd_ncp = 0; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c index c9483db2c1..2568a54a37 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c @@ -447,7 +447,14 @@ nr_initial_sync_t sl_nr_slss_search(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc, /* In order to achieve correct processing for NR prefix samples is forced to 0 and then restored after function call */ for (int symbol = 0; symbol < SL_NR_NUMSYM_SLSS_NORMAL_CP; symbol++) { - nr_slot_fep(UE, frame_parms, proc, symbol, rxdataF, link_type_sl, sync_params->ssb_offset); + nr_slot_fep(UE, + frame_parms, + proc->nr_slot_rx, + symbol, + rxdataF, + link_type_sl, + sync_params->ssb_offset, + UE->common_vars.rxdata); } sl_nr_extract_sss(UE, NULL, &metric_tdd_ncp, &phase_tdd_ncp, rxdataF); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index ea41ba21cc..be465f2908 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -907,7 +907,14 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_ __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][fp->ofdm_symbol_size]; for (int i=1; i<4; i++) { - nr_slot_fep(ue, fp, proc, (ssb_start_symbol + i) % (fp->symbols_per_slot), rxdataF, link_type_dl, 0); + nr_slot_fep(ue, + fp, + proc->nr_slot_rx, + (ssb_start_symbol + i) % (fp->symbols_per_slot), + rxdataF, + link_type_dl, + 0, + ue->common_vars.rxdata); nr_pbch_channel_estimation(&ue->frame_parms, NULL, @@ -971,7 +978,7 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_ { for(int j = prs_config->SymbolStart; j < (prs_config->SymbolStart+prs_config->NumPRSSymbols); j++) { - nr_slot_fep(ue, fp, proc, (j % fp->symbols_per_slot), rxdataF, link_type_dl, 0); + nr_slot_fep(ue, fp, proc->nr_slot_rx, (j % fp->symbols_per_slot), rxdataF, link_type_dl, 0, ue->common_vars.rxdata); } nr_prs_channel_estimation(gNB_id, rsc_id, i, ue, proc, fp, rxdataF); } @@ -1000,7 +1007,7 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_ uint8_t nb_symb_pdcch = phy_pdcch_config->nb_search_space > 0 ? phy_pdcch_config->pdcch_config[0].coreset.duration : 0; for (uint16_t l=0; lnr_slot_rx, l, rxdataF, link_type_dl, 0, ue->common_vars.rxdata); } // Hold the channel estimates in frequency domain. @@ -1050,7 +1057,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ for(int symb_idx = 0; symb_idx < 4; symb_idx++) { int symb = ue->csiim_vars[gNB_id]->csiim_config_pdu.l_csiim[symb_idx]; if (!slot_fep_map[symb]) { - nr_slot_fep(ue, &ue->frame_parms, proc, symb, rxdataF, link_type_dl, 0); + nr_slot_fep(ue, &ue->frame_parms, proc->nr_slot_rx, symb, rxdataF, link_type_dl, 0, ue->common_vars.rxdata); slot_fep_map[symb] = true; } } @@ -1063,7 +1070,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ for(int symb = 0; symb < NR_SYMBOLS_PER_SLOT; symb++) { if(is_csi_rs_in_symbol(ue->csirs_vars[gNB_id]->csirs_config_pdu, symb)) { if (!slot_fep_map[symb]) { - nr_slot_fep(ue, &ue->frame_parms, proc, symb, rxdataF, link_type_dl, 0); + nr_slot_fep(ue, &ue->frame_parms, proc->nr_slot_rx, symb, rxdataF, link_type_dl, 0, ue->common_vars.rxdata); slot_fep_map[symb] = true; } } @@ -1082,7 +1089,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ for (int m = start_symb_sch; m < (nb_symb_sch + start_symb_sch) ; m++) { if (!slot_fep_map[m]) { - nr_slot_fep(ue, &ue->frame_parms, proc, m, rxdataF, link_type_dl, 0); + nr_slot_fep(ue, &ue->frame_parms, proc->nr_slot_rx, m, rxdataF, link_type_dl, 0, ue->common_vars.rxdata); slot_fep_map[m] = true; } } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c index 37e6251fe8..256dab11f7 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c @@ -149,8 +149,12 @@ static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue, } else { result = decoded_pdu; sl_phy_params->psbch.rx_ok++; - LOG_I(NR_PHY, "[UE%d] %d:%d PSBCH RX:OK. RSRP: %d dB/RE\n", - ue->Mod_id, proc->frame_rx, proc->nr_slot_rx, sl_phy_params->psbch.rsrp_dB_per_RE); + LOG_I(NR_PHY, + "[UE%d] %d:%d PSBCH RX:OK. RSRP: %d dB/RE\n", + ue->Mod_id, + proc->frame_rx, + proc->nr_slot_rx, + sl_phy_params->psbch.rsrp_dB_per_RE); } nr_fill_sl_indication(&sl_indication, &rx_ind, NULL, proc, ue, phy_data); @@ -192,7 +196,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr const int numsym = (fp->Ncp) ? SL_NR_NUM_SYMBOLS_SSB_EXT_CP : SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP; for (int sym = 0; sym < numsym;) { - nr_slot_fep(ue, fp, proc, sym, rxdataF, link_type_sl, 0); + nr_slot_fep(ue, fp, proc->nr_slot_rx, sym, rxdataF, link_type_sl, 0, ue->common_vars.rxdata); start_meas(&sl_phy_params->channel_estimation_stats); nr_pbch_channel_estimation(fp, diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 94972e913c..aea092152f 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -799,7 +799,14 @@ int main(int argc, char **argv) proc.nr_slot_rx = ssb_slot; proc.gNB_id = 0; for (int i = UE->symbol_offset + 1; i < UE->symbol_offset + 4; i++) { - nr_slot_fep(UE, frame_parms, &proc, i % frame_parms->symbols_per_slot, rxdataF, link_type_dl,0); + nr_slot_fep(UE, + frame_parms, + proc.nr_slot_rx, + i % frame_parms->symbols_per_slot, + rxdataF, + link_type_dl, + 0, + UE->common_vars.rxdata); nr_pbch_channel_estimation(&UE->frame_parms, &UE->SL_UE_PHY_PARAMS, From 18a51529940da4d24392ec1704aaec61011ea13f Mon Sep 17 00:00:00 2001 From: Leonardo Bonati Date: Mon, 6 May 2024 14:09:14 -0400 Subject: [PATCH 26/87] Add Jenkins job for Colosseum testing integration - Add Jenkinsfile, triggering Colosseum test run - Add test scripts that interact with Colosseum running --- ci-scripts/Jenkinsfile-colosseum | 124 ++++++++++++++++++ ci-scripts/colosseum_scripts/README.md | 11 ++ ci-scripts/colosseum_scripts/check-results.sh | 33 +++++ .../colosseum_scripts/get-test-results.sh | 38 ++++++ ci-scripts/colosseum_scripts/launch-job.sh | 53 ++++++++ .../colosseum_scripts/set-job-status.sh | 28 ++++ ci-scripts/colosseum_scripts/wait-job-end.sh | 47 +++++++ 7 files changed, 334 insertions(+) create mode 100644 ci-scripts/Jenkinsfile-colosseum create mode 100644 ci-scripts/colosseum_scripts/README.md create mode 100755 ci-scripts/colosseum_scripts/check-results.sh create mode 100755 ci-scripts/colosseum_scripts/get-test-results.sh create mode 100755 ci-scripts/colosseum_scripts/launch-job.sh create mode 100755 ci-scripts/colosseum_scripts/set-job-status.sh create mode 100755 ci-scripts/colosseum_scripts/wait-job-end.sh diff --git a/ci-scripts/Jenkinsfile-colosseum b/ci-scripts/Jenkinsfile-colosseum new file mode 100644 index 0000000000..462f94fe39 --- /dev/null +++ b/ci-scripts/Jenkinsfile-colosseum @@ -0,0 +1,124 @@ +#!/bin/groovy +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +def node = "porcepix" +def resource = "CI-NEU-CI" + +pipeline { + agent { + label node + } + options { + timestamps() + ansiColor('xterm') + timeout(time: 3, unit: 'HOURS') + } + stages { + stage ("Trigger NEU CI") { + steps { + lock (resource) { + script { + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ColosseumCredentials}", usernameVariable: 'col_username', passwordVariable: 'col_password'], + ]) { + // use eNB target branch variable if eNB repository is empty + def git_Branch = "" + if (params.eNB_Branch.isEmpty()) { + echo 'eNB_Branch parameter is empty, using eNB_TargetBranch instead' + git_Branch = params.eNB_TargetBranch + } else { + git_Branch = params.eNB_Branch + } + + // use default 10011 rf scenario if not specified + if (params.Colosseum_Rf_Scenario.isEmpty()) { + echo 'Colosseum_Rf_Scenario parameter is empty, defaulting to 10011' + rf_scenario = "10011" + } else { + rf_scenario = params.Colosseum_Rf_Scenario + } + + sh "echo Testing reachability of Colosseum endpoint" + sh "ping -c 3 10.100.1.253" + + sh "./ci-scripts/colosseum_scripts/launch-job.sh ${col_username} ${col_password} ${currentBuild.number} ${params.eNB_Repository} ${git_Branch} ${rf_scenario} ${env.JOB_URL}" + } + } + } + } + } + stage ("Wait for job to finish") { + steps { + lock (resource) { + script { + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ColosseumCredentials}", usernameVariable: 'col_username', passwordVariable: 'col_password'], + ]) { + timeout (time: 2, unit: 'HOURS') { + sh "./ci-scripts/colosseum_scripts/wait-job-end.sh ${col_username} ${col_password}" + } + } + } + } + } + } + stage ("Get test results") { + steps { + lock (resource) { + script { + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ColosseumCredentials}", usernameVariable: 'col_username', passwordVariable: 'col_password'], + ]) { + sh "./ci-scripts/colosseum_scripts/get-test-results.sh ${col_username} ${col_password}" + } + + if(fileExists("results.tar.xz")) { + archiveArtifacts "results.tar.xz" + + sh "mkdir -p results" + sh "tar -xf results.tar.xz -C results --strip-components=1" + + if(fileExists("results/test_summary.html")) { + archiveArtifacts "results/test_summary.html" + } + + // check if test passed + sh "./ci-scripts/colosseum_scripts/check-results.sh results/test_summary.html" + + sh "rm -Rf ./results" + } + } + } + } + } + stage ("Set job status") { + steps { + lock (resource) { + script { + echo 'Set job status' + sh "./ci-scripts/colosseum_scripts/set-job-status.sh" + } + } + } + } + } +} diff --git a/ci-scripts/colosseum_scripts/README.md b/ci-scripts/colosseum_scripts/README.md new file mode 100644 index 0000000000..5d5c40399c --- /dev/null +++ b/ci-scripts/colosseum_scripts/README.md @@ -0,0 +1,11 @@ +# Colosseum Automated Testing + +These scripts are used by a Jenkins [job](../Jenkinsfile-colosseum) to trigger automated testing of OpenAirInterface (OAI) gNB and softUE on the [Colosseum](https://www.northeastern.edu/colosseum/) Open RAN digital twin. +Once a test is triggered, a new OAI LXC container at the specified OAI version will be built on Colosseum (if not already present), and gNB and softUE will perform TCP uplink and downlink connectivity test via the iPerf [tool](https://iperf.fr/). +The OAI branch to build and test can be specified through the `eNB_Branch` parameter passed through Jenkins (`eNB_TargetBranch`, which defaults to the `develop` branch, is used if `eNB_Branch` is not specified). +The Colosseum network scenario to test is specified through the `Colosseum_Rf_Scenario` Jenkins parameter, which defaults to a base Colosseum scenario without artificially added channel effects (e.g., only hardware impariments of software-defined radios, cables, and channel emulator). + +Once the test ends, results are analyzed through the OAI automated test report generation tool available [here](https://github.com/ztouchnetworks/openairinterface-automated-test-reports), which builds a test report from the iPerf and OAI logs, and marks the test as successful or unsuccessful. +Results from successful tests are saved in history files and used to compare more recent tests. +A test is considered successful if the downlink throughput achieved during the test is greather than or equal to the average of the test history, which spans successful test executed since May 2024. +This is used to identify possible regressions of OAI runs executed on the Colosseum testbed. diff --git a/ci-scripts/colosseum_scripts/check-results.sh b/ci-scripts/colosseum_scripts/check-results.sh new file mode 100755 index 0000000000..5ce1f33cda --- /dev/null +++ b/ci-scripts/colosseum_scripts/check-results.sh @@ -0,0 +1,33 @@ +#!/bin/bash +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ + +set -x + +RESULT_FILE=$1 + +grep -A 1 "Final Status" ${RESULT_FILE} | grep "PASS" + +if [ "$?" = 0 ]; then + echo '{"status": "successful"}' > results.json +else + echo '{"status": "failed"}' > results.json +fi diff --git a/ci-scripts/colosseum_scripts/get-test-results.sh b/ci-scripts/colosseum_scripts/get-test-results.sh new file mode 100755 index 0000000000..5aa88e614d --- /dev/null +++ b/ci-scripts/colosseum_scripts/get-test-results.sh @@ -0,0 +1,38 @@ +#!/bin/bash +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ + +set -eu + +AWX_API_URL=https://10.100.1.253 +AWX_JOB_EVENT_QUERY=job_events/?search=results_url + +COL_USER=$1 +COL_PASS=$2 + +AWX_API_JOB_PATH=$(jq -r '.url' launch.json) + +# get result url and download test results +curl -s -f -k -u ${COL_USER}:${COL_PASS} -X GET ${AWX_API_URL}${AWX_API_JOB_PATH}${AWX_JOB_EVENT_QUERY} > result.json + +set -x +RESULT=$(jq -r '.results[0].event_data.res.ansible_facts.results_url' result.json) +wget -q -O - ${RESULT} > results.tar.xz diff --git a/ci-scripts/colosseum_scripts/launch-job.sh b/ci-scripts/colosseum_scripts/launch-job.sh new file mode 100755 index 0000000000..026fed6bf4 --- /dev/null +++ b/ci-scripts/colosseum_scripts/launch-job.sh @@ -0,0 +1,53 @@ +#!/bin/bash +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ + +set -eu + +AWX_API_URL=https://10.100.1.253 +AWX_JOB_ID=16 +AWX_API_LAUNCH_PATH=/api/v2/job_templates/${AWX_JOB_ID}/launch/ + +COL_USER=$1 +COL_PASS=$2 +JENKINS_JOB_ID=$3 +GIT_REPOSITORY=$4 +GIT_BRANCH=$5 +COLOSSEUM_RF_SCENARIO=$6 +JENKINS_JOB_URL=$7 + +# assemble data to send +CURL_DATA=$(cat <<-END | jq -c . +{ + "extra_vars": + { + "oai_repo": "${GIT_REPOSITORY}", + "oai_branch": "${GIT_BRANCH}", + "colosseum_rf_scenario": "${COLOSSEUM_RF_SCENARIO}", + "jenkins_job_id": "${JENKINS_JOB_ID}", + "jenkins_job_url": "${JENKINS_JOB_URL}" + } +} +END +) + +# launch job +curl -s -f -k -u ${COL_USER}:${COL_PASS} -X POST -H "Content-Type: application/json" -d ${CURL_DATA} ${AWX_API_URL}${AWX_API_LAUNCH_PATH} > launch.json diff --git a/ci-scripts/colosseum_scripts/set-job-status.sh b/ci-scripts/colosseum_scripts/set-job-status.sh new file mode 100755 index 0000000000..f595f3ba0c --- /dev/null +++ b/ci-scripts/colosseum_scripts/set-job-status.sh @@ -0,0 +1,28 @@ +#!/bin/bash +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ + +set -eu + +# sets final exit code and thus jenkins pass or fail +STATUS=$(jq -r '.status' results.json) +echo "job status: ${STATUS}" +[ "${STATUS}" = "successful" ] diff --git a/ci-scripts/colosseum_scripts/wait-job-end.sh b/ci-scripts/colosseum_scripts/wait-job-end.sh new file mode 100755 index 0000000000..1d104bdfe3 --- /dev/null +++ b/ci-scripts/colosseum_scripts/wait-job-end.sh @@ -0,0 +1,47 @@ +#!/bin/bash +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ + +set -xeu + +AWX_API_URL=https://10.100.1.253 +AWX_MAX_API_CHECKS=120 + +COL_USER=$1 +COL_PASS=$2 + +AWX_API_JOB_PATH=$(jq -r '.url' launch.json) + +# wait for job to complete +for ((try = 1; try <= ${AWX_MAX_API_CHECKS}; try++)); do + set +x + curl -s -f -k -u ${COL_USER}:${COL_PASS} -X GET ${AWX_API_URL}${AWX_API_JOB_PATH} > status.json + set -x + + FINISHED=$(jq -r '.finished' status.json) + [ "${FINISHED}" = "null" ] || break + + sleep 60 +done + +[ $try != $AWX_MAX_API_CHECKS ] || echo "WARNING: stopped retrying after $AWX_MAX_API_CHECKS times; timed out?" + +echo "AWX job completed $FINISHED" From 42ab4b4a0cbac8a427750b0ad8d48188f74865c8 Mon Sep 17 00:00:00 2001 From: Raghavendra Dinavahi Date: Wed, 25 Sep 2024 16:52:14 +0000 Subject: [PATCH 27/87] fix for variable power in PDSCH REs - correctly scale REs. Some REs have higher power during PDSCH RE-Mapping which is corrected. - Closes: Issue 811 --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index fa9a3859b1..da2290d019 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -410,8 +410,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) c16_t *txFc = &txdataF_precoding[layer][l_symbol][start_sc]; c16_t *txlc = &tx_layer[cur_re]; for (i = (upper_limit >> 2) << 2; i < upper_limit; i++) { - txFc[i].r = ((txlc[i].r * amp) >> 14) + 1; - txFc[i].i = ((txlc[i].i * amp) >> 14) + 1; + txFc[i].r = (((txlc[i].r * amp) >> 14) + 1) >> 1; + txFc[i].i = (((txlc[i].i * amp) >> 14) + 1) >> 1; } } cur_re += upper_limit; @@ -442,8 +442,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) c16_t *txFc = txdataF_precoding[layer][l_symbol]; c16_t *txlc = &tx_layer[cur_re]; for (i = (remaining_re >> 2) << 2; i < remaining_re; i++) { - txFc[i].r = ((txlc[i].r * amp) >> 14) + 1; - txFc[i].i = ((txlc[i].i * amp) >> 14) + 1; + txFc[i].r = (((txlc[i].r * amp) >> 14) + 1) >> 1; + txFc[i].i = (((txlc[i].i * amp) >> 14) + 1) >> 1; } } } // remaining_re > 0 From ad741065481bb096a5af35b9ca33288fa43e4136 Mon Sep 17 00:00:00 2001 From: arora Date: Tue, 20 Aug 2024 16:47:45 +0200 Subject: [PATCH 28/87] Add E2 SM in the target dockerfiles to use e2 agent in container deployment - Update builder dockerfiles to build Flexric for E2 SM - Update target dockerfiles to copy E2 SM --- docker/Dockerfile.build.rhel9 | 23 ++++++++++++++++++++--- docker/Dockerfile.build.ubuntu22 | 17 ++++++++++++++++- docker/Dockerfile.gNB.aw2s.rhel9 | 3 +++ docker/Dockerfile.gNB.rhel9 | 3 +++ docker/Dockerfile.gNB.ubuntu22 | 2 ++ docker/Dockerfile.nr-cuup.rhel9 | 3 +++ docker/Dockerfile.nr-cuup.ubuntu22 | 2 ++ 7 files changed, 49 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile.build.rhel9 b/docker/Dockerfile.build.rhel9 index 464c6caf5a..8635928d52 100644 --- a/docker/Dockerfile.build.rhel9 +++ b/docker/Dockerfile.build.rhel9 @@ -27,6 +27,9 @@ FROM ran-base:latest AS ran-build +ARG E2AP_VERSION=E2AP_V3 +ARG KPM_VERSION=KPM_V3_00 + RUN rm -Rf /oai-ran WORKDIR /oai-ran COPY . . @@ -35,12 +38,26 @@ COPY . . RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - CXXFLAGS="-Werror -fstack-protector-strong" CFLAGS="-Werror -fstack-protector-strong" ./build_oai -c --ninja \ + scl enable gcc-toolset-12 "\ + CXXFLAGS='-Werror -fstack-protector-strong' CFLAGS='-Werror -fstack-protector-strong' ./build_oai -c --ninja \ --eNB --gNB --RU --UE --nrUE \ - --build-lib "telnetsrv enbscope uescope nrscope" \ + --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt \ + -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ + --build-lib 'telnetsrv enbscope uescope nrscope' \ -w USRP -t Ethernet \ - --noavx512 && \ + --noavx512" && \ echo "---- ldd on executables ----" && \ ldd ran_build/build/*softmodem* ran_build/build/nr-cuup ran_build/build/oairu && \ echo "---- ldd on shared libraries ----" && \ ldd ran_build/build/*.so + +## Build FlexRIC for SM Models +RUN mkdir -p openair2/E2AP/flexric/build && \ + cd openair2/E2AP/flexric/build && \ + scl enable gcc-toolset-12 "\ + cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ + -DXAPP_MULTILANGUAGE=OFF \ + -DKPM_VERSION=$KPM_VERSION \ + -DE2AP_VERSION=$E2AP_VERSION .. &&\ + ninja && \ + ninja install" diff --git a/docker/Dockerfile.build.ubuntu22 b/docker/Dockerfile.build.ubuntu22 index e4cc71fdcf..9ee0b20158 100644 --- a/docker/Dockerfile.build.ubuntu22 +++ b/docker/Dockerfile.build.ubuntu22 @@ -28,6 +28,9 @@ FROM ran-base:latest AS ran-build ARG BUILD_OPTION +ARG E2AP_VERSION=E2AP_V3 +ARG KPM_VERSION=KPM_V3_00 + RUN rm -Rf /oai-ran WORKDIR /oai-ran COPY . . @@ -40,7 +43,7 @@ RUN /bin/sh oaienv && \ --eNB --gNB --RU --UE --nrUE \ --build-lib "telnetsrv enbscope uescope nrscope" \ -w USRP -t Ethernet \ - --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF \ + --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ --noavx512 \ --cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror" $BUILD_OPTION && \ # Mainly to see if the sanitize option was perfectly executed @@ -48,3 +51,15 @@ RUN /bin/sh oaienv && \ ldd ran_build/build/*softmodem* ran_build/build/nr-cuup ran_build/build/oairu && \ echo "---- ldd on shared libraries ----" && \ ldd ran_build/build/*.so + +## Build FlexRIC for SM Models +RUN mkdir -p openair2/E2AP/flexric/build && \ + cd openair2/E2AP/flexric/build && \ + cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ + -DXAPP_MULTILANGUAGE=OFF \ + -DKPM_VERSION=$KPM_VERSION \ + -DE2AP_VERSION=$E2AP_VERSION \ + -DCMAKE_C_COMPILER=gcc-12 \ + -DCMAKE_CXX_COMPILER=g++-12 .. && \ + ninja && \ + ninja install diff --git a/docker/Dockerfile.gNB.aw2s.rhel9 b/docker/Dockerfile.gNB.aw2s.rhel9 index db4b0f60c6..0cb4def5fd 100644 --- a/docker/Dockerfile.gNB.aw2s.rhel9 +++ b/docker/Dockerfile.gNB.aw2s.rhel9 @@ -76,6 +76,9 @@ COPY --from=gnb-base \ /lib64/libforms.so.2 \ /lib64/ +## Copy E2 SM models +COPY --from=gnb-build /usr/local/lib64/flexric /usr/local/lib64/flexric + RUN ln -s /usr/local/lib/libaw2sori_transpro.so /usr/local/lib/libthirdparty_transpro.so && \ ln -s /usr/local/lib/liboai_eth_transpro.so /usr/local/lib/liboai_transpro.so && \ ldconfig && \ diff --git a/docker/Dockerfile.gNB.rhel9 b/docker/Dockerfile.gNB.rhel9 index e8fd8a9433..625590efad 100644 --- a/docker/Dockerfile.gNB.rhel9 +++ b/docker/Dockerfile.gNB.rhel9 @@ -93,6 +93,9 @@ COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin COPY --from=gnb-base /usr/local/lib64/libuhd.so.4.4.0 /usr/local/lib64 COPY --from=gnb-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin +## Copy E2 SM models +COPY --from=gnb-build /usr/local/lib64/flexric /usr/local/lib64/flexric + WORKDIR /usr/local/share/uhd/rfnoc COPY --from=gnb-base /usr/local/share/uhd/rfnoc/ . diff --git a/docker/Dockerfile.gNB.ubuntu22 b/docker/Dockerfile.gNB.ubuntu22 index 77a7ac0207..6213ed0ca3 100644 --- a/docker/Dockerfile.gNB.ubuntu22 +++ b/docker/Dockerfile.gNB.ubuntu22 @@ -99,6 +99,8 @@ COPY --from=gnb-build \ COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin COPY --from=gnb-base /usr/local/lib/libuhd.so.4.4.0 /usr/local/lib COPY --from=gnb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin +## Copy E2 SM models +COPY --from=gnb-build /usr/local/lib/flexric /usr/local/lib/flexric RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \ ldconfig && \ diff --git a/docker/Dockerfile.nr-cuup.rhel9 b/docker/Dockerfile.nr-cuup.rhel9 index 08ee72fa30..b1b083e57c 100644 --- a/docker/Dockerfile.nr-cuup.rhel9 +++ b/docker/Dockerfile.nr-cuup.rhel9 @@ -61,6 +61,9 @@ COPY --from=gnb-base \ /lib64/libconfig.so.11 \ /lib64/ +## Copy E2 SM models +COPY --from=gnb-build /usr/local/lib64/flexric /usr/local/lib64/flexric + RUN ldconfig && \ echo "ldd on nr-cuup" && ldd /opt/oai-gnb/bin/nr-cuup && \ echo "ldd on libparams_libconfig" && ldd /usr/local/lib/libparams_libconfig.so && \ diff --git a/docker/Dockerfile.nr-cuup.ubuntu22 b/docker/Dockerfile.nr-cuup.ubuntu22 index af95cb5a9c..242fac61b8 100644 --- a/docker/Dockerfile.nr-cuup.ubuntu22 +++ b/docker/Dockerfile.nr-cuup.ubuntu22 @@ -55,6 +55,8 @@ RUN apt-get update && \ # copy the right version from ran-build. When upgrading to Ubuntu24, install # the correct one above! COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/ +## Copy E2 SM models +COPY --from=gnb-build /usr/local/lib/flexric /usr/local/lib/flexric WORKDIR /opt/oai-gnb/bin COPY --from=gnb-build \ From c1641b66af47c98b58d1e7c0caa6e78e94855532 Mon Sep 17 00:00:00 2001 From: arora Date: Thu, 22 Aug 2024 15:10:34 +0200 Subject: [PATCH 29/87] Bump rhel to gcc13, to avoid gcc12 warnings in openair1 --- docker/Dockerfile.base.rhel9 | 7 ++++--- docker/Dockerfile.base.ubuntu22 | 2 +- docker/Dockerfile.build.fhi72.rhel9 | 4 ++-- docker/Dockerfile.build.rhel9 | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile.base.rhel9 b/docker/Dockerfile.base.rhel9 index dee50127ac..949da7e4a1 100644 --- a/docker/Dockerfile.base.rhel9 +++ b/docker/Dockerfile.base.rhel9 @@ -57,8 +57,9 @@ RUN rm -f /etc/rhsm-host && \ python3-devel \ numactl-libs \ numactl-devel \ - gcc-toolset-12-gcc \ - gcc-toolset-12-gcc-c++ \ + #use gcc-13 to avoid problems of default gcc-11 in FlexRIC + gcc-toolset-13-gcc \ + gcc-toolset-13-gcc-c++ \ # python3-pip and pyyaml are used for conf template generation python3-pip && \ pip3 install --ignore-installed pyyaml && \ @@ -90,6 +91,6 @@ COPY oaienv . RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - scl enable gcc-toolset-12 "\ + scl enable gcc-toolset-13 "\ ./build_oai -I --install-optional-packages -w USRP" && \ rm /etc/pki/entitlement/*pem diff --git a/docker/Dockerfile.base.ubuntu22 b/docker/Dockerfile.base.ubuntu22 index f23cf01ac0..5aa16697e2 100644 --- a/docker/Dockerfile.base.ubuntu22 +++ b/docker/Dockerfile.base.ubuntu22 @@ -34,7 +34,6 @@ ENV BUILD_UHD_FROM_SOURCE=True ENV UHD_VERSION=4.4.0.0 #install developers pkg/repo -#use gcc-12 to avoid problems of default gcc-11 in FlexRIC RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \ DEBIAN_FRONTEND=noninteractive apt-get install --yes \ @@ -42,6 +41,7 @@ RUN apt-get update && \ build-essential \ psmisc \ git \ + #use gcc-12 to avoid problems of default gcc-11 in FlexRIC gcc-12 \ g++-12 \ xxd \ diff --git a/docker/Dockerfile.build.fhi72.rhel9 b/docker/Dockerfile.build.fhi72.rhel9 index 6a70b89a51..e8a1f2d76b 100644 --- a/docker/Dockerfile.build.fhi72.rhel9 +++ b/docker/Dockerfile.build.fhi72.rhel9 @@ -56,7 +56,7 @@ ARG KPM_VERSION=KPM_V3_00 RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - scl enable gcc-toolset-12 "\ + scl enable gcc-toolset-13 "\ ./build_oai \ --gNB \ --build-lib 'telnetsrv enbscope uescope nrscope' \ @@ -70,7 +70,7 @@ RUN /bin/sh oaienv && \ ## Build FlexRIC for SM Models RUN mkdir -p openair2/E2AP/flexric/build && \ cd openair2/E2AP/flexric/build && \ - scl enable gcc-toolset-12 "\ + scl enable gcc-toolset-13 "\ cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ -DXAPP_MULTILANGUAGE=OFF \ -DKPM_VERSION=$KPM_VERSION \ diff --git a/docker/Dockerfile.build.rhel9 b/docker/Dockerfile.build.rhel9 index 8635928d52..ba10b3a4cd 100644 --- a/docker/Dockerfile.build.rhel9 +++ b/docker/Dockerfile.build.rhel9 @@ -38,7 +38,7 @@ COPY . . RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - scl enable gcc-toolset-12 "\ + scl enable gcc-toolset-13 "\ CXXFLAGS='-Werror -fstack-protector-strong' CFLAGS='-Werror -fstack-protector-strong' ./build_oai -c --ninja \ --eNB --gNB --RU --UE --nrUE \ --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt \ @@ -54,7 +54,7 @@ RUN /bin/sh oaienv && \ ## Build FlexRIC for SM Models RUN mkdir -p openair2/E2AP/flexric/build && \ cd openair2/E2AP/flexric/build && \ - scl enable gcc-toolset-12 "\ + scl enable gcc-toolset-13 "\ cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ -DXAPP_MULTILANGUAGE=OFF \ -DKPM_VERSION=$KPM_VERSION \ From 8f5327527eeb947483e9e93761b3d9595a71a792 Mon Sep 17 00:00:00 2001 From: arora Date: Thu, 26 Sep 2024 10:19:20 +0200 Subject: [PATCH 30/87] Disable UHD unit tests to avoid gcc13 warnings --- cmake_targets/tools/build_helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index d1dadf9535..9c11fced56 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -286,7 +286,7 @@ install_usrp_uhd_driver_from_source(){ git diff mkdir -p host/build cd host/build || true - $CMAKE ../ -GNinja + $CMAKE ../ -GNinja -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF echo "Compiling UHD" ninja $SUDO ninja install From ed7750aba272b71c6037be6f548d8b080f618d77 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Thu, 26 Sep 2024 13:21:32 +0200 Subject: [PATCH 31/87] fix debug output for DEBUG_DLSCH_MAPPING --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 50 +++++++++++++++------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index da2290d019..ce4109de2c 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -228,8 +228,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) // Loop Over OFDM symbols: for (int l_symbol = rel15->StartSymbolIndex; l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols; l_symbol++) { /// DMRS QPSK modulation - uint8_t k_prime=0; - uint16_t n=0; + uint8_t k_prime = 0; + uint16_t n = 0; if ((dmrs_symbol_map & (1 << l_symbol))) { // DMRS time occasion // The reference point for is subcarrier 0 of the lowest-numbered resource block in CORESET 0 if the corresponding // PDCCH is associated with CORESET 0 and Type0-PDCCH common search space and is addressed to SI-RNTI @@ -254,7 +254,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) #ifdef DEBUG_DLSCH printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l_symbol, n_dmrs, dmrs_Type); for (int i = 0; i < n_dmrs / 2; i += 8) { - for (int j=0; j<8; j++) { + for (int j = 0; j < 8; j++) { printf("%d %d\t", mod_dmrs[i + j].r, mod_dmrs[i + j].i); } printf("\n"); @@ -339,8 +339,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) dmrs_Type)) { txdataF_precoding[layer][l_symbol][k] = c16mulRealShift(tx_layer[cur_re], amp, 15); #ifdef DEBUG_DLSCH_MAPPING - printf("m %u\t l %d \t k %d \t txdataF: %d %d\n", - m, + printf("re %u\t l %d \t k %d \t txdataF: %d %d\n", + cur_re, l_symbol, k, txdataF_precoding[layer][l_symbol][k].r, @@ -392,13 +392,13 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) const simde__m128i txL = simde_mm_loadu_si128(txl + i); simde_mm_storeu_si128(txF + i, simde_mm_mulhrs_epi16(amp64, txL)); #ifdef DEBUG_DLSCH_MAPPING - if ((i&1) > 0) - printf("m %u\t l %d \t k %d \t txdataF: %d %d\n", - m, + for (int j = 0; j < 4; j++) + printf("re %u\t l %d \t k %d \t txdataF: %d %d\n", + cur_re + 4 * i + j, l_symbol, - start_sc + (i >> 1), - txdataF_precoding[layer][l_symbol][start_sc].r, - txdataF_precoding[layer][l_symbol][start_sc].i); + start_sc + 4 * i + j, + txdataF_precoding[layer][l_symbol][start_sc + 4 * i + j].r, + txdataF_precoding[layer][l_symbol][start_sc + 4 * i + j].i); #endif /* handle this, mute RE */ /*else { @@ -412,6 +412,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) for (i = (upper_limit >> 2) << 2; i < upper_limit; i++) { txFc[i].r = (((txlc[i].r * amp) >> 14) + 1) >> 1; txFc[i].i = (((txlc[i].i * amp) >> 14) + 1) >> 1; +#ifdef DEBUG_DLSCH_MAPPING + printf("re %u\t l %d \t k %d \t txdataF: %d %d\n", cur_re + i, l_symbol, start_sc + i, txFc[i].r, txFc[i].i); +#endif } } cur_re += upper_limit; @@ -422,15 +425,14 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) for (i = 0; i < (remaining_re >> 2); i++) { const simde__m128i txL = simde_mm_loadu_si128(txl + i); simde_mm_storeu_si128(txF + i, simde_mm_mulhrs_epi16(amp64, txL)); - #ifdef DEBUG_DLSCH_MAPPING - if ((i&1) > 0) - printf("m %u\t l %d \t k %d \t txdataF: %d %d\n", - m, - l_symbol, - i >> 1, - txdataF_precoding[layer][l_symbol][i >> 1].r, - txdataF_precoding[layer][l_symbol][i >> 1].i); + for (int j = 0; j < 4; j++) + printf("re %u\t l %d \t k %d \t txdataF: %d %d\n", + cur_re + 4 * i + j, + l_symbol, + 4 * i + j, + txdataF_precoding[layer][l_symbol][4 * i + j].r, + txdataF_precoding[layer][l_symbol][4 * i + j].i); #endif /* handle this, mute RE */ /*else { @@ -444,6 +446,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) for (i = (remaining_re >> 2) << 2; i < remaining_re; i++) { txFc[i].r = (((txlc[i].r * amp) >> 14) + 1) >> 1; txFc[i].i = (((txlc[i].i * amp) >> 14) + 1) >> 1; +#ifdef DEBUG_DLSCH_MAPPING + printf("re %u\t l %d \t k %d \t txdataF: %d %d\n", cur_re + i, l_symbol, i, txFc[i].r, txFc[i].i); +#endif } } } // remaining_re > 0 @@ -525,7 +530,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) ant, pmi_pdu->num_ant_ports); AssertFatal(rel15->nrOfLayers == pmi_pdu->numLayers, "Number of layers %d doesn't match to the one in precoding matrix %d\n", rel15->nrOfLayers, pmi_pdu->numLayers); - if((subCarrier + re_cnt) < frame_parms->ofdm_symbol_size){ // within ofdm_symbol_size, use SIMDe + if ((subCarrier + re_cnt) < frame_parms->ofdm_symbol_size) { // within ofdm_symbol_size, use SIMDe nr_layer_precoder_simd(rel15->nrOfLayers, NR_SYMBOLS_PER_SLOT, frame_parms->ofdm_symbol_size, @@ -537,8 +542,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) re_cnt, &txdataF[ant][txdataF_offset_per_symbol]); subCarrier += re_cnt; - } - else{ // crossing ofdm_symbol_size, use simple arithmetic operations + } else { // crossing ofdm_symbol_size, use simple arithmetic operations for (int i = 0; i < re_cnt; i++) { txdataF[ant][txdataF_offset_per_symbol + subCarrier] = nr_layer_precoder_cm(rel15->nrOfLayers, @@ -552,7 +556,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) #ifdef DEBUG_DLSCH_MAPPING printf("antenna %d\t l %d \t subCarrier %d \t txdataF: %d %d\n", ant, - symbol, + l_symbol, subCarrier, txdataF[ant][l_symbol * frame_parms->ofdm_symbol_size + subCarrier + txdataF_offset].r, txdataF[ant][l_symbol * frame_parms->ofdm_symbol_size + subCarrier + txdataF_offset].i); From 23cc049157f68f1c0a5101a5bc6eaca5266ce8dc Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Thu, 26 Sep 2024 14:55:37 +0200 Subject: [PATCH 32/87] Remove unnecessary includes in rfsimulator --- openair1/PHY/TOOLS/signal_energy.c | 1 - openair1/SIMULATION/RF/dac.c | 1 - openair1/SIMULATION/TOOLS/channel_sim.c | 9 --------- openair1/SIMULATION/TOOLS/multipath_channel.c | 5 ----- openair1/SIMULATION/TOOLS/multipath_tv_channel.c | 5 +---- openair1/SIMULATION/TOOLS/phase_noise.c | 5 +---- openair1/SIMULATION/TOOLS/random_channel.c | 2 -- openair1/SIMULATION/TOOLS/rangen_double.c | 1 - openair1/SIMULATION/TOOLS/taus.c | 3 --- radio/rfsimulator/apply_channelmod.c | 11 ----------- radio/rfsimulator/simulator.c | 5 ----- 11 files changed, 2 insertions(+), 46 deletions(-) diff --git a/openair1/PHY/TOOLS/signal_energy.c b/openair1/PHY/TOOLS/signal_energy.c index affee5dac4..b3289935b6 100644 --- a/openair1/PHY/TOOLS/signal_energy.c +++ b/openair1/PHY/TOOLS/signal_energy.c @@ -21,7 +21,6 @@ #include "tools_defs.h" #include "PHY/impl_defs_top.h" -#include "PHY/sse_intrin.h" // Compute Energy of a complex signal vector, removing the DC component! // input : points to vector diff --git a/openair1/SIMULATION/RF/dac.c b/openair1/SIMULATION/RF/dac.c index dc4c09827b..edde6e3baf 100644 --- a/openair1/SIMULATION/RF/dac.c +++ b/openair1/SIMULATION/RF/dac.c @@ -24,7 +24,6 @@ #include #include "PHY/TOOLS/tools_defs.h" #include "rf.h" -#include "common/utils/LOG/log.h" void dac(double *s_re[2], diff --git a/openair1/SIMULATION/TOOLS/channel_sim.c b/openair1/SIMULATION/TOOLS/channel_sim.c index 9d020a8c4d..9f196b02ec 100644 --- a/openair1/SIMULATION/TOOLS/channel_sim.c +++ b/openair1/SIMULATION/TOOLS/channel_sim.c @@ -21,21 +21,12 @@ #include #include -#include #include #include -#include #include "SIMULATION/TOOLS/sim.h" #include "SIMULATION/RF/rf.h" -#include "PHY/types.h" -#include "PHY/defs_eNB.h" -#include "PHY/phy_extern.h" #include "PHY/phy_extern_ue.h" - -#include "common/utils/LOG/log.h" -#include "PHY_INTERFACE/phy_interface_extern.h" -#include "UTIL/OPT/opt.h" // to test OPT #include "common/ran_context.h" #define RF diff --git a/openair1/SIMULATION/TOOLS/multipath_channel.c b/openair1/SIMULATION/TOOLS/multipath_channel.c index 41b756b54d..de616bf86c 100644 --- a/openair1/SIMULATION/TOOLS/multipath_channel.c +++ b/openair1/SIMULATION/TOOLS/multipath_channel.c @@ -19,13 +19,8 @@ * contact@openairinterface.org */ -#include -#include #include -#include -#include "nfapi_nr_interface_scf.h" #include "PHY/TOOLS/tools_defs.h" -#include "SIMULATION/RF/rf.h" #include "sim.h" //#define DEBUG_CH diff --git a/openair1/SIMULATION/TOOLS/multipath_tv_channel.c b/openair1/SIMULATION/TOOLS/multipath_tv_channel.c index a9967a6eaf..12175ea385 100644 --- a/openair1/SIMULATION/TOOLS/multipath_tv_channel.c +++ b/openair1/SIMULATION/TOOLS/multipath_tv_channel.c @@ -19,13 +19,10 @@ * contact@openairinterface.org */ -#include #include #include -#include -#include "sim.h" -#include "SIMULATION/RF/rf.h" #include +#include "sim.h" void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length); double frand_a_b(double a, double b); diff --git a/openair1/SIMULATION/TOOLS/phase_noise.c b/openair1/SIMULATION/TOOLS/phase_noise.c index 6cc24f23db..8c2b36dfec 100644 --- a/openair1/SIMULATION/TOOLS/phase_noise.c +++ b/openair1/SIMULATION/TOOLS/phase_noise.c @@ -19,11 +19,8 @@ * contact@openairinterface.org */ -#include -#include #include -#include -#include "sim.h" +#include "sim.h" static uint16_t LUTSin[ResolSinCos+1]; diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index 268d0166b1..4c715498a8 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -25,11 +25,9 @@ #include #include - #include "PHY/TOOLS/tools_defs.h" #include "sim.h" #include "scm_corrmat.h" -#include "common/utils/LOG/log.h" #include "common/config/config_userapi.h" #include "common/utils/telnetsrv/telnetsrv.h" #include "common/utils/load_module_shlib.h" diff --git a/openair1/SIMULATION/TOOLS/rangen_double.c b/openair1/SIMULATION/TOOLS/rangen_double.c index a1207f0d4d..54871448a4 100644 --- a/openair1/SIMULATION/TOOLS/rangen_double.c +++ b/openair1/SIMULATION/TOOLS/rangen_double.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "sim.h" diff --git a/openair1/SIMULATION/TOOLS/taus.c b/openair1/SIMULATION/TOOLS/taus.c index 5280cceafb..e68b8ecf93 100644 --- a/openair1/SIMULATION/TOOLS/taus.c +++ b/openair1/SIMULATION/TOOLS/taus.c @@ -19,10 +19,7 @@ * contact@openairinterface.org */ -#include #include -#include -#include #include "sim.h" diff --git a/radio/rfsimulator/apply_channelmod.c b/radio/rfsimulator/apply_channelmod.c index dc35a9bf73..91ad8b070d 100644 --- a/radio/rfsimulator/apply_channelmod.c +++ b/radio/rfsimulator/apply_channelmod.c @@ -22,20 +22,9 @@ */ -#include -#include -#include -#include -#include -#include #include - -#include #include -#include #include -#include -#include #include "rfsimulator.h" /* diff --git a/radio/rfsimulator/simulator.c b/radio/rfsimulator/simulator.c index 26feb13490..c5197eaab8 100644 --- a/radio/rfsimulator/simulator.c +++ b/radio/rfsimulator/simulator.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -39,16 +38,12 @@ #include #include #include -#include - #include #include #include #include #include #include "common_lib.h" -#include -#include "openair1/PHY/defs_UE.h" #define CHANNELMOD_DYNAMICLOAD #include #include "rfsimulator.h" From 65f14490c3678c1675e41ba2bd613de9d7c70047 Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Thu, 26 Sep 2024 15:07:35 +0200 Subject: [PATCH 33/87] Remove additional unnecessary includes --- common/config/config_common.c | 4 ---- common/utils/threadPool/thread-pool.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/common/config/config_common.c b/common/config/config_common.c index 45edcac6df..d6e499b6a8 100644 --- a/common/config/config_common.c +++ b/common/config/config_common.c @@ -24,11 +24,7 @@ #include #include #include -#include -#include -#include #include -#include "common/platform_types.h" #include "config_common.h" #include "../utils/LOG/log.h" static int managed_ptr_sz(configmodule_interface_t *cfg, void *ptr) diff --git a/common/utils/threadPool/thread-pool.c b/common/utils/threadPool/thread-pool.c index 64341501cb..5b22f2895d 100644 --- a/common/utils/threadPool/thread-pool.c +++ b/common/utils/threadPool/thread-pool.c @@ -23,14 +23,10 @@ #define _GNU_SOURCE -#include -#include #include #include #include -#include #include -#include #include From 87d28848dd960858fbb22d38ede23757b4c28b12 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 20 Sep 2024 18:16:47 +0200 Subject: [PATCH 34/87] Remove useless log: we see it in iperf call, and the XML --- ci-scripts/cls_oaicitest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 61f88bb557..fc429ee80b 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -475,7 +475,6 @@ class OaiCiTest(): jsonReport = "" # note: enable server report collection on the UE side, no need to store and collect server report separately on the server side serverReport = "--get-server-output" - logging.info(f'iperf options modified from "{self.iperf_args}" to "{iperf_opt}" for {ue.getName()}') iperf_time = Iperf_ComputeTime(self.iperf_args) # hack: the ADB UEs don't have iperf in $PATH, so we need to hardcode for the moment iperf_ue = '/data/local/tmp/iperf3' if re.search('adb', ue.getName()) else 'iperf3' From c5f090c23de3809efd36ec27c9dd4cf52c31587f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 20 Sep 2024 18:18:23 +0200 Subject: [PATCH 35/87] Remove useless rm log --- ci-scripts/cls_oaicitest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index fc429ee80b..c8981b8091 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -486,7 +486,7 @@ class OaiCiTest(): port = 5002 + idx # note: some core setups start an iperf3 server automatically, indicated in ci_infra by runIperf3Server: False` t = iperf_time * 2.5 - cmd_ue.run(f'rm /tmp/{client_filename}', reportNonZero=False) + cmd_ue.run(f'rm /tmp/{client_filename}', reportNonZero=False, silent=True) if runIperf3Server: cmd_svr.run(f'{svr.getCmdPrefix()} nohup timeout -vk3 {t} iperf3 -s -B {svrIP} -p {port} -1 {jsonReport} &', timeout=t) cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} {iperf_ue} -B {ueIP} -c {svrIP} -p {port} {iperf_opt} {jsonReport} {serverReport} -O 5 >> /tmp/{client_filename}', timeout=t) @@ -495,7 +495,7 @@ class OaiCiTest(): cmd_ue.copyin(f'/tmp/{client_filename}', f'{localPath}/{logPath}/{client_filename}') # note: copy iperf3 log to the current directory for log analysis and log collection cmd_ue.copyin(f'/tmp/{client_filename}', f'{localPath}/{client_filename}') - cmd_ue.run(f'rm /tmp/{client_filename}', reportNonZero=False) + cmd_ue.run(f'rm /tmp/{client_filename}', reportNonZero=False, silent=True) if udpIperf: status, msg = Iperf_analyzeV3UDP(client_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) elif bidirIperf: From 29383373de5cea5a277c87541f88c5c2a1cd3ef1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 20 Sep 2024 20:03:04 +0200 Subject: [PATCH 36/87] Remove unused code --- ci-scripts/cls_oaicitest.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index c8981b8091..2dbc24828d 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -37,13 +37,7 @@ import re # reg import pexpect # pexpect import time # sleep import os -import subprocess -import xml.etree.ElementTree as ET import logging -import datetime -import signal -import statistics as stat -from multiprocessing import SimpleQueue, Lock import concurrent.futures import json @@ -508,14 +502,7 @@ class OaiCiTest(): logging.info(f'\u001B[1;35m {l} \u001B[0m') return (status, f'{ue_header}\n{msg}') - def IperfNoS1(self,HTML,RAN,EPC,CONTAINERS): - raise 'IperfNoS1 not implemented' - def Iperf(self,HTML,RAN,EPC,CONTAINERS): - result = re.search('noS1', str(RAN.Initialize_eNB_args)) - if result is not None: - self.IperfNoS1(HTML,RAN,EPC,CONTAINERS) - return if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') From b9e56104d823ac8355aa7d7a4de18a682e47b3f2 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 20 Sep 2024 20:09:28 +0200 Subject: [PATCH 37/87] Remove unused CI code --- ci-scripts/cls_oai_html.py | 18 ++---------------- ci-scripts/cls_oaicitest.py | 9 --------- ci-scripts/main.py | 18 +----------------- 3 files changed, 3 insertions(+), 42 deletions(-) diff --git a/ci-scripts/cls_oai_html.py b/ci-scripts/cls_oai_html.py index 04971485a6..b927373124 100644 --- a/ci-scripts/cls_oai_html.py +++ b/ci-scripts/cls_oai_html.py @@ -65,10 +65,6 @@ class HTMLManagement(): self.htmlTabIcons = [] self.testXMLfiles = [] - self.testUnstable = False - self.testMinStableId = '999999' - self.testStabilityPointReached = False - self.htmleNBFailureMsg = '' self.htmlUEFailureMsg = '' @@ -219,20 +215,13 @@ class HTMLManagement(): def CreateHtmlTabFooter(self, passStatus): if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): - testOkEvenIfUnstable = False - if self.testUnstable and not passStatus: - if self.testStabilityPointReached or self.testMinStableId == '999999': - testOkEvenIfUnstable = True self.htmlFile = open('test_results.html', 'a') self.htmlFile.write(' \n') self.htmlFile.write(' Final Tab Status\n') if passStatus: self.htmlFile.write(' PASS \n') else: - if testOkEvenIfUnstable: - self.htmlFile.write(' KNOWN UNSTABLE SCENARIO \n') - else: - self.htmlFile.write(' FAIL \n') + self.htmlFile.write(' FAIL \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') @@ -242,10 +231,7 @@ class HTMLManagement(): cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__//' test_results.html" subprocess.run(cmd, shell=True) else: - if testOkEvenIfUnstable: - cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<\/span>/' test_results.html" - else: - cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<\/span>/' test_results.html" + cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<\/span>/' test_results.html" subprocess.run(cmd, shell=True) self.htmlFooterCreated = False diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 2dbc24828d..2c78779e24 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -235,9 +235,6 @@ class OaiCiTest(): self.FailReportCnt = 0 self.testCase_id = '' self.testXMLfiles = [] - self.testUnstable = False - self.testMinStableId = '999999' - self.testStabilityPointReached = False self.desc = '' self.ping_args = '' self.ping_packetloss_threshold = '' @@ -975,12 +972,6 @@ class OaiCiTest(): SSH.command(f'echo {self.UEPassword} | sudo -S rm ue*.log core* ue_*record.raw ue_*.pcap ue_*txt', '\$', 5) SSH.close() - def ConditionalExit(self): - if self.testUnstable: - if self.testStabilityPointReached or self.testMinStableId == '999999': - sys.exit(0) - sys.exit(1) - def ShowTestID(self): logging.info(f'\u001B[1m----------------------------------------\u001B[0m') logging.info(f'\u001B[1m Test ID: {self.testCase_id} \u001B[0m') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 0e54401b7b..ea3963fbca 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -596,14 +596,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re HTML.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-0')) HTML.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-0')) repeatCount = xmlRoot.findtext('repeatCount',default='1') - testStability = xmlRoot.findtext('TestUnstable',default='False') CiTestObj.repeatCounts.append(int(repeatCount)) - if testStability == 'True': - CiTestObj.testUnstable = True - HTML.testUnstable = True - CiTestObj.testMinStableId = xmlRoot.findtext('TestMinId',default='999999') - HTML.testMinStableId = CiTestObj.testMinStableId - logging.warning('Test is tagged as Unstable -- starting from TestID ' + str(CiTestObj.testMinStableId)) all_tests=xmlRoot.findall('testCase') exclusion_tests=exclusion_tests.split() @@ -829,20 +822,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re logging.error(f'while running CI, an exception occurred:\n{s}') HTML.CreateHtmlTestRowQueue("N/A", 'KO', [f"CI test code encountered an exception:\n{s}"]) RAN.prematureExit = True - - if RAN.prematureExit: - if CiTestObj.testCase_id == CiTestObj.testMinStableId: - logging.warning('Scenario has reached minimal stability point') - CiTestObj.testStabilityPointReached = True - HTML.testStabilityPointReached = True CiTestObj.FailReportCnt += 1 if CiTestObj.FailReportCnt == CiTestObj.repeatCounts[0] and RAN.prematureExit: logging.error('\u001B[1;37;41mScenario failed ' + str(CiTestObj.FailReportCnt) + ' time(s)\u001B[0m') HTML.CreateHtmlTabFooter(False) - if CiTestObj.testUnstable and (CiTestObj.testStabilityPointReached or CiTestObj.testMinStableId == '999999'): - logging.warning('\u001B[1;30;43mScenario has reached minimal stability point -- Not a Failure\u001B[0m') - else: - sys.exit('Failed Scenario') + sys.exit('Failed Scenario') else: logging.info('\u001B[1;37;42mScenario passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)\u001B[0m') HTML.CreateHtmlTabFooter(True) From de2bf7ad8b23340993768dc4bfa363603f9d0e8c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 11:12:44 +0200 Subject: [PATCH 38/87] Remove unused CI CaptureOnDockerNetworks() --- ci-scripts/cls_containerize.py | 48 ---------------------------------- 1 file changed, 48 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 03aed32929..d5fab887dd 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -290,27 +290,7 @@ def CheckLogs(self,mySSH,ymlPath,service_name,HTML,RAN): else: logging.info(f'Skipping to analyze log for service name {service_name}') return isFailed -# pyshark livecapture launches 2 processes: -# * One using dumpcap -i lIfs -w - (ie redirecting the packets to STDOUT) -# * One using tshark -i - -w loFile (ie capturing from STDIN from previous process) -# but in fact the packets are read by the following loop before being in fact -# really written to loFile. -# So it is mandatory to keep the loop -def LaunchPySharkCapture(lIfs, lFilter, loFile): - capture = pyshark.LiveCapture(interface=lIfs, bpf_filter=lFilter, output_file=loFile, debug=False) - for packet in capture.sniff_continuously(): - pass -def StopPySharkCapture(testcase): - with cls_cmd.LocalCmd() as myCmd: - cmd = 'killall tshark' - myCmd.run(cmd, reportNonZero=False) - cmd = 'killall dumpcap' - myCmd.run(cmd, reportNonZero=False) - time.sleep(5) - cmd = f'mv /tmp/capture_{testcase}.pcap ../cmake_targets/log/{testcase}/.' - myCmd.run(cmd, timeout=100, reportNonZero=False) - return False #----------------------------------------------------------- # Class Declaration #----------------------------------------------------------- @@ -1064,34 +1044,6 @@ class Containerize(): logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') if self.exitStatus == 0 else logging.error('\u001B[1m Undeploying OAI Object Failed\u001B[0m') mySSH.close() - def CaptureOnDockerNetworks(self): - myCmd = cls_cmd.LocalCmd(d = self.yamlPath[0]) - cmd = 'docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"' - networkNames = myCmd.run(cmd, silent=True) - myCmd.close() - # Allow only: control plane RAN (SCTP), HTTP of control in CN (port 80), PFCP traffic (port 8805), MySQL (port 3306) - capture_filter = 'sctp or port 80 or port 8805 or icmp or port 3306' - interfaces = [] - iInterfaces = '' - for name in networkNames.stdout.split('\n'): - if re.search('rfsim', name) is not None or re.search('l2sim', name) is not None: - interfaces.append(name) - iInterfaces += f'-i {name} ' - ymlPath = self.yamlPath[0].split('/') - output_file = f'/tmp/capture_{ymlPath[1]}.pcap' - self.tsharkStarted = True - # On old systems (ubuntu 18), pyshark live-capture is buggy. - # Going back to old method - if sys.version_info < (3, 7): - cmd = f'nohup tshark -f "{capture_filter}" {iInterfaces} -w {output_file} > /tmp/tshark.log 2>&1 &' - myCmd = cls_cmd.LocalCmd() - myCmd.run(cmd, timeout=5, reportNonZero=False) - myCmd.close() - return - x = threading.Thread(target = LaunchPySharkCapture, args = (interfaces,capture_filter,output_file,)) - x.daemon = True - x.start() - def StatsFromGenObject(self, HTML): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') From 28e30d24f73b509f983a75953444b7a3bc235dce Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 11:12:56 +0200 Subject: [PATCH 39/87] Remove unused CI StatsFromGenObject() --- ci-scripts/cls_containerize.py | 31 ------------------------------- ci-scripts/xml_class_list.yml | 1 - 2 files changed, 32 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index d5fab887dd..0f4ff7963f 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -1044,37 +1044,6 @@ class Containerize(): logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') if self.exitStatus == 0 else logging.error('\u001B[1m Undeploying OAI Object Failed\u001B[0m') mySSH.close() - def StatsFromGenObject(self, HTML): - self.exitStatus = 0 - ymlPath = self.yamlPath[0].split('/') - logPath = '../cmake_targets/log/' + ymlPath[1] - - # if the containers are running, recover the logs! - myCmd = cls_cmd.LocalCmd(d = self.yamlPath[0]) - cmd = 'docker-compose -f docker-compose-ci.yml ps --all' - deployStatus = myCmd.run(cmd, timeout=30) - cmd = 'docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}" ' - anyLogs = False - for state in deployStatus.stdout.split('\n'): - res = re.search('Name|NAME|----------', state) - if res is not None: - continue - if len(state) == 0: - continue - res = re.search('^(?P[a-zA-Z0-9\-\_]+) ', state) - if res is not None: - anyLogs = True - cmd += res.group('container_name') + ' ' - message = '' - if anyLogs: - stats = myCmd.run(cmd, timeout=30) - for statLine in stats.stdout.split('\n'): - logging.debug(statLine) - message += statLine + '\n' - myCmd.close() - - HTML.CreateHtmlTestRowQueue(self.pingOptions, 'OK', [message]) - def CheckAndAddRoute(self, svrName, ipAddr, userName, password): logging.debug('Checking IP routing on ' + svrName) mySSH = SSH.SSHConnection() diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index 34f63e8c2b..617be568cc 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -38,7 +38,6 @@ - Deploy_Run_PhySim - DeployGenObject - UndeployGenObject - - StatsFromGenObject - LicenceAndFormattingCheck - Push_Local_Registry - Pull_Local_Registry From 5a5063bddcb6cec0840b141ec6729509ee89cb33 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 2 Sep 2024 15:07:54 +0200 Subject: [PATCH 40/87] cleaner faster nr_pdcch_demapping_deinterleaving() inner loop --- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 29 +++++---------------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 15e02dcc5a..15bbc4e626 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -170,35 +170,16 @@ static void nr_pdcch_demapping_deinterleaving(c16_t *llr, } int rb_count = 0; - int data_sc = 9; // 9 sub-carriers with data per PRB + const int data_sc = 9; // 9 sub-carriers with data per PRB for (int c_id = 0; c_id < number_of_candidates; c_id++) { for (int symbol_idx = start_symbol; symbol_idx < start_symbol + coreset_time_dur; symbol_idx++) { for (int cce_count = 0; cce_count < L[c_id]; cce_count++) { for (int k = 0; k < NR_NB_REG_PER_CCE / reg_bundle_size_L; k++) { // loop over REG bundles int f = f_bundle_j_list_ord[c_id][k + NR_NB_REG_PER_CCE * cce_count / reg_bundle_size_L]; - for (int rb = 0; rb < B_rb; rb++) { // loop over the RBs of the bundle - c16_t *out = e_rx + data_sc * rb_count; - c16_t *in = llr + (uint16_t)(f * B_rb + rb + symbol_idx * coreset_nbr_rb) * data_sc; - for (int i = 0; i < data_sc; i++) { - out[i] = in[i]; -#ifdef NR_PDCCH_DCI_DEBUG - LOG_I(NR_PHY_DCI, - "[candidate=%d,symbol_idx=%d,cce=%d,REG bundle=%d,PRB=%d] z[%d]=(%d,%d) <-> \t llr[%d]=(%d,%d) \n", - c_id, - symbol_idx, - cce_count, - k, - f * B_rb + rb, - (index_z + i), - out->r, - out->i, - index_llr + i, - in.r, - in.i); -#endif - } - rb_count++; - } + c16_t *in = llr + (f * B_rb + symbol_idx * coreset_nbr_rb) * data_sc; + // loop over the RBs of the bundle + memcpy(e_rx + data_sc * rb_count, in, B_rb * data_sc * sizeof(*e_rx)); + rb_count += B_rb; } } } From 84719220284ee54c9cb73303362d6f9c58e3983c Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 12 Aug 2024 19:31:58 +0200 Subject: [PATCH 41/87] remove DRX from UE capabilities as we have not developped the feature --- targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports1.xml | 2 -- targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports2.xml | 2 -- targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports4.xml | 2 -- 3 files changed, 6 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports1.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports1.xml index b8e895aef5..e7d268580b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports1.xml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports1.xml @@ -24,8 +24,6 @@ - - diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports2.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports2.xml index d877d91dab..d85bef95d3 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports2.xml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports2.xml @@ -24,8 +24,6 @@ - - diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports4.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports4.xml index bd267f4302..1546cbf1f0 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports4.xml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports4.xml @@ -24,8 +24,6 @@ - - From 656a87bb8a5f5d13c5e1469d05bc14af6f7f5668 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 12:08:55 +0200 Subject: [PATCH 42/87] gNB: make sure not to write behind end of prach_pdu_indication_list in L1_nr_prach_procedures() --- openair1/SCHED_NR/nr_prach_procedures.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index dd77115817..426b25638d 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -151,7 +151,8 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) { max_preamble_delay[0], gNB->prach_energy_counter); - if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) { + if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0 + gNB->prach_thres) + && (pdu_index < MAX_NUM_NR_RX_RACH_PDUS)) { LOG_I(NR_PHY, "[RAPROC] %d.%d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol " "%u freq index %u\n", From 0ecf35de8495bca316a2da97c38aa5bb433ab842 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 12:11:00 +0200 Subject: [PATCH 43/87] gNB: print error message if PRACH resources are already occupied in schedule_nr_prach() --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 160cde63f5..50c71b3c08 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -435,8 +435,12 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP const int16_t n_ra_rb = get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, mu_pusch); index = ul_buffer_index(frameP, slotP, mu, gNB->vrb_map_UL_size); uint16_t *vrb_map_UL = &cc->vrb_map_UL[beam.idx][index * MAX_BWP_SIZE]; - for (int i = 0; i < n_ra_rb * fdm; ++i) + for (int i = 0; i < n_ra_rb * fdm; ++i) { + AssertFatal( + !(vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] & SL_to_bitmap(start_symbol, N_t_slot * N_dur)), + "PRACH resources are already occupied!\n"); vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] |= SL_to_bitmap(start_symbol, N_t_slot * N_dur); + } } } } From 64380eaca2add4f4b6b4d4af6211ed53267651f0 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 12:13:52 +0200 Subject: [PATCH 44/87] gNB: consider NTN_Koffset when scheduling PRACH --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ad18ead1f4..03119052f8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -274,7 +274,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_ slot, because otherwise we would allocate the current slot in UL_tti_req_ahead), but be aware that, e.g., K2 is allowed to be larger (schedule_nr_prach will assert if resources are not free). */ - const sub_frame_t n_slots_ahead = nr_slots_per_frame[*scc->ssbSubcarrierSpacing] - 1; + const sub_frame_t n_slots_ahead = nr_slots_per_frame[*scc->ssbSubcarrierSpacing] - 1 + get_NTN_Koffset(scc); const frame_t f = (frame + (slot + n_slots_ahead) / nr_slots_per_frame[*scc->ssbSubcarrierSpacing]) % 1024; const sub_frame_t s = (slot + n_slots_ahead) % nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; schedule_nr_prach(module_idP, f, s); From 791cc4f64803d22eb0352b376906c9724078485e Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 12:19:25 +0200 Subject: [PATCH 45/87] NR UE: set time sync PI controller integral weight to 0.0 by default Experiments did show that the time sync is less stable in terrestrial mode if the integral part of the PI controller is used. So set it to 0.0 by default. For NTN LEO use case we can still use it by providing the command line parameter --time-sync-I 0.2 . fixes #846 --- doc/RUNMODEM.md | 2 +- executables/nr-ue.c | 6 +++++- executables/nr-uesoftmodem.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 1bc6268199..fef128e2f7 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -298,7 +298,7 @@ Also, to perform an autonomous TA update based on the DL drift, the boolean para So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent LEO satellite 5G NR NTN is this: ``` cd cmake_targets -sudo ./ran_build/build/nr-uesoftmodem --band 66 -C 2152680000 --CO -400000000 -r 25 --numerology 0 --ssb 48 --sa --rfsim --rfsimulator.prop_delay 20 --rfsimulator.options chanmod -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/channelmod_rfsimu_LEO_satellite.conf --ntn-koffset 40 --ntn-ta-common 37.74 --ntn-ta-commondrift -50 --autonomous-ta +sudo ./ran_build/build/nr-uesoftmodem --band 66 -C 2152680000 --CO -400000000 -r 25 --numerology 0 --ssb 48 --sa --rfsim --rfsimulator.prop_delay 20 --rfsimulator.options chanmod -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/channelmod_rfsimu_LEO_satellite.conf --time-sync-I 0.2 --ntn-koffset 40 --ntn-ta-common 37.74 --ntn-ta-commondrift -50 --autonomous-ta ``` # Specific OAI modes diff --git a/executables/nr-ue.c b/executables/nr-ue.c index a742ea2e9d..d26547b14b 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -883,7 +883,11 @@ void *UE_thread(void *arg) stream_status = STREAM_STATUS_SYNCING; syncInFrame(UE, &sync_timestamp, intialSyncOffset); openair0_write_reorder_clear_context(&UE->rfdevice); - UE->max_pos_acc = get_nrUE_params()->ntn_ta_commondrift * 1e-6 * fp->samples_per_frame / get_nrUE_params()->time_sync_I; // ntn_ta_commondrift is in µs/s, max_pos_acc * time_sync_I is in samples/frame + if (get_nrUE_params()->time_sync_I) + // ntn_ta_commondrift is in µs/s, max_pos_acc * time_sync_I is in samples/frame + UE->max_pos_acc = get_nrUE_params()->ntn_ta_commondrift * 1e-6 * fp->samples_per_frame / get_nrUE_params()->time_sync_I; + else + UE->max_pos_acc = 0; shiftForNextFrame = -(UE->init_sync_frame + trashed_frames + 2) * UE->max_pos_acc * get_nrUE_params()->time_sync_I; // compensate for the time drift that happened during initial sync LOG_D(PHY, "max_pos_acc = %d, shiftForNextFrame = %d\n", UE->max_pos_acc, shiftForNextFrame); // TODO: remove this autonomous TA and use up-to-date values of ta-Common, ta-CommonDrift and ta-CommonDriftVariant from received SIB19 instead diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 797b5d8f49..65327cc3b2 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -65,7 +65,7 @@ {"SLC", CONFIG_HLP_SLF, 0, .u64ptr=&(sidelink_frequency[0][0]), .defuintval=2600000000,TYPE_UINT64,0}, \ {"num-ues", NULL, 0, .iptr=&(NB_UE_INST), .defuintval=1, TYPE_INT, 0}, \ {"time-sync-P", CONFIG_HLP_TIME_SYNC_P, 0, .dblptr=&(nrUE_params.time_sync_P), .defdblval=0.5, TYPE_DOUBLE, 0}, \ - {"time-sync-I", CONFIG_HLP_TIME_SYNC_I, 0, .dblptr=&(nrUE_params.time_sync_I), .defdblval=0.2, TYPE_DOUBLE, 0}, \ + {"time-sync-I", CONFIG_HLP_TIME_SYNC_I, 0, .dblptr=&(nrUE_params.time_sync_I), .defdblval=0.0, TYPE_DOUBLE, 0}, \ {"ntn-koffset", CONFIG_HLP_NTN_KOFFSET, 0, .uptr=&(nrUE_params.ntn_koffset), .defuintval=0, TYPE_UINT, 0}, \ {"ntn-ta-common", CONFIG_HLP_NTN_TA_COMMON, 0, .dblptr=&(nrUE_params.ntn_ta_common), .defdblval=0.0, TYPE_DOUBLE, 0}, \ {"ntn-ta-commondrift", CONFIG_HLP_NTN_TA_COMMONDRIFT, 0, .dblptr=&(nrUE_params.ntn_ta_commondrift), .defdblval=0.0, TYPE_DOUBLE, 0}, \ From b0eedd3bbd28c5f7b9177b36f1327456fb39c773 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 12:26:01 +0200 Subject: [PATCH 46/87] gNB: fix a comment - current TA interval is 100 frames, not 10 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 334c263501..7a93586378 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -980,7 +980,7 @@ void nr_schedule_ue_spec(module_id_t module_id, UE->mac_stats.dl.current_bytes = 0; UE->mac_stats.dl.current_rbs = 0; - /* update TA and set ta_apply every 10 frames. + /* update TA and set ta_apply every 100 frames. * Possible improvement: take the periodicity from input file. * If such UE is not scheduled now, it will be by the preprocessor later. * If we add the CE, ta_apply will be reset */ From d9940b1bc430c1f653b8f75f0c80cdf3de965835 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 12:28:02 +0200 Subject: [PATCH 47/87] NR UE: fix logical error in nr_ue_process_dci_dl_10() Fixing this avoids the theoretical possibility of dereferencing a NULL pointer. --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index ccfa861587..28f485312a 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -685,7 +685,7 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac, dlsch_pdu->pduBitmap = 0; NR_UE_DL_BWP_t *current_DL_BWP = mac->current_DL_BWP; - NR_PDSCH_Config_t *pdsch_config = (current_DL_BWP || !mac->get_sib1) ? current_DL_BWP->pdsch_Config : NULL; + NR_PDSCH_Config_t *pdsch_config = (current_DL_BWP && !mac->get_sib1) ? current_DL_BWP->pdsch_Config : NULL; if (dci_ind->ss_type == NR_SearchSpace__searchSpaceType_PR_common) { dlsch_pdu->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs ? mac->type0_PDCCH_CSS_config.num_rbs : mac->sc_info.initial_dl_BWPSize; From 60ca088e51318bc5a248d1d292324fb048a824b9 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 14:35:17 +0200 Subject: [PATCH 48/87] gNB: respect config value dl_max_mcs also in case of harq_round_max == 1 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 7a93586378..d6829c1ba2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -684,7 +684,7 @@ static void pf_dl(module_id_t module_id, const int max_mcs_table = current_BWP->mcsTableIdx == 1 ? 27 : 28; const int max_mcs = min(sched_ctrl->dl_max_mcs, max_mcs_table); if (bo->harq_round_max == 1) - sched_pdsch->mcs = max_mcs; + sched_pdsch->mcs = min(bo->max_mcs, max_mcs); else sched_pdsch->mcs = get_mcs_from_bler(bo, stats, &sched_ctrl->dl_bler_stats, max_mcs, frame); sched_pdsch->nrOfLayers = get_dl_nrOfLayers(sched_ctrl, current_BWP->dci_format); From 9f8a2573ee14a5897f04426396ded49c6090b767 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 14:38:28 +0200 Subject: [PATCH 49/87] gNB: update DL and UL bler_stats.mcs for logging also in case of harq_round_max == 1 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 +++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d6829c1ba2..96e0e54827 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -683,9 +683,10 @@ static void pf_dl(module_id_t module_id, const NR_bler_options_t *bo = &mac->dl_bler; const int max_mcs_table = current_BWP->mcsTableIdx == 1 ? 27 : 28; const int max_mcs = min(sched_ctrl->dl_max_mcs, max_mcs_table); - if (bo->harq_round_max == 1) + if (bo->harq_round_max == 1) { sched_pdsch->mcs = min(bo->max_mcs, max_mcs); - else + sched_ctrl->dl_bler_stats.mcs = sched_pdsch->mcs; + } else sched_pdsch->mcs = get_mcs_from_bler(bo, stats, &sched_ctrl->dl_bler_stats, max_mcs, frame); sched_pdsch->nrOfLayers = get_dl_nrOfLayers(sched_ctrl, current_BWP->dci_format); sched_pdsch->pm_index = diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index d091d486ff..596c293ebd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1848,9 +1848,10 @@ static void pf_ul(module_id_t module_id, const NR_bler_options_t *bo = &nrmac->ul_bler; const int max_mcs_table = (current_BWP->mcs_table == 0 || current_BWP->mcs_table == 2) ? 28 : 27; const int max_mcs = min(bo->max_mcs, max_mcs_table); /* no per-user maximum MCS yet */ - if (bo->harq_round_max == 1) + if (bo->harq_round_max == 1) { sched_pusch->mcs = max_mcs; - else { + sched_ctrl->ul_bler_stats.mcs = sched_pusch->mcs; + } else { sched_pusch->mcs = get_mcs_from_bler(bo, stats, &sched_ctrl->ul_bler_stats, max_mcs, frame); LOG_D(NR_MAC,"%d.%d starting mcs %d bleri %f\n",frame,slot,sched_pusch->mcs,sched_ctrl->ul_bler_stats.bler); } From 60c2b3fe00b12880209d3d26db2df40c6f1c63f7 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 27 Sep 2024 14:58:18 +0200 Subject: [PATCH 50/87] nrscope: fix label on gNB scope - it is NR not LTE ;-) --- openair1/PHY/TOOLS/nr_phy_scope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index c6a9b796c0..a661fb892b 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -686,7 +686,7 @@ STATICFORXSCOPE OAI_phy_scope_t *create_phy_scope_gnb(void) fl_end_form( ); if (fdui->phy_scope) fdui->phy_scope->fdui = fdui; - fl_show_form (fdui->phy_scope, FL_PLACE_HOTSPOT, FL_FULLBORDER, "LTE UL SCOPE gNB"); + fl_show_form (fdui->phy_scope, FL_PLACE_HOTSPOT, FL_FULLBORDER, "NR UL SCOPE gNB"); return fdui; } From cded721189403bf45410ee6c1e5e5488f9886bd2 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 25 Sep 2024 15:42:00 +0200 Subject: [PATCH 51/87] Remove unused CI XML and Python code --- ci-scripts/main.py | 15 ------- ci-scripts/ran.py | 35 ---------------- ci-scripts/xml_class_list.yml | 1 - ci-scripts/xml_files/fr1_enb_build.xml | 58 -------------------------- 4 files changed, 109 deletions(-) delete mode 100644 ci-scripts/xml_files/fr1_enb_build.xml diff --git a/ci-scripts/main.py b/ci-scripts/main.py index ea3963fbca..017e9b6f37 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -140,19 +140,6 @@ def GetParametersFromXML(action): if proxy_commit is not None: CONTAINERS.proxyCommit = proxy_commit - elif action == 'WaitEndBuild_eNB': - RAN.Build_eNB_args=test.findtext('Build_eNB_args') - eNB_instance=test.findtext('eNB_instance') - if (eNB_instance is None): - RAN.eNB_instance=0 - else: - RAN.eNB_instance=int(eNB_instance) - eNB_serverId=test.findtext('eNB_serverId') - if (eNB_serverId is None): - RAN.eNB_serverId[RAN.eNB_instance]='0' - else: - RAN.eNB_serverId[RAN.eNB_instance]=eNB_serverId - elif action == 'Initialize_eNB': RAN.eNB_Trace=test.findtext('eNB_Trace') RAN.eNB_Stats=test.findtext('eNB_Stats') @@ -689,8 +676,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re try: if action == 'Build_eNB': RAN.BuildeNB(HTML) - elif action == 'WaitEndBuild_eNB': - RAN.WaitBuildeNBisFinished(HTML) elif action == 'Custom_Command': RAN.CustomCommand(HTML) if RAN.prematureExit: diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index ad1b2bc5e4..56424c4f25 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -224,41 +224,6 @@ class RANManagement(): mySSH.close() self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id, HTML) - def WaitBuildeNBisFinished(self, HTML): - if self.eNB_serverId[self.eNB_instance] == '0': - lIpAddr = self.eNBIPAddress - lUserName = self.eNBUserName - lPassWord = self.eNBPassword - lSourcePath = self.eNBSourceCodePath - elif self.eNB_serverId[self.eNB_instance] == '1': - lIpAddr = self.eNB1IPAddress - lUserName = self.eNB1UserName - lPassWord = self.eNB1Password - lSourcePath = self.eNB1SourceCodePath - elif self.eNB_serverId[self.eNB_instance] == '2': - lIpAddr = self.eNB2IPAddress - lUserName = self.eNB2UserName - lPassWord = self.eNB2Password - lSourcePath = self.eNB2SourceCodePath - if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - logging.debug('Waiting for end of build on server: ' + lIpAddr) - mySSH = SSH.SSHConnection() - mySSH.open(lIpAddr, lUserName, lPassWord) - count = 40 - buildOAIprocess = True - while (count > 0) and buildOAIprocess: - mySSH.command('ps aux | grep --color=never build_ | grep -v grep', '\$', 6) - result = re.search('build_oai', mySSH.getBefore()) - if result is None: - buildOAIprocess = False - else: - count -= 1 - time.sleep(30) - mySSH.close() - self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.backgroundBuildTestId[int(self.eNB_instance)], HTML) - def CustomCommand(self, HTML): logging.info(f"Executing custom command on {self.node}") cmd = cls_cmd.getConnection(self.node) diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index 617be568cc..deba963bc6 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -6,7 +6,6 @@ - Run_T2Test - Run_NRulsimTest - Build_eNB - - WaitEndBuild_eNB - Initialize_eNB - Terminate_eNB - Initialize_UE diff --git a/ci-scripts/xml_files/fr1_enb_build.xml b/ci-scripts/xml_files/fr1_enb_build.xml deleted file mode 100644 index 6ea1ccfd29..0000000000 --- a/ci-scripts/xml_files/fr1_enb_build.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - build-tab - Build - wrench - - 100000 - 000001 - 000002 - - - - - Build_eNB - Build eNB - -w USRP -c --eNB --ninja - 0 - 0 - True - True - - - - WaitEndBuild_eNB - Wait for end of Build eNB - 0 - 0 - - - - Custom_Command - To reboot USRP - obelix - ssh root@172.21.19.13 reboot ; sleep 45 - - - From 6f868b038f03ed77de9c512bcdd87a1c6ef0893b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 26 Sep 2024 19:39:22 +0200 Subject: [PATCH 52/87] Remove more unused CI files --- ci-scripts/cls_containerize.py | 2 - ci-scripts/cots_ue_ctl.yaml | 20 ---- ci-scripts/flatten_image.py | 116 ----------------------- ci-scripts/py_params.yaml | 48 ---------- ci-scripts/py_params_template.yaml | 90 ------------------ ci-scripts/ran_dashboard/Hdashboard.py | 126 ------------------------- ci-scripts/template-host.xml | 27 ------ 7 files changed, 429 deletions(-) delete mode 100644 ci-scripts/cots_ue_ctl.yaml delete mode 100644 ci-scripts/flatten_image.py delete mode 100644 ci-scripts/py_params.yaml delete mode 100644 ci-scripts/py_params_template.yaml delete mode 100644 ci-scripts/ran_dashboard/Hdashboard.py delete mode 100644 ci-scripts/template-host.xml diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 0f4ff7963f..9e94d653bc 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -644,8 +644,6 @@ class Containerize(): buildProxy = mySSH.getBefore().count('o such image') != 0 if buildProxy: mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target oai-lte-multi-ue-proxy --tag proxy:' + tag + ' --file docker/Dockerfile.ubuntu18.04 . > cmake_targets/log/proxy-build.log 2>&1', '\$', 180) - # Note: at this point, OAI images are flattened, but we cannot do this - # here, as the flatten script is not in the proxy repo mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' proxy:' + tag, '\$', 5) mySSH.command(self.cli + ' image prune --force || true','\$', 15) if mySSH.getBefore().count('o such image') != 0: diff --git a/ci-scripts/cots_ue_ctl.yaml b/ci-scripts/cots_ue_ctl.yaml deleted file mode 100644 index c22fca246b..0000000000 --- a/ci-scripts/cots_ue_ctl.yaml +++ /dev/null @@ -1,20 +0,0 @@ -9d690a12: #oppo - - adb shell input keyevent KEYCODE_POWER - - adb shell input swipe 300 700 300 0 - - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS - - adb shell input keyevent 20 - - adb shell input tap 968 324 -002: #s10 - - adb shell input keyevent KEYCODE_POWER - - adb shell input swipe 200 900 200 300 - - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS - - adb shell input tap 968 324 -003: #s20 - - adb shell input keyevent KEYCODE_POWER - - adb shell input swipe 200 900 200 300 - - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS - - adb shell input tap 968 324 -004: #xperia - - tbd - - tbd - - tbd diff --git a/ci-scripts/flatten_image.py b/ci-scripts/flatten_image.py deleted file mode 100644 index 55ac8ff0da..0000000000 --- a/ci-scripts/flatten_image.py +++ /dev/null @@ -1,116 +0,0 @@ -""" - Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The OpenAirInterface Software Alliance licenses this file to You under - the OAI Public License, Version 1.1 (the "License"); you may not use this file - except in compliance with the License. - You may obtain a copy of the License at - - http://www.openairinterface.org/?page_id=698 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -------------------------------------------------------------------------------- - For more information about the OpenAirInterface (OAI) Software Alliance: - contact@openairinterface.org -""" - -import argparse -import re -import subprocess -import sys - -def main() -> None: - args = _parse_args() - status = perform_flattening(args.tag) - sys.exit(status) - -def _parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser(description='Flattening Image') - - parser.add_argument( - '--tag', '-t', - action='store', - required=True, - help='Image Tag in image-name:image tag format', - ) - return parser.parse_args() - -def perform_flattening(tag): - # First detect which docker/podman command to use - cli = '' - image_prefix = '' - cmd = 'which podman || true' - podman_check = subprocess.check_output(cmd, shell=True, universal_newlines=True) - if re.search('podman', podman_check.strip()): - cli = 'sudo podman' - image_prefix = 'localhost/' - if cli == '': - cmd = 'which docker || true' - docker_check = subprocess.check_output(cmd, shell=True, universal_newlines=True) - if re.search('docker', docker_check.strip()): - cli = 'docker' - image_prefix = '' - if cli == '': - print ('No docker / podman installed: quitting') - return -1 - print (f'Flattening {tag}') - - # Creating a container - cmd = cli + ' run --name test-flatten --entrypoint /bin/true -d ' + tag - print (cmd) - subprocess.check_output(cmd, shell=True, universal_newlines=True) - - # Export / Import trick - cmd = cli + ' export test-flatten | ' + cli + ' import ' - # Bizarro syntax issue with podman - if cli == 'docker': - cmd += ' --change "ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ' - else: - cmd += ' --change "ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ' - if re.search('oai-enb', tag): - cmd += ' --change "WORKDIR /opt/oai-enb" ' - cmd += ' --change "EXPOSE 2152/udp" ' - cmd += ' --change "EXPOSE 36412/udp" ' - cmd += ' --change "EXPOSE 36422/udp" ' - cmd += ' --change "CMD [\\"/opt/oai-enb/bin/lte-softmodem\\", \\"-O\\", \\"/opt/oai-enb/etc/enb.conf\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-enb/bin/entrypoint.sh\\"]" ' - if re.search('oai-gnb', tag): - cmd += ' --change "WORKDIR /opt/oai-gnb" ' - cmd += ' --change "EXPOSE 2152/udp" ' - cmd += ' --change "EXPOSE 36422/udp" ' - cmd += ' --change "CMD [\\"/opt/oai-gnb/bin/nr-softmodem\\", \\"-O\\", \\"/opt/oai-gnb/etc/gnb.conf\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-gnb/bin/entrypoint.sh\\"]" ' - if re.search('oai-lte-ue', tag): - cmd += ' --change "WORKDIR /opt/oai-lte-ue" ' - cmd += ' --change "CMD [\\"/opt/oai-lte-ue/bin/lte-uesoftmodem\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-lte-ue/bin/entrypoint.sh\\"]" ' - if re.search('oai-nr-ue', tag): - cmd += ' --change "WORKDIR /opt/oai-nr-ue" ' - cmd += ' --change "CMD [\\"/opt/oai-nr-ue/bin/nr-uesoftmodem\\", \\"-O\\", \\"/opt/oai-nr-ue/etc/nr-ue.conf\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-nr-ue/bin/entrypoint.sh\\"]" ' - if re.search('oai-lte-ru', tag): - cmd += ' --change "WORKDIR /opt/oai-lte-ru" ' - cmd += ' --change "CMD [\\"/opt/oai-lte-ru/bin/oairu\\", \\"-O\\", \\"/opt/oai-lte-ru/etc/rru.conf\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-lte-ru/bin/entrypoint.sh\\"]" ' - if re.search('oai-physim', tag): - cmd += ' --change "WORKDIR /opt/oai-physim" ' - cmd += ' - ' + image_prefix + tag - print (cmd) - subprocess.check_output(cmd, shell=True, universal_newlines=True) - - # Remove container - cmd = cli + ' rm -f test-flatten' - print (cmd) - subprocess.check_output(cmd, shell=True, universal_newlines=True) - - # At this point the original image is a dangling image. - # CI pipeline will clean up (`image prune --force`) - return 0 - -if __name__ == '__main__': - main() diff --git a/ci-scripts/py_params.yaml b/ci-scripts/py_params.yaml deleted file mode 100644 index 0c1d660ee8..0000000000 --- a/ci-scripts/py_params.yaml +++ /dev/null @@ -1,48 +0,0 @@ -eNBRepository : b -ranRepository : c -eNB_AllowMerge : -ranAllowMerge : -eNBBranch : f -ranBranch : g -eNBCommitID : -ranCommitID : i -eNBTargetBranch : j -ranTargetBranch : k - -nodes : - - type : eNB - IPAddress : 001.1.1 - UserName : toto - Password : qwe - SourceCodePath : l - - type : gNB - IPAddress : 002.2.2 - UserName : tata - Password : asd - SourceCodePath : m - - type : eNB - IPAddress : 003.3.3 - UserName : titi - Password : zxc - SourceCodePath : n - - type : gNB - IPAddress : 004.4.4 - UserName : caca - Password : pepe - SourceCodePath : o - -EPCIPAddress : p -EPCUserName : q -EPCPassword : r -EPCSourceCodePath : s -EPCType : t -EPCContainerPrefix : u - -XMLTestFile : z - -UEIPAddress : qqq -UEUserName : www -UEPassword : eee -UESourceCodePath : yyy - -finalStatus : bbb \ No newline at end of file diff --git a/ci-scripts/py_params_template.yaml b/ci-scripts/py_params_template.yaml deleted file mode 100644 index b6ef9c6892..0000000000 --- a/ci-scripts/py_params_template.yaml +++ /dev/null @@ -1,90 +0,0 @@ -eNBRepository : b -ranRepository : c -eNB_AllowMerge : -ranAllowMerge : -eNBBranch : f -ranBranch : g -eNBCommitID : -ranCommitID : i -eNBTargetBranch : j -ranTargetBranch : k - - -RAN: - RAN_inst_0: - name : RAN_1 - nodes : - - type : eNB - IPAddress : 001.1.1 - UserName : toto - Password : qwe - SourceCodePath : l - - type : gNB - IPAddress : 002.2.2 - UserName : tata - Password : asd - SourceCodePath : m - - type : eNB - IPAddress : 003.3.3 - UserName : titi - Password : zxc - SourceCodePath : n - - type : gNB - IPAddress : 004.4.4 - UserName : caca - Password : pepe - SourceCodePath : o - RAN_inst_1: - name : RAN_2 - nodes : - - type : eNB - IPAddress : 101.1.1 - UserName : toto - Password : qwe - SourceCodePath : l - - type : gNB - IPAddress : 102.2.2 - UserName : zaza - Password : asd - SourceCodePath : m - - type : eNB - IPAddress : 103.3.3 - UserName : zizi - Password : zxc - SourceCodePath : n - - type : gNB - IPAddress : 104.4.4 - UserName : aaaa - Password : pepe - SourceCodePath : o - - - -EPC: - EPC_inst_0: - EPCIPAddress : p - EPCUserName : q - EPCPassword : r - EPCSourceCodePath : s - EPCType : t - EPCContainerPrefix : u - -UE: - UE_inst_0: - name : UE_1 - type : - UEIPAddress : qqq - UEUserName : www - UEPassword : eee - UESourceCodePath : yyy - UE_inst_1: - name : UE_2 - type : - UEIPAddress : bloblob - UEUserName : gwou - UEPassword : zebu - UESourceCodePath : pop - - -XMLTestFile : z -finalStatus : bbb \ No newline at end of file diff --git a/ci-scripts/ran_dashboard/Hdashboard.py b/ci-scripts/ran_dashboard/Hdashboard.py deleted file mode 100644 index 625baa8f46..0000000000 --- a/ci-scripts/ran_dashboard/Hdashboard.py +++ /dev/null @@ -1,126 +0,0 @@ -#/* -# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# * contributor license agreements. See the NOTICE file distributed with -# * this work for additional information regarding copyright ownership. -# * The OpenAirInterface Software Alliance licenses this file to You under -# * the OAI Public License, Version 1.1 (the "License"); you may not use this file -# * except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.openairinterface.org/?page_id=698 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# *------------------------------------------------------------------------------- -# * For more information about the OpenAirInterface (OAI) Software Alliance: -# * contact@openairinterface.org -# */ -#--------------------------------------------------------------------- -# Merge Requests Dashboard for RAN on googleSheet -# -# Required Python Version -# Python 3.x -# -#--------------------------------------------------------------------- - -#----------------------------------------------------------- -# Import -#----------------------------------------------------------- - - -#Author Remi -import shlex -import subprocess -import json #json structures -import gitlab -import sys - -#----------------------------------------------------------- -# Class Declaration -#----------------------------------------------------------- - -class Dashboard: - def __init__(self): - #init with data sources : git, test results databases - print("Collecting Data") - cmd="""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """ - self.git = self.__getGitData(cmd) #git data from Gitlab - self.mr_list=[] #mr list in string format - for x in range(len(self.git)): - self.mr_list.append(str(self.git[x]['iid'])) - - def __getGitData(self,cmd): - process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) - output = process.stdout.readline() - tmp=output.decode("utf-8") - d = json.loads(tmp) - return d - - def PostGitNote(self,mr,commit,args): - if len(args)%4 != 0: - print("Wrong Number of Arguments") - return - else : - n_tests=len(args)//4 - - gl = gitlab.Gitlab.from_config('OAI') - project_id = 223 - project = gl.projects.get(project_id) - - #retrieve all the notes from the MR - editable_mr = project.mergerequests.get(int(mr)) - mr_notes = editable_mr.notes.list(all=True) - - body = '[Consolidated Test Results]\\\n' - body += 'Tested CommitID: ' + commit - - for i in range(0,n_tests): - jobname = args[4*i] - buildurl = args[4*i+1] - buildid = args[4*i+2] - status = args[4*i+3] - body += '\\\n' + jobname + ': **'+status+'** ([' + buildid + '](' + buildurl + '))' - - #create new note - mr_note = editable_mr.notes.create({ - 'body': body - }) - editable_mr.save() - - -def main(): - #call from master Jenkinsfile : sh "python3 Hdashboard.py gitpost ${GitPostArgs}" - if len(sys.argv) > 1: - - #individual MR test results + test dashboard, event based (end of slave jenkins pipeline) - if sys.argv[1] != "gitpost": - print("error: only gitpost subcommand is supported") - exit(1) - - elif sys.argv[1]=="gitpost": - mr=sys.argv[2] - commit=sys.argv[3] - args=[] - for i in range (4, len(sys.argv)): #jobname, url, id , result - args.append(sys.argv[i]) - htmlDash=Dashboard() - if mr in htmlDash.mr_list: - htmlDash.PostGitNote(mr,commit, args) - else: - print("Not a Merge Request => this build is for testing/debug purpose, no report to git") - else: - print("Wrong argument at position 1") - exit(1) - - - #test and MR status dashboards, cron based - else: - print("error: only gitpost subcommand is supported") - exit(1) - -if __name__ == "__main__": - # execute only if run as a script - main() diff --git a/ci-scripts/template-host.xml b/ci-scripts/template-host.xml deleted file mode 100644 index efd9912c7a..0000000000 --- a/ci-scripts/template-host.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - hvm - - - - - - - - - - - - - - - - - - - - - - - From 7c1920aea9396b737a83e21b9ac841284b3985a5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 25 Sep 2024 17:03:50 +0200 Subject: [PATCH 53/87] Fixup: no HTML in create_workspace, so can't print to HTML --- ci-scripts/cls_containerize.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 9e94d653bc..ee2845a928 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -85,7 +85,6 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge sshSession.command('git log --oneline | head -n5', '\$', 5) logging.error(f'problems during checkout, is at: {sshSession.getBefore()}') self.exitStatus = 1 - HTML.CreateHtmlTestRowQueue('N/A', 'KO', "could not checkout correctly") else: logging.debug('successful checkout') # if the branch is not develop, then it is a merge request and we need to do From 1620994f0ae13ef197b919f5db12f9b0468c7fc3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 08:59:53 +0200 Subject: [PATCH 54/87] DeployObject: EPC not needed --- ci-scripts/cls_containerize.py | 2 +- ci-scripts/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index ee2845a928..891e599cca 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -978,7 +978,7 @@ class Containerize(): CreateWorkspace(sshSession, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) - def DeployObject(self, HTML, EPC): + def DeployObject(self, HTML): lIpAddr, lUserName, lPassWord, lSourcePath = GetCredentials(self) if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': HELP.GenericHelp(CONST.Version) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 017e9b6f37..043580f775 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -777,7 +777,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re elif action == 'Create_Workspace': CONTAINERS.Create_Workspace(HTML) elif action == 'Deploy_Object': - CONTAINERS.DeployObject(HTML, EPC) + CONTAINERS.DeployObject(HTML) if CONTAINERS.exitStatus==1: CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) RAN.prematureExit = True From 4bf7c45be1f8848bbb945df43e857cb9a24182b7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Sep 2024 16:36:00 +0200 Subject: [PATCH 55/87] SSHConnection class: don't exit, raise Exception to have main loop handle --- ci-scripts/sshconnection.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py index 65a0a0bd67..a41b8bf7f1 100644 --- a/ci-scripts/sshconnection.py +++ b/ci-scripts/sshconnection.py @@ -100,7 +100,7 @@ class SSHConnection(): if connect_status: self.command('unset HISTFILE', prompt, 5, silent=True) else: - sys.exit('SSH Connection Failed') + raise ConnectionError('SSH Connection Failed') self.ipaddress = ipaddress self.username = username @@ -136,20 +136,20 @@ class SSHConnection(): logging.error('\u001B[1;37;41m Unexpected EOF \u001B[0m') logging.error('Expected Line : ' + expectedline) logging.error(str(self.ssh.before)) - sys.exit(self.sshresponse) + raise ConnectionError(self.sshresponse) elif self.sshresponse == 2: logging.error('\u001B[1;37;41m Unexpected TIMEOUT \u001B[0m') logging.error('Expected Line : ' + expectedline) result = re.search('ping |iperf |picocom', str(commandline)) if result is None: logging.warning(str(self.ssh.before)) - sys.exit(self.sshresponse) + raise ConnectionError(self.sshresponse) else: return -1 else: logging.error('\u001B[1;37;41m Unexpected Others \u001B[0m') logging.error('Expected Line : ' + expectedline) - sys.exit(self.sshresponse) + raise ConnectionError(self.sshresponse) def command2(self, commandline, timeout, silent=False): if not silent: @@ -275,7 +275,7 @@ class SSHConnection(): if copy_status: pass else: - sys.exit('SCP failed') + raise ConnectionError('SCP failed') def getBefore(self): return self.ssh.before.decode('utf-8') From 25f7f61d73a47add63145dfedb7e7b969634fe36 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 09:14:10 +0200 Subject: [PATCH 56/87] Simplify GetContainerHealth(): we never use unhealthy count --- ci-scripts/cls_containerize.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 891e599cca..dfc0769fc7 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -200,24 +200,18 @@ def GetImageInfo(mySSH, containerName): def GetContainerHealth(mySSH, containerName): if containerName is None: - return 0, 0 - unhealthyNb = 0 - healthyNb = 0 + return False time.sleep(5) for _ in range(3): if containerName != 'db_init': result = mySSH.run(f'docker inspect --format="{{{{.State.Health.Status}}}}" {containerName}') - unhealthyNb = result.stdout.count('unhealthy') - healthyNb = result.stdout.count('healthy') - unhealthyNb - if healthyNb == 1: - break + if result.stdout == 'healthy': + return True else: time.sleep(10) else: - unhealthyNb = 0 - healthyNb = 1 - break - return healthyNb, unhealthyNb + return True + return False def ReTagImages(mySSH,IMAGES,ranCommitID,ranBranch,ranAllowMerge,displayedNewTags): mySSH.run('cp docker-compose.y*ml ci-docker-compose.yml', 5) @@ -1000,10 +994,10 @@ class Containerize(): imagesInfo="" for svcName in services_list: containerName = GetContainerName(mySSH, svcName) - healthyNb,unhealthyNb = GetContainerHealth(mySSH,containerName) + healthy = GetContainerHealth(mySSH,containerName) self.testCase_id = HTML.testCase_id self.eNB_logFile[self.eNB_instance] = f'{svcName}-{self.testCase_id}.log' - if unhealthyNb: + if not healthy: logging.warning(f"Deployment Failed: Trying to copy container logs {self.eNB_logFile[self.eNB_instance]}") CopyinContainerLog(mySSH,lSourcePath,self.yamlPath[0].split('/'),containerName,self.eNB_logFile[self.eNB_instance]) status = False From 02d5f953a8d5e6a52efa1cfca15ed06e972768a3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 09:16:32 +0200 Subject: [PATCH 57/87] Add simple unit test cases for Deployment, including instructions --- ci-scripts/tests/README.md | 11 +++++ ci-scripts/tests/deployment.py | 47 +++++++++++++++++++ .../tests/simple-dep/docker-compose.yml | 12 +++++ .../tests/simple-fail/docker-compose.yml | 12 +++++ 4 files changed, 82 insertions(+) create mode 100644 ci-scripts/tests/README.md create mode 100644 ci-scripts/tests/deployment.py create mode 100644 ci-scripts/tests/simple-dep/docker-compose.yml create mode 100644 ci-scripts/tests/simple-fail/docker-compose.yml diff --git a/ci-scripts/tests/README.md b/ci-scripts/tests/README.md new file mode 100644 index 0000000000..685a19d0cc --- /dev/null +++ b/ci-scripts/tests/README.md @@ -0,0 +1,11 @@ +In this directory and subdirectories are various CI code test cases and helper +scripts. + +# Unit test + +There are some unit tests. From the parent directory, i.e., `ci-scripts/`, +start with + + python tests/deployment.py -v + +It will indicate if all tests passed. diff --git a/ci-scripts/tests/deployment.py b/ci-scripts/tests/deployment.py new file mode 100644 index 0000000000..e4176ec79d --- /dev/null +++ b/ci-scripts/tests/deployment.py @@ -0,0 +1,47 @@ +import sys +import logging +logging.basicConfig( + level=logging.DEBUG, + stream=sys.stdout, + format="[%(asctime)s] %(levelname)8s: %(message)s" +) +import os +os.system(f'rm -rf cmake_targets') +os.system(f'mkdir -p cmake_targets/log') +import unittest + +sys.path.append('./') # to find OAI imports below +import cls_oai_html +import cls_oaicitest +import cls_containerize +import ran + +class TestDeploymentMethods(unittest.TestCase): + def setUp(self): + self.html = cls_oai_html.HTMLManagement() + self.html.testCaseId = "000000" + self.ci = cls_oaicitest.OaiCiTest() + self.cont = cls_containerize.Containerize() + self.ran = ran.RANManagement() + self.cont.yamlPath[0] = 'tests/simple-dep/' + self.cont.eNB_serverId[0] = '0' + self.cont.eNBIPAddress = 'localhost' + self.cont.eNBUserName = None + self.cont.eNBPassword = None + self.cont.eNBSourceCodePath = os.getcwd() + + def test_deploy(self): + self.cont.DeployObject(self.html) + self.assertEqual(self.cont.exitStatus, 0) + self.cont.UndeployObject(self.html, self.ran) + + def test_deployfails(self): + old = self.cont.yamlPath + self.cont.yamlPath[0] = 'tests/simple-fail/' + self.cont.DeployObject(self.html) + self.assertEqual(self.cont.exitStatus, 1) + self.cont.UndeployObject(self.html, self.ran) + self.cont.yamlPath = old + +if __name__ == '__main__': + unittest.main() diff --git a/ci-scripts/tests/simple-dep/docker-compose.yml b/ci-scripts/tests/simple-dep/docker-compose.yml new file mode 100644 index 0000000000..950e30a814 --- /dev/null +++ b/ci-scripts/tests/simple-dep/docker-compose.yml @@ -0,0 +1,12 @@ +services: + test: + image: ubuntu:jammy + container_name: test_container + cap_drop: + - ALL + entrypoint: /bin/bash -c "sleep infinity" + healthcheck: + test: /bin/bash -c "true" + interval: 1s + timeout: 1s + retries: 1 diff --git a/ci-scripts/tests/simple-fail/docker-compose.yml b/ci-scripts/tests/simple-fail/docker-compose.yml new file mode 100644 index 0000000000..c6d5a04e4a --- /dev/null +++ b/ci-scripts/tests/simple-fail/docker-compose.yml @@ -0,0 +1,12 @@ +services: + test: + image: ubuntu:jammy + container_name: test_container + cap_drop: + - ALL + entrypoint: /bin/bash -c "false" + healthcheck: + test: /bin/bash -c "true" + interval: 1s + timeout: 1s + retries: 1 From 0da2f27fa7711a886d1087815bace44c294571b1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 20 Sep 2024 18:15:36 +0200 Subject: [PATCH 58/87] CI Ping/Iperf: add tests, print without lock, reduce code lines Add some basic unit tests to verify that Iperf/Ping work. Harmonize the logging by only print in the "main" iperf/ping function, to avoid that if we test with multiple UEs, the output intermixes. Also, do one common mkdir before starting multiple pings/iperfs. Finally, harmonize the paths so that Iperf and Ping log their files in the same place. --- ci-scripts/ci_infra.yaml | 4 ++ ci-scripts/cls_cmd.py | 2 +- ci-scripts/cls_oaicitest.py | 90 +++++++++++++++++----------------- ci-scripts/tests/README.md | 1 + ci-scripts/tests/ping-iperf.py | 55 +++++++++++++++++++++ 5 files changed, 105 insertions(+), 47 deletions(-) create mode 100644 ci-scripts/tests/ping-iperf.py diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index d1cfe3130a..1bc26659c6 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -405,3 +405,7 @@ l2sim4g_ext_dn: Host: "%%current_host%%" NetworkScript: docker exec l2sim4g-trf-gen ip a show dev eth0 CmdPrefix: docker exec l2sim4g-trf-gen + +test: + Host: localhost + NetworkScript: echo "inet 127.0.0.1 mtu 1500" diff --git a/ci-scripts/cls_cmd.py b/ci-scripts/cls_cmd.py index 7821f8263c..52fae37a08 100644 --- a/ci-scripts/cls_cmd.py +++ b/ci-scripts/cls_cmd.py @@ -128,7 +128,7 @@ class LocalCmd(Cmd): def copyin(self, src, tgt, recursive=False): if src[0] != '/' or tgt[0] != '/': - raise Exception('support only absolute file paths!') + raise Exception(f'support only absolute file paths (src {src} tgt {tgt})!') opt = '-r' if recursive else '' return self.run(f'cp {opt} {src} {tgt}').returncode == 0 diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 2c78779e24..75c5b0a358 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -328,7 +328,7 @@ class OaiCiTest(): messages = [f.result() for f in futures] HTML.CreateHtmlTestRowQueue('NA', 'OK', messages) - def Ping_common(self, EPC, ue, RAN, CONTAINERS, printLock): + def Ping_common(self, EPC, ue, RAN, logPath): # Launch ping on the EPC side (true for ltebox and old open-air-cn) ping_status = 0 ueIP = ue.getIP() @@ -336,10 +336,6 @@ class OaiCiTest(): return (False, f"UE {ue.getName()} has no IP address") ping_log_file = f'ping_{self.testCase_id}_{ue.getName()}.log' ping_time = re.findall("-c *(\d+)",str(self.ping_args)) - # Creating destination log folder if needed on the python executor workspace - ymlPath = CONTAINERS.yamlPath[0].split('/') - logPath = f'../cmake_targets/log/{ymlPath[2]}' - os.system(f'mkdir -p {logPath}') local_ping_log_file = f'{logPath}/{ping_log_file}' # if has pattern %cn_ip%, replace with core IP address, else we assume the IP is present if re.search('%cn_ip%', self.ping_args): @@ -360,7 +356,6 @@ class OaiCiTest(): ue_header = f'UE {ue.getName()} ({ueIP})' if response.returncode != 0: message = ue_header + ': ping crashed: TIMEOUT?' - logging.error('\u001B[1;37;41m ' + message + ' \u001B[0m') return (False, message) #copy the ping log file to have it locally for analysis (ping stats) @@ -372,13 +367,11 @@ class OaiCiTest(): result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', ping_output) if result is None: message = ue_header + ': Packet Loss Not Found!' - logging.error(f'\u001B[1;37;41m {message} \u001B[0m') return (False, message) packetloss = result.group('packetloss') result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', ping_output) if result is None: message = ue_header + ': Ping RTT_Min RTT_Avg RTT_Max Not Found!' - logging.error(f'\u001B[1;37;41m {message} \u001B[0m') return (False, message) rtt_min = result.group('rtt_min') rtt_avg = result.group('rtt_avg') @@ -389,34 +382,20 @@ class OaiCiTest(): avg_msg = f'RTT(Avg) : {rtt_avg} ms' max_msg = f'RTT(Max) : {rtt_max} ms' - # adding a lock for cleaner display in command line - printLock.acquire() - logging.info(f'\u001B[1;37;44m ping result for {ue_header} \u001B[0m') - logging.info(f'\u001B[1;34m {pal_msg} \u001B[0m') - logging.info(f'\u001B[1;34m {min_msg} \u001B[0m') - logging.info(f'\u001B[1;34m {avg_msg} \u001B[0m') - logging.info(f'\u001B[1;34m {max_msg} \u001B[0m') - message = f'{ue_header}\n{pal_msg}\n{min_msg}\n{avg_msg}\n{max_msg}' #checking packet loss compliance if float(packetloss) > float(self.ping_packetloss_threshold): message += '\nPacket Loss too high' - logging.error(f'\u001B[1;37;41m Packet Loss too high; Target: {self.ping_packetloss_threshold}%\u001B[0m') - printLock.release() return (False, message) elif float(packetloss) > 0: message += '\nPacket Loss is not 0%' - logging.info('\u001B[1;30;43m Packet Loss is not 0% \u001B[0m') if self.ping_rttavg_threshold != '': if float(rtt_avg) > float(self.ping_rttavg_threshold): ping_rttavg_error_msg = f'RTT(Avg) too high: {rtt_avg} ms; Target: {self.ping_rttavg_threshold} ms' message += f'\n {ping_rttavg_error_msg}' - logging.error('\u001B[1;37;41m'+ ping_rttavg_error_msg +' \u001B[0m') - printLock.release() return (False, message) - printLock.release() return (True, message) @@ -427,21 +406,36 @@ class OaiCiTest(): if self.ue_ids == []: raise Exception("no module names in self.ue_ids provided") + # Creating destination log folder if needed on the python executor workspace + with cls_cmd.getConnection('localhost') as local: + ymlPath = CONTAINERS.yamlPath[0].split('/') + logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' + local.run(f'mkdir -p {logPath}', silent=True) ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)] logging.debug(ues) - pingLock = Lock() with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: - futures = [executor.submit(self.Ping_common, EPC, ue, RAN, CONTAINERS, pingLock) for ue in ues] + futures = [executor.submit(self.Ping_common, EPC, ue, RAN, logPath) for ue in ues] results = [f.result() for f in futures] # each result in results is a tuple, first member goes to successes, second to messages successes, messages = map(list, zip(*results)) - if len(successes) == len(ues) and all(successes): + + success = len(successes) == len(ues) and all(successes) + logger = logging.info if success else logging.error + hcolor = "\u001B[1;37;44m" if success else "\u001B[1;37;41m" + lcolor = "\u001B[1;34m" if success else "\u001B[1;31m" + for m in messages: + lines = m.split('\n') + logger(f'{hcolor} ping result for {lines[0]} \u001B[0m') + for l in lines[1:]: + logger(f'{lcolor} {l}\u001B[0m') + + if success: HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', messages) else: HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', messages) self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) - def Iperf_Module(self, EPC, ue, svr, RAN, idx, ue_num, CONTAINERS): + def Iperf_Module(self, EPC, ue, svr, RAN, idx, ue_num, logPath): ueIP = ue.getIP() if not ueIP: return (False, f"UE {ue.getName()} has no IP address") @@ -456,10 +450,6 @@ class OaiCiTest(): udpIperf = re.search('-u', iperf_opt) is not None bidirIperf = re.search('--bidir', iperf_opt) is not None client_filename = f'iperf_client_{self.testCase_id}_{ue.getName()}.log' - ymlPath = CONTAINERS.yamlPath[0].split('/') - logPath = f'../cmake_targets/log/{ymlPath[2]}' - # Creating destination log folder if needed on the python executor workspace - os.system(f'mkdir -p {logPath}') if udpIperf: target_bitrate, iperf_opt = Iperf_ComputeModifiedBW(idx, ue_num, self.iperf_profile, self.iperf_args) # note: for UDP testing we don't want to use json report - reports 0 Mbps received bitrate @@ -470,9 +460,6 @@ class OaiCiTest(): # hack: the ADB UEs don't have iperf in $PATH, so we need to hardcode for the moment iperf_ue = '/data/local/tmp/iperf3' if re.search('adb', ue.getName()) else 'iperf3' ue_header = f'UE {ue.getName()} ({ueIP})' - # create log directory on executor node - with cls_cmd.getConnection('localhost') as local: - local.run(f'mkdir -p {logPath}') with cls_cmd.getConnection(ue.getHost()) as cmd_ue, cls_cmd.getConnection(EPC.IPAddress) as cmd_svr: port = 5002 + idx # note: some core setups start an iperf3 server automatically, indicated in ci_infra by runIperf3Server: False` @@ -481,22 +468,17 @@ class OaiCiTest(): if runIperf3Server: cmd_svr.run(f'{svr.getCmdPrefix()} nohup timeout -vk3 {t} iperf3 -s -B {svrIP} -p {port} -1 {jsonReport} &', timeout=t) cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} {iperf_ue} -B {ueIP} -c {svrIP} -p {port} {iperf_opt} {jsonReport} {serverReport} -O 5 >> /tmp/{client_filename}', timeout=t) - localPath = f'{os.getcwd()}' - # note: copy iperf3 log to the directory for log collection, used by pipelines running on executor machine - cmd_ue.copyin(f'/tmp/{client_filename}', f'{localPath}/{logPath}/{client_filename}') # note: copy iperf3 log to the current directory for log analysis and log collection - cmd_ue.copyin(f'/tmp/{client_filename}', f'{localPath}/{client_filename}') + dest_filename = f'{logPath}/{client_filename}' + cmd_ue.copyin(f'/tmp/{client_filename}', dest_filename) cmd_ue.run(f'rm /tmp/{client_filename}', reportNonZero=False, silent=True) if udpIperf: - status, msg = Iperf_analyzeV3UDP(client_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) + status, msg = Iperf_analyzeV3UDP(dest_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) elif bidirIperf: - status, msg = Iperf_analyzeV3BIDIRJson(client_filename) + status, msg = Iperf_analyzeV3BIDIRJson(dest_filename) else: - status, msg = Iperf_analyzeV3TCPJson(client_filename, self.iperf_tcp_rate_target) + status, msg = Iperf_analyzeV3TCPJson(dest_filename, self.iperf_tcp_rate_target) - logging.info(f'\u001B[1;37;45m iperf result for {ue_header}\u001B[0m') - for l in msg.split('\n'): - logging.info(f'\u001B[1;35m {l} \u001B[0m') return (status, f'{ue_header}\n{msg}') def Iperf(self,HTML,RAN,EPC,CONTAINERS): @@ -508,15 +490,31 @@ class OaiCiTest(): if self.ue_ids == [] or self.svr_id == None: raise Exception("no module names in self.ue_ids or/and self.svr_id provided") + # create log directory on executor node + with cls_cmd.getConnection('localhost') as local: + ymlPath = CONTAINERS.yamlPath[0].split('/') + logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' + local.run(f'mkdir -p {logPath}', silent=True) ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)] svr = cls_module.Module_UE(self.svr_id,self.svr_node) logging.debug(ues) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: - futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, RAN, i, len(ues), CONTAINERS) for i, ue in enumerate(ues)] + futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, RAN, i, len(ues), logPath) for i, ue in enumerate(ues)] results = [f.result() for f in futures] # each result in results is a tuple, first member goes to successes, second to messages successes, messages = map(list, zip(*results)) - if len(successes) == len(ues) and all(successes): + + success = len(successes) == len(ues) and all(successes) + logger = logging.info if success else logging.error + hcolor = "\u001B[1;37;45m" if success else "\u001B[1;37;41m" + lcolor = "\u001B[1;35m" if success else "\u001B[1;31m" + for m in messages: + lines = m.split('\n') + logger(f'{hcolor} iperf result for {lines[0]} \u001B[0m') + for l in lines[1:]: + logger(f'{lcolor} {l}\u001B[0m') + + if success: HTML.CreateHtmlTestRowQueue(self.iperf_args, 'OK', messages) else: HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', messages) @@ -535,7 +533,7 @@ class OaiCiTest(): return (False, f"Iperf server {ue.getName()} has no IP address") server_filename = f'iperf_server_{self.testCase_id}_{ue.getName()}.log' ymlPath = CONTAINERS.yamlPath[0].split('/') - logPath = f'../cmake_targets/log/{ymlPath[-1]}' + logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' iperf_time = Iperf_ComputeTime(self.iperf_args) target_bitrate, iperf_opt = Iperf_ComputeModifiedBW(0, 1, self.iperf_profile, self.iperf_args) t = iperf_time*2.5 diff --git a/ci-scripts/tests/README.md b/ci-scripts/tests/README.md index 685a19d0cc..6e4b488020 100644 --- a/ci-scripts/tests/README.md +++ b/ci-scripts/tests/README.md @@ -7,5 +7,6 @@ There are some unit tests. From the parent directory, i.e., `ci-scripts/`, start with python tests/deployment.py -v + python tests/ping-iperf.py -v It will indicate if all tests passed. diff --git a/ci-scripts/tests/ping-iperf.py b/ci-scripts/tests/ping-iperf.py new file mode 100644 index 0000000000..e3444a4024 --- /dev/null +++ b/ci-scripts/tests/ping-iperf.py @@ -0,0 +1,55 @@ +import sys +import logging +logging.basicConfig( + level=logging.DEBUG, + stream=sys.stdout, + format="[%(asctime)s] %(levelname)8s: %(message)s" +) +import os +os.system(f'rm -rf cmake_targets') +os.system(f'mkdir -p cmake_targets/log') +import unittest + +sys.path.append('./') # to find OAI imports below +import cls_oai_html +import cls_oaicitest +import cls_containerize +import ran +import epc + +class TestPingIperf(unittest.TestCase): + def setUp(self): + self.html = cls_oai_html.HTMLManagement() + self.html.testCaseId = "000000" + self.ci = cls_oaicitest.OaiCiTest() + self.ci.ue_ids = ["test"] + self.ci.nodes = ["localhost"] + self.cont = cls_containerize.Containerize() + self.epc = epc.EPCManagement() + self.epc.IPAddress = "localhost" + self.epc.UserName = None + self.epc.Password = None + self.epc.SourceCodePath = os.getcwd() + self.ran = ran.RANManagement() + + def test_ping(self): + self.ci.ping_args = "-c3 127.0.0.1" + self.ci.ping_packetloss_threshold = "0" + # TODO Should need nothing but options and UE(s) to use + self.ci.Ping(self.html, self.ran, self.epc, self.cont) + + def test_iperf(self): + # note: needs to be five seconds because Iperf() adds -O 3, so if it is + # too short, the server is terminated before the client loaded + # everything + self.ci.iperf_args = "-u -t 5 -b 1M -R" + self.ci.svr_id = "test" + self.ci.svr_node = "localhost" + self.ci.iperf_packetloss_threshold = "0" + self.ci.iperf_bitrate_threshold = "0" + self.ci.iperf_profile = "balanced" + # TODO Should need nothing but options and UE(s) to use + self.ci.Iperf(self.html, self.ran, self.epc, self.cont) + +if __name__ == '__main__': + unittest.main() From 1ba567705674eb02ae328b67abacf2fc56ae022c Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Thu, 19 Sep 2024 22:13:36 +0200 Subject: [PATCH 59/87] CI: get UDP iperf3 results even if packet count is negative --- ci-scripts/cls_oaicitest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 75c5b0a358..b321de40f4 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -145,7 +145,7 @@ def Iperf_analyzeV3UDP(filename, iperf_bitrate_threshold, iperf_packetloss_thres with open(filename, 'r') as server_file: for line in server_file.readlines(): res_sender = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P\d+)/(?P\d+) \((?P[0-9\.]+).*?\s+(sender)', line) - res_receiver = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P\d+)/(?P\d+) \((?P[0-9\.]+).*?\s+(receiver)', line) + res_receiver = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P-?\d+)/(?P\d+)\s+\((?P[0-9\.]+)%\).*?(receiver)', line) if res_sender is not None: sender_bitrate = res_sender.group('bitrate') sender_unit = res_sender.group('unit') From 9d92c0e477de63cada0f7570c2347882311e4069 Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Thu, 26 Sep 2024 14:04:24 +0200 Subject: [PATCH 60/87] CI: add unit test for UDP iperf3 analysis function --- ci-scripts/tests/README.md | 1 + ci-scripts/tests/iperf-analysis.py | 45 +++++++++++++++++++++ ci-scripts/tests/log/iperf_udp_msg_nok.txt | 4 ++ ci-scripts/tests/log/iperf_udp_msg_ok.txt | 4 ++ ci-scripts/tests/log/iperf_udp_test_nok.log | 39 ++++++++++++++++++ ci-scripts/tests/log/iperf_udp_test_ok.log | 39 ++++++++++++++++++ 6 files changed, 132 insertions(+) create mode 100644 ci-scripts/tests/iperf-analysis.py create mode 100644 ci-scripts/tests/log/iperf_udp_msg_nok.txt create mode 100644 ci-scripts/tests/log/iperf_udp_msg_ok.txt create mode 100644 ci-scripts/tests/log/iperf_udp_test_nok.log create mode 100644 ci-scripts/tests/log/iperf_udp_test_ok.log diff --git a/ci-scripts/tests/README.md b/ci-scripts/tests/README.md index 6e4b488020..2fd3a45e70 100644 --- a/ci-scripts/tests/README.md +++ b/ci-scripts/tests/README.md @@ -8,5 +8,6 @@ start with python tests/deployment.py -v python tests/ping-iperf.py -v + python tests/iperf-analysis.py -v It will indicate if all tests passed. diff --git a/ci-scripts/tests/iperf-analysis.py b/ci-scripts/tests/iperf-analysis.py new file mode 100644 index 0000000000..7fd79dc4d2 --- /dev/null +++ b/ci-scripts/tests/iperf-analysis.py @@ -0,0 +1,45 @@ +import sys +import logging +logging.basicConfig( + level=logging.DEBUG, + stream=sys.stdout, + format="[%(asctime)s] %(levelname)8s: %(message)s" +) +import os +import unittest + +sys.path.append('./') # to find OAI imports below +import cls_oaicitest + +class TestIperfAnalysis(unittest.TestCase): + def setUp(self): + self.iperf_bitrate_threshold = "99" + self.iperf_packetloss_threshold = "0" + self.target_bitrate = "1" + + def test_iperf_analyzeV3UDP_ok(self): + filename_ok = "tests/log/iperf_udp_test_ok.log" + msg_filename_ok = "tests/log/iperf_udp_msg_ok.txt" + with open(msg_filename_ok, 'r') as file: + expected_msg_ok = file.read().strip() + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_ok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate) + self.assertEqual(msg, expected_msg_ok) + self.assertTrue(success) + + def test_iperf_analyzeV3UDP_nok(self): + filename_nok = "tests/log/iperf_udp_test_nok.log" + msg_filename_nok = "tests/log/iperf_udp_msg_nok.txt" + with open(msg_filename_nok, 'r') as file: + expected_msg_nok = file.read().strip() + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate) + self.assertEqual(msg, expected_msg_nok) + self.assertFalse(success) + + def test_iperf_analyzeV3UDP_notfound(self): + filename_notfound = "tests/log/iperf_udp_test_notfound.log" + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_notfound, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate) + self.assertEqual(msg, "Iperf3 UDP: Log file not present") + self.assertFalse(success) + +if __name__ == '__main__': + unittest.main() diff --git a/ci-scripts/tests/log/iperf_udp_msg_nok.txt b/ci-scripts/tests/log/iperf_udp_msg_nok.txt new file mode 100644 index 0000000000..0e03a2dc76 --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_msg_nok.txt @@ -0,0 +1,4 @@ +Sender Bitrate : 0.52 Mbps +Receiver Bitrate: 0.52 Mbps (too low! < 99%) +Jitter : 0.026 ms +Packet Loss : 10 % (too high! > 0%) diff --git a/ci-scripts/tests/log/iperf_udp_msg_ok.txt b/ci-scripts/tests/log/iperf_udp_msg_ok.txt new file mode 100644 index 0000000000..defea05c79 --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_msg_ok.txt @@ -0,0 +1,4 @@ +Sender Bitrate : 1.00 Mbps +Receiver Bitrate: 1.00 Mbps (99.60 %) +Jitter : 0.029 ms +Packet Loss : 0 % diff --git a/ci-scripts/tests/log/iperf_udp_test_nok.log b/ci-scripts/tests/log/iperf_udp_test_nok.log new file mode 100644 index 0000000000..e7bd59824d --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_test_nok.log @@ -0,0 +1,39 @@ +Connecting to host 127.0.0.1, port 5002 +Reverse mode, remote host 127.0.0.1 is sending +[ 5] local 127.0.0.1 port 49140 connected to 127.0.0.1 port 5002 +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-1.00 sec 64.0 KBytes 524 Kbits/sec 0.005 ms 0/2 (0%) (omitted) +[ 5] 1.00-2.00 sec 64.0 KBytes 524 Kbits/sec 0.012 ms 0/2 (0%) (omitted) +[ 5] 2.00-3.00 sec 64.0 KBytes 524 Kbits/sec 0.013 ms 0/2 (0%) (omitted) +[ 5] 3.00-4.00 sec 64.0 KBytes 524 Kbits/sec 0.015 ms 0/2 (0%) (omitted) +[ 5] 4.00-5.00 sec 64.0 KBytes 524 Kbits/sec 0.019 ms 0/2 (0%) (omitted) +[ 5] 0.00-1.00 sec 64.0 KBytes 524 Kbits/sec 0.006 ms 0/2 (0%) +[ 5] 1.00-2.00 sec 64.0 KBytes 524 Kbits/sec 0.008 ms 0/2 (0%) +[ 5] 2.00-3.00 sec 64.0 KBytes 524 Kbits/sec 0.015 ms 0/2 (0%) +[ 5] 3.00-4.00 sec 64.0 KBytes 524 Kbits/sec 0.017 ms 0/2 (0%) +[ 5] 4.00-5.00 sec 64.0 KBytes 525 Kbits/sec 0.026 ms 0/2 (0%) +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-5.00 sec 320 KBytes 524 Kbits/sec 0.000 ms 0/10 (0%) sender +[ 5] 0.00-5.00 sec 320 KBytes 524 Kbits/sec 0.026 ms 0/10 (10%) receiver + +Server output: +Accepted connection from 127.0.0.1, port 34697 +[ 5] local 127.0.0.1 port 5002 connected to 127.0.0.1 port 49140 +[ ID] Interval Transfer Bitrate Total Datagrams +[ 5] 0.00-1.00 sec 64.0 KBytes 524 Kbits/sec 2 (omitted) +[ 5] 1.00-2.00 sec 64.0 KBytes 524 Kbits/sec 2 (omitted) +[ 5] 2.00-3.00 sec 64.0 KBytes 524 Kbits/sec 2 (omitted) +[ 5] 3.00-4.00 sec 64.0 KBytes 524 Kbits/sec 2 (omitted) +[ 5] 4.00-5.00 sec 64.0 KBytes 524 Kbits/sec 2 (omitted) +[ 5] 0.00-1.00 sec 64.0 KBytes 524 Kbits/sec 2 +[ 5] 1.00-2.00 sec 64.0 KBytes 524 Kbits/sec 2 +[ 5] 2.00-3.00 sec 64.0 KBytes 524 Kbits/sec 2 +[ 5] 3.00-4.00 sec 64.0 KBytes 524 Kbits/sec 2 +[ 5] 4.00-5.00 sec 64.0 KBytes 524 Kbits/sec 2 +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-5.00 sec 320 KBytes 524 Kbits/sec 0.000 ms 0/10 (10%) sender + + +iperf Done. diff --git a/ci-scripts/tests/log/iperf_udp_test_ok.log b/ci-scripts/tests/log/iperf_udp_test_ok.log new file mode 100644 index 0000000000..79163df625 --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_test_ok.log @@ -0,0 +1,39 @@ +Connecting to host 127.0.0.1, port 5002 +Reverse mode, remote host 127.0.0.1 is sending +[ 5] local 127.0.0.1 port 34141 connected to 127.0.0.1 port 5002 +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-1.00 sec 128 KBytes 1.05 Mbits/sec 0.011 ms 0/4 (0%) (omitted) +[ 5] 1.00-2.00 sec 128 KBytes 1.05 Mbits/sec 0.012 ms 0/4 (0%) (omitted) +[ 5] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 0.019 ms 0/4 (0%) (omitted) +[ 5] 3.00-4.00 sec 128 KBytes 1.05 Mbits/sec 0.023 ms 0/4 (0%) (omitted) +[ 5] 4.00-5.00 sec 128 KBytes 1.05 Mbits/sec 0.022 ms 0/4 (0%) (omitted) +[ 5] 0.00-1.00 sec 96.0 KBytes 786 Kbits/sec 0.003 ms 0/3 (0%) +[ 5] 1.00-2.00 sec 128 KBytes 1.05 Mbits/sec 0.011 ms 0/4 (0%) +[ 5] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 0.024 ms 0/4 (0%) +[ 5] 3.00-4.00 sec 128 KBytes 1.05 Mbits/sec 0.022 ms 0/4 (0%) +[ 5] 4.00-5.00 sec 128 KBytes 1.05 Mbits/sec 0.029 ms 0/4 (0%) +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-5.00 sec 608 KBytes 996 Kbits/sec 0.000 ms 0/19 (0%) sender +[ 5] 0.00-5.00 sec 608 KBytes 996 Kbits/sec 0.029 ms 0/19 (0%) receiver + +Server output: +Accepted connection from 127.0.0.1, port 53711 +[ 5] local 127.0.0.1 port 5002 connected to 127.0.0.1 port 34141 +[ ID] Interval Transfer Bitrate Total Datagrams +[ 5] 0.00-1.00 sec 128 KBytes 1.05 Mbits/sec 4 (omitted) +[ 5] 1.00-2.00 sec 128 KBytes 1.05 Mbits/sec 4 (omitted) +[ 5] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 4 (omitted) +[ 5] 3.00-4.00 sec 128 KBytes 1.05 Mbits/sec 4 (omitted) +[ 5] 4.00-5.00 sec 128 KBytes 1.05 Mbits/sec 4 (omitted) +[ 5] 0.00-1.00 sec 96.0 KBytes 786 Kbits/sec 3 +[ 5] 1.00-2.00 sec 128 KBytes 1.05 Mbits/sec 4 +[ 5] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 4 +[ 5] 3.00-4.00 sec 128 KBytes 1.05 Mbits/sec 4 +[ 5] 4.00-5.00 sec 128 KBytes 1.05 Mbits/sec 4 +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-5.00 sec 608 KBytes 996 Kbits/sec 0.000 ms 0/19 (0%) sender + + +iperf Done. From 5fd5ed43c748879a666f17f2489de1c42bc1836f Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Fri, 27 Sep 2024 12:06:21 +0200 Subject: [PATCH 61/87] CI: Adjust regex patterns for Iperf3 UDP log parsing Update the regex for both sender and receiver data to allow optional bitrate unit prefixes - accepts also no prefix. Modify the patterns for lost and total packets to accept negative values (`-?\d+`). --- ci-scripts/cls_oaicitest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index b321de40f4..fdc049be5d 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -144,8 +144,8 @@ def Iperf_analyzeV3UDP(filename, iperf_bitrate_threshold, iperf_packetloss_thres receiver_bitrate = None with open(filename, 'r') as server_file: for line in server_file.readlines(): - res_sender = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P\d+)/(?P\d+) \((?P[0-9\.]+).*?\s+(sender)', line) - res_receiver = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P-?\d+)/(?P\d+)\s+\((?P[0-9\.]+)%\).*?(receiver)', line) + res_sender = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]?bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P-?\d+)/(?P-?\d+) \((?P[0-9\.]+).*?\s+(sender)', line) + res_receiver = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]?bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P-?\d+)/(?P-?\d+)\s+\((?P[0-9\.]+)%\).*?(receiver)', line) if res_sender is not None: sender_bitrate = res_sender.group('bitrate') sender_unit = res_sender.group('unit') From e9f9718f638dd5b9d938f10816ccd831f2cac196 Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Fri, 27 Sep 2024 14:34:52 +0200 Subject: [PATCH 62/87] CI: add more unit tests for UDP iperf3 analysis function --- ci-scripts/tests/iperf-analysis.py | 40 ++++++++- ci-scripts/tests/log/iperf_udp_msg_nok2.txt | 4 + ci-scripts/tests/log/iperf_udp_msg_nok3.txt | 4 + ci-scripts/tests/log/iperf_udp_msg_ok2.txt | 4 + ci-scripts/tests/log/iperf_udp_test_nok2.log | 43 ++++++++++ ci-scripts/tests/log/iperf_udp_test_nok3.log | 41 +++++++++ ci-scripts/tests/log/iperf_udp_test_ok2.log | 90 ++++++++++++++++++++ 7 files changed, 222 insertions(+), 4 deletions(-) create mode 100644 ci-scripts/tests/log/iperf_udp_msg_nok2.txt create mode 100644 ci-scripts/tests/log/iperf_udp_msg_nok3.txt create mode 100644 ci-scripts/tests/log/iperf_udp_msg_ok2.txt create mode 100644 ci-scripts/tests/log/iperf_udp_test_nok2.log create mode 100644 ci-scripts/tests/log/iperf_udp_test_nok3.log create mode 100644 ci-scripts/tests/log/iperf_udp_test_ok2.log diff --git a/ci-scripts/tests/iperf-analysis.py b/ci-scripts/tests/iperf-analysis.py index 7fd79dc4d2..53d5bdda1d 100644 --- a/ci-scripts/tests/iperf-analysis.py +++ b/ci-scripts/tests/iperf-analysis.py @@ -15,29 +15,61 @@ class TestIperfAnalysis(unittest.TestCase): def setUp(self): self.iperf_bitrate_threshold = "99" self.iperf_packetloss_threshold = "0" - self.target_bitrate = "1" def test_iperf_analyzeV3UDP_ok(self): filename_ok = "tests/log/iperf_udp_test_ok.log" msg_filename_ok = "tests/log/iperf_udp_msg_ok.txt" + target_bitrate = "1" with open(msg_filename_ok, 'r') as file: expected_msg_ok = file.read().strip() - success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_ok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate) + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_ok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) + self.assertEqual(msg, expected_msg_ok) + self.assertTrue(success) + + def test_iperf_analyzeV3UDP_ok2(self): + filename_ok = "tests/log/iperf_udp_test_ok2.log" + msg_filename_ok = "tests/log/iperf_udp_msg_ok2.txt" + target_bitrate = "4.67" + with open(msg_filename_ok, 'r') as file: + expected_msg_ok = file.read().strip() + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_ok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) self.assertEqual(msg, expected_msg_ok) self.assertTrue(success) def test_iperf_analyzeV3UDP_nok(self): filename_nok = "tests/log/iperf_udp_test_nok.log" msg_filename_nok = "tests/log/iperf_udp_msg_nok.txt" + target_bitrate = "1" with open(msg_filename_nok, 'r') as file: expected_msg_nok = file.read().strip() - success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate) + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) + self.assertEqual(msg, expected_msg_nok) + self.assertFalse(success) + + def test_iperf_analyzeV3UDP_nok2(self): + filename_nok = "tests/log/iperf_udp_test_nok2.log" + msg_filename_nok = "tests/log/iperf_udp_msg_nok2.txt" + target_bitrate = "80" + with open(msg_filename_nok, 'r') as file: + expected_msg_nok = file.read().strip() + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) + self.assertEqual(msg, expected_msg_nok) + self.assertFalse(success) + + def test_iperf_analyzeV3UDP_nok3(self): + filename_nok = "tests/log/iperf_udp_test_nok3.log" + msg_filename_nok = "tests/log/iperf_udp_msg_nok3.txt" + target_bitrate = "4.67" + with open(msg_filename_nok, 'r') as file: + expected_msg_nok = file.read().strip() + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) self.assertEqual(msg, expected_msg_nok) self.assertFalse(success) def test_iperf_analyzeV3UDP_notfound(self): filename_notfound = "tests/log/iperf_udp_test_notfound.log" - success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_notfound, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate) + target_bitrate = "1" + success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_notfound, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) self.assertEqual(msg, "Iperf3 UDP: Log file not present") self.assertFalse(success) diff --git a/ci-scripts/tests/log/iperf_udp_msg_nok2.txt b/ci-scripts/tests/log/iperf_udp_msg_nok2.txt new file mode 100644 index 0000000000..c0c34193f2 --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_msg_nok2.txt @@ -0,0 +1,4 @@ +Sender Bitrate : 0.00 Mbps +Receiver Bitrate: 3.98 Mbps (too low! < 99%) +Jitter : 3.847 ms +Packet Loss : 0.038 % (too high! > 0%) diff --git a/ci-scripts/tests/log/iperf_udp_msg_nok3.txt b/ci-scripts/tests/log/iperf_udp_msg_nok3.txt new file mode 100644 index 0000000000..c302493e85 --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_msg_nok3.txt @@ -0,0 +1,4 @@ +Sender Bitrate : 1.03 Mbps +Receiver Bitrate: 0.00 Mbps (too low! < 99%) +Jitter : 0.000 ms +Packet Loss : 0 % diff --git a/ci-scripts/tests/log/iperf_udp_msg_ok2.txt b/ci-scripts/tests/log/iperf_udp_msg_ok2.txt new file mode 100644 index 0000000000..31a5ec14cd --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_msg_ok2.txt @@ -0,0 +1,4 @@ +Sender Bitrate : 4.67 Mbps +Receiver Bitrate: 4.67 Mbps (100.00 %) +Jitter : 3.413 ms +Packet Loss : 0 % diff --git a/ci-scripts/tests/log/iperf_udp_test_nok2.log b/ci-scripts/tests/log/iperf_udp_test_nok2.log new file mode 100644 index 0000000000..8889879f48 --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_test_nok2.log @@ -0,0 +1,43 @@ +Connecting to host 192.172.0.1, port 5002 +Reverse mode, remote host 192.172.0.1 is sending +[ 5] local 192.172.0.2 port 44733 connected to 192.172.0.1 port 5002 +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-1.00 sec 8.55 MBytes 71.7 Mbits/sec 0.407 ms 66/6256 (1.1%) (omitted) +[ 5] 1.00-2.00 sec 10.4 MBytes 87.3 Mbits/sec 0.355 ms 0/7540 (0%) (omitted) +[ 5] 2.00-3.00 sec 9.55 MBytes 80.1 Mbits/sec 0.333 ms 0/6913 (0%) (omitted) +[ 5] 3.00-4.00 sec 9.54 MBytes 80.0 Mbits/sec 0.344 ms 0/6906 (0%) (omitted) +[ 5] 4.00-5.00 sec 9.54 MBytes 80.0 Mbits/sec 0.338 ms 0/6906 (0%) (omitted) +[ 5] 0.00-1.00 sec 9.53 MBytes 80.0 Mbits/sec 0.398 ms 0/6903 (0%) +[ 5] 1.00-2.00 sec 9.54 MBytes 80.0 Mbits/sec 0.393 ms 0/6907 (0%) +[ 5] 2.00-3.00 sec 9.53 MBytes 80.0 Mbits/sec 0.338 ms 0/6902 (0%) +[ 5] 3.00-4.00 sec 4.50 MBytes 37.7 Mbits/sec 3.847 ms 9/3269 (0.28%) +[ 5] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 10.00-11.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 11.00-12.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 12.00-13.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 13.00-14.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 14.00-15.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 15.00-16.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 16.00-17.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 17.00-18.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 18.00-19.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 19.00-20.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 20.00-21.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 21.00-22.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 22.00-23.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 23.00-24.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 24.00-25.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 25.00-26.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 26.00-27.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 27.00-28.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 28.00-29.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +[ 5] 30.00-69.84 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%) +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-69.84 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/-34521 (0%) sender +[ 5] 0.00-69.84 sec 33.1 MBytes 3.98 Mbits/sec 3.847 ms 9/23981 (0.038%) receiver diff --git a/ci-scripts/tests/log/iperf_udp_test_nok3.log b/ci-scripts/tests/log/iperf_udp_test_nok3.log new file mode 100644 index 0000000000..07b34da526 --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_test_nok3.log @@ -0,0 +1,41 @@ +Connecting to host 172.21.6.102, port 5007 +[ 5] local 12.1.1.105 port 46131 connected to 172.21.6.102 port 5007 +[ ID] Interval Transfer Bitrate Total Datagrams +[ 5] 0.00-1.00 sec 293 KBytes 2.40 Mbits/sec 207 (omitted) +[ 5] 1.00-2.00 sec 294 KBytes 2.41 Mbits/sec 208 (omitted) +[ 5] 2.00-3.00 sec 293 KBytes 2.40 Mbits/sec 207 (omitted) +[ 5] 3.00-4.00 sec 293 KBytes 2.40 Mbits/sec 207 (omitted) +[ 5] 1.00-1.00 sec 293 KBytes 1.20 Mbits/sec 414 +[ 5] 1.00-2.00 sec 294 KBytes 2.41 Mbits/sec 208 +[ 5] 2.00-3.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 3.00-4.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 4.00-5.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 5.00-6.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 6.00-7.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 7.00-8.00 sec 294 KBytes 2.41 Mbits/sec 208 +[ 5] 8.00-9.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 9.00-10.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 10.00-11.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 11.00-12.00 sec 294 KBytes 2.41 Mbits/sec 208 +[ 5] 12.00-13.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 13.00-14.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 14.00-15.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 15.00-16.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 16.00-17.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 17.00-18.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 18.00-19.00 sec 294 KBytes 2.41 Mbits/sec 208 +[ 5] 19.00-20.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 20.00-21.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 21.00-22.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 22.00-23.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 23.00-24.00 sec 294 KBytes 2.41 Mbits/sec 208 +[ 5] 24.00-25.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 25.00-26.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 26.00-27.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 27.00-28.00 sec 293 KBytes 2.40 Mbits/sec 207 +[ 5] 28.00-29.00 sec 294 KBytes 2.41 Mbits/sec 208 +[ 5] 30.00-69.81 sec 0.00 Bytes 0.00 bits/sec 0 +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-69.81 sec 8.58 MBytes 1.03 Mbits/sec 0.000 ms 0/6216 (0%) sender +[ 5] 0.00-69.81 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/-1036 (0%) receiver diff --git a/ci-scripts/tests/log/iperf_udp_test_ok2.log b/ci-scripts/tests/log/iperf_udp_test_ok2.log new file mode 100644 index 0000000000..59277a1104 --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_test_ok2.log @@ -0,0 +1,90 @@ +Connecting to host 172.21.6.102, port 5007 +Reverse mode, remote host 172.21.6.102 is sending +[ 5] local 12.1.1.105 port 52299 connected to 172.21.6.102 port 5007 +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-1.00 sec 389 KBytes 3.19 Mbits/sec 8024.341 ms 131771/132046 (1e+02%) (omitted) +[ 5] 1.00-2.00 sec 602 KBytes 4.93 Mbits/sec 4.031 ms -426/0 (0%) (omitted) +[ 5] 2.00-3.00 sec 638 KBytes 5.22 Mbits/sec 3.643 ms -451/0 (0%) (omitted) +[ 5] 3.00-4.00 sec 632 KBytes 5.18 Mbits/sec 3.607 ms -447/0 (0%) (omitted) +[ 5] 1.00-1.00 sec 567 KBytes 2.32 Mbits/sec 2.950 ms -818/0 (0%) +[ 5] 1.00-2.00 sec 570 KBytes 4.67 Mbits/sec 3.083 ms -403/0 (0%) +[ 5] 2.00-3.00 sec 573 KBytes 4.69 Mbits/sec 3.222 ms -405/0 (0%) +[ 5] 3.00-4.00 sec 566 KBytes 4.63 Mbits/sec 3.114 ms -400/0 (0%) +[ 5] 4.00-5.00 sec 576 KBytes 4.71 Mbits/sec 3.594 ms -407/0 (0%) +[ 5] 5.00-6.00 sec 567 KBytes 4.65 Mbits/sec 3.634 ms -401/0 (0%) +[ 5] 6.00-7.00 sec 571 KBytes 4.68 Mbits/sec 3.196 ms -404/0 (0%) +[ 5] 7.00-8.00 sec 567 KBytes 4.65 Mbits/sec 3.514 ms -401/0 (0%) +[ 5] 8.00-9.00 sec 573 KBytes 4.69 Mbits/sec 3.230 ms -405/0 (0%) +[ 5] 9.00-10.00 sec 570 KBytes 4.67 Mbits/sec 3.334 ms -403/0 (0%) +[ 5] 10.00-11.00 sec 566 KBytes 4.63 Mbits/sec 3.602 ms -400/0 (0%) +[ 5] 11.00-12.00 sec 574 KBytes 4.70 Mbits/sec 3.484 ms -406/0 (0%) +[ 5] 12.00-13.00 sec 571 KBytes 4.68 Mbits/sec 3.339 ms -404/0 (0%) +[ 5] 13.00-14.00 sec 568 KBytes 4.66 Mbits/sec 3.404 ms -402/0 (0%) +[ 5] 14.00-15.00 sec 570 KBytes 4.67 Mbits/sec 3.503 ms -403/0 (0%) +[ 5] 15.00-16.00 sec 573 KBytes 4.69 Mbits/sec 3.369 ms -405/0 (0%) +[ 5] 16.00-17.00 sec 567 KBytes 4.65 Mbits/sec 3.533 ms -401/0 (0%) +[ 5] 17.00-18.00 sec 570 KBytes 4.67 Mbits/sec 3.650 ms -403/0 (0%) +[ 5] 18.00-19.00 sec 573 KBytes 4.69 Mbits/sec 3.532 ms -405/0 (0%) +[ 5] 19.00-20.00 sec 568 KBytes 4.66 Mbits/sec 3.461 ms -402/0 (0%) +[ 5] 20.00-21.00 sec 573 KBytes 4.69 Mbits/sec 3.369 ms -405/0 (0%) +[ 5] 21.00-22.00 sec 566 KBytes 4.63 Mbits/sec 3.654 ms -400/0 (0%) +[ 5] 22.00-23.00 sec 573 KBytes 4.69 Mbits/sec 3.309 ms -405/0 (0%) +[ 5] 23.00-24.00 sec 568 KBytes 4.66 Mbits/sec 3.681 ms -402/0 (0%) +[ 5] 24.00-25.00 sec 570 KBytes 4.67 Mbits/sec 3.443 ms -403/0 (0%) +[ 5] 25.00-26.00 sec 571 KBytes 4.68 Mbits/sec 3.467 ms -404/0 (0%) +[ 5] 26.00-27.00 sec 573 KBytes 4.69 Mbits/sec 3.324 ms -405/0 (0%) +[ 5] 27.00-28.00 sec 566 KBytes 4.63 Mbits/sec 3.425 ms -400/0 (0%) +[ 5] 28.00-29.00 sec 574 KBytes 4.70 Mbits/sec 3.274 ms -406/0 (0%) +[ 5] 29.00-30.00 sec 570 KBytes 4.67 Mbits/sec 3.413 ms -403/0 (0%) +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-30.01 sec 16.7 MBytes 4.67 Mbits/sec 0.000 ms 0/-117930 (0%) sender +[SUM] 0.0-30.0 sec 12094 datagrams received out-of-order +[ 5] 0.00-30.00 sec 16.7 MBytes 4.67 Mbits/sec 3.413 ms -12094/0 (0%) receiver + +Server output: +Accepted connection from 172.21.6.101, port 47601 +[ 5] local 172.21.6.102 port 5007 connected to 172.21.6.101 port 52299 +[ ID] Interval Transfer Bitrate Total Datagrams +[ 5] 0.00-1.00 sec 570 KBytes 4.67 Mbits/sec 403 (omitted) +[ 5] 1.00-2.00 sec 570 KBytes 4.67 Mbits/sec 403 (omitted) +[ 5] 2.00-3.00 sec 571 KBytes 4.68 Mbits/sec 404 (omitted) +[ 5] 3.00-4.00 sec 570 KBytes 4.67 Mbits/sec 403 (omitted) +[ 5] 4.00-5.00 sec 570 KBytes 4.67 Mbits/sec 403 (omitted) +[ 5] 0.00-1.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 1.00-2.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 2.00-3.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 3.00-4.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 4.00-5.00 sec 571 KBytes 4.68 Mbits/sec 404 +[ 5] 5.00-6.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 6.00-7.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 7.00-8.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 8.00-9.00 sec 571 KBytes 4.68 Mbits/sec 404 +[ 5] 9.00-10.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 10.00-11.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 11.00-12.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 12.00-13.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 13.00-14.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 14.00-15.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 15.00-16.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 16.00-17.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 17.00-18.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 18.00-19.00 sec 571 KBytes 4.68 Mbits/sec 404 +[ 5] 19.00-20.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 20.00-21.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 21.00-22.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 22.00-23.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 23.00-24.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 24.00-25.00 sec 571 KBytes 4.68 Mbits/sec 404 +[ 5] 25.00-26.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 26.00-27.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 27.00-28.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 28.00-29.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 29.00-30.00 sec 570 KBytes 4.67 Mbits/sec 403 +[ 5] 30.00-30.01 sec 8.48 KBytes 4.94 Mbits/sec 6 +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams +[ 5] 0.00-30.01 sec 16.7 MBytes 4.67 Mbits/sec 0.000 ms 0/12100 (0%) sender + + +iperf Done. From d108648312eb9659c103bad0df12ceeca71e14ad Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 12:04:02 +0200 Subject: [PATCH 63/87] Handle parameter reading and test case execution together For reasons I don't understand, the XML option reading and actual test case execution are at different places in the code. This is problematic, because what this led to is that options are not passed as function arguments, but indirectly through class members. This led to a lot of "indirect code"; it's a total mess To improve this, move them together, so that parameters can be passed directly as function arguments later on. Because we reference the globals, mark them inside ExecuteActionWithParam(). That is a Python antipattern, but necessary at this moment. I believe that we can remove the following globals over time: - SSH (with new cls_cmd, which we don't need to pass) - EPC (replaced through a class similar to ue_module, i.e., refer to core networks on specific hosts through an ID, instead of a global) - HTML (should use templating, where individual functions give back a dictionary of what they want to print, and a final pass assembles the entire HTML file) - RAN/SCA/PHYSIM/CLUSTER/ldpc (can be replaced with stateless scripts build/run eNB/gNB on a specific node) --- ci-scripts/main.py | 258 ++++++++++++++++++++------------------------- 1 file changed, 115 insertions(+), 143 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 043580f775..61cf3d1ce5 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -102,7 +102,16 @@ def AssignParams(params_dict): -def GetParametersFromXML(action): +def ExecuteActionWithParam(action): + global SSH + global EPC + global RAN + global HTML + global CONTAINERS + global SCA + global PHYSIM + global CLUSTER + global ldpc if action == 'Build_eNB' or action == 'Build_Image' or action == 'Build_Proxy' or action == "Build_Cluster_Image" or action == "Build_Run_Tests": RAN.Build_eNB_args=test.findtext('Build_eNB_args') CONTAINERS.imageKind=test.findtext('kind') @@ -139,6 +148,23 @@ def GetParametersFromXML(action): proxy_commit = test.findtext('proxy_commit') if proxy_commit is not None: CONTAINERS.proxyCommit = proxy_commit + if action == 'Build_eNB': + RAN.BuildeNB(HTML) + elif action == 'Build_Image': + success = CONTAINERS.BuildImage(HTML) + if not success: + RAN.prematureExit = True + elif action == 'Build_Proxy': + success = CONTAINERS.BuildProxy(HTML) + if not success: + RAN.prematureExit = True + elif action == 'Build_Cluster_Image': + if not CLUSTER.BuildClusterImage(HTML): + RAN.prematureExit = True + elif action == 'Build_Run_Tests': + success = CONTAINERS.BuildRunTests(HTML) + if not success: + RAN.prematureExit = True elif action == 'Initialize_eNB': RAN.eNB_Trace=test.findtext('eNB_Trace') @@ -174,6 +200,7 @@ def GetParametersFromXML(action): cmd_prefix = test.findtext('cmd_prefix') if cmd_prefix is not None: RAN.cmd_prefix = cmd_prefix + RAN.InitializeeNB(HTML, EPC) elif action == 'Terminate_eNB': eNB_instance=test.findtext('eNB_instance') @@ -201,6 +228,7 @@ def GetParametersFromXML(action): RAN.air_interface[RAN.eNB_instance] = 'lte-softmodem' else: RAN.air_interface[RAN.eNB_instance] = air_interface.lower() +'-softmodem' + RAN.TerminateeNB(HTML, EPC) elif action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Terminate_UE' or action == 'CheckStatusUE' or action == 'DataEnable_UE' or action == 'DataDisable_UE': CiTestObj.ue_ids = test.findtext('id').split(' ') @@ -211,6 +239,20 @@ def GetParametersFromXML(action): sys.exit("Mismatch in number of Nodes and UIs") else: CiTestObj.nodes = [None] * len(CiTestObj.ue_ids) + if action == 'Initialize_UE': + CiTestObj.InitializeUE(HTML) + elif action == 'Attach_UE': + CiTestObj.AttachUE(HTML, RAN, EPC, CONTAINERS) + elif action == 'Detach_UE': + CiTestObj.DetachUE(HTML) + elif action == 'Terminate_UE': + CiTestObj.TerminateUE(HTML) + elif action == 'CheckStatusUE': + CiTestObj.CheckStatusUE(HTML) + elif action == 'DataEnable_UE': + CiTestObj.DataEnableUE(HTML) + elif action == 'DataDisable_UE': + CiTestObj.DataDisableUE(HTML) elif action == 'Ping': CiTestObj.ping_args = test.findtext('ping_args') @@ -224,6 +266,7 @@ def GetParametersFromXML(action): else: CiTestObj.nodes = [None] * len(CiTestObj.ue_ids) ping_rttavg_threshold = test.findtext('ping_rttavg_threshold') or '' + CiTestObj.Ping(HTML,RAN,EPC,CONTAINERS) elif action == 'Iperf' or action == 'Iperf2_Unidir': CiTestObj.iperf_args = test.findtext('iperf_args') @@ -249,14 +292,10 @@ def GetParametersFromXML(action): if CiTestObj.iperf_options != 'check' and CiTestObj.iperf_options != 'sink': logging.error('test-case has wrong option ' + CiTestObj.iperf_options) CiTestObj.iperf_options = 'check' - - elif action == 'Iperf2_Unidir': - CiTestObj.iperf_args = test.findtext('iperf_args') - CiTestObj.ue_ids = test.findtext('id').split(' ') - CiTestObj.svr_id = test.findtext('svr_id') or None - CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold') - CiTestObj.iperf_bitrate_threshold = test.findtext('iperf_bitrate_threshold') or '90' - CiTestObj.iperf_profile = test.findtext('iperf_profile') or 'balanced' + if action == 'Iperf': + CiTestObj.Iperf(HTML,RAN,EPC,CONTAINERS) + elif action == 'Iperf2_Unidir': + CiTestObj.Iperf2_Unidir(HTML,RAN,EPC,CONTAINERS) elif action == 'IdleSleep': string_field = test.findtext('idle_sleep_time_in_sec') @@ -264,6 +303,7 @@ def GetParametersFromXML(action): CiTestObj.idle_sleep_time = 5 else: CiTestObj.idle_sleep_time = int(string_field) + CiTestObj.IdleSleep(HTML) elif action == 'Build_PhySim': ldpc.buildargs = test.findtext('physim_build_args') @@ -275,33 +315,54 @@ def GetParametersFromXML(action): ldpc.forced_workspace_cleanup=True else: ldpc.forced_workspace_cleanup=False + HTML=ldpc.Build_PhySim(HTML,CONST) + if ldpc.exitStatus==1: + RAN.prematureExit = True + + elif action == 'Deploy_Run_PhySim': + PHYSIM.Deploy_PhySim(HTML, RAN) elif action == 'Initialize_MME': string_field = test.findtext('option') if (string_field is not None): EPC.mmeConfFile = string_field + EPC.InitializeMME(HTML) elif action == 'Initialize_HSS' or action == 'Initialize_SPGW': - pass + if action == 'Initialize_HSS': + EPC.InitializeHSS(HTML) + elif action == 'Initialize_SPGW': + EPC.InitializeSPGW(HTML) elif action == 'Terminate_HSS' or action == 'Terminate_MME' or action == 'Terminate_SPGW': - pass + if action == 'Terminate_HSS': + EPC.TerminateHSS(HTML) + elif action == 'Terminate_MME': + EPC.TerminateMME(HTML) + elif action == 'Terminate_SPGW': + EPC.TerminateSPGW(HTML) elif action == 'Deploy_EPC': string_field = test.findtext('parameters') if (string_field is not None): EPC.yamlPath = string_field + EPC.DeployEpc(HTML) + + elif action == 'Undeploy_EPC': + EPC.UndeployEpc(HTML) elif action == 'Initialize_5GCN': string_field = test.findtext('args') if (string_field is not None): EPC.cfgDeploy = string_field EPC.cnID = test.findtext('cn_id') + EPC.Initialize5GCN(HTML) elif action == 'Terminate_5GCN': string_field = test.findtext('args') if (string_field is not None): EPC.cfgUnDeploy = string_field EPC.cnID = test.findtext('cn_id') + EPC.Terminate5GCN(HTML) elif action == 'Deploy_Object' or action == 'Undeploy_Object' or action == "Create_Workspace": eNB_instance=test.findtext('eNB_instance') @@ -326,22 +387,47 @@ def GetParametersFromXML(action): string_field = test.findtext('services') if string_field is not None: CONTAINERS.services[CONTAINERS.eNB_instance] = string_field + if action == 'Deploy_Object': + CONTAINERS.DeployObject(HTML) + if CONTAINERS.exitStatus==1: + CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) + RAN.prematureExit = True + elif action == 'Undeploy_Object': + CONTAINERS.UndeployObject(HTML, RAN) + if CONTAINERS.exitStatus == 1: + CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) + RAN.prematureExit = True + elif action == 'Create_Workspace': + CONTAINERS.Create_Workspace(HTML) elif action == 'Run_CUDATest' or action == 'Run_NRulsimTest' or action == 'Run_T2Test': ldpc.runargs = test.findtext('physim_run_args') ldpc.runsim = test.findtext('physim_run') ldpc.timethrs = test.findtext('physim_time_threshold') + if action == 'Run_CUDATest': + HTML=ldpc.Run_CUDATest(HTML,CONST,id) + elif action == 'Run_NRulsimTest': + HTML=ldpc.Run_NRulsimTest(HTML,CONST,id) + elif action == 'Run_T2Test': + HTML=ldpc.Run_T2Test(HTML,CONST,id) + if ldpc.exitStatus==1: + RAN.prematureExit = True elif action == 'LicenceAndFormattingCheck': - pass + ret = SCA.LicenceAndFormattingCheck(HTML) + if ret != 0: + RAN.prematureExit = True elif action == 'Cppcheck_Analysis': - pass + SCA.CppCheckAnalysis(HTML) elif action == 'Push_Local_Registry': string_field = test.findtext('registry_svr_id') if (string_field is not None): CONTAINERS.registrySvrId = string_field + success = CONTAINERS.Push_Image_to_Local_Registry(HTML) + if not success: + RAN.prematureExit = True elif action == 'Pull_Local_Registry': string_field = test.findtext('test_svr_id') @@ -351,15 +437,24 @@ def GetParametersFromXML(action): string_field = test.findtext('images_to_pull') if (string_field is not None): CONTAINERS.imageToPull = string_field.split() + success = CONTAINERS.Pull_Image_from_Local_Registry(HTML) + if not success: + RAN.prematureExit = True elif action == 'Clean_Test_Server_Images': string_field = test.findtext('test_svr_id') if (string_field is not None): CONTAINERS.testSvrId = string_field + success = CONTAINERS.Clean_Test_Server_Images(HTML) + if not success: + RAN.prematureExit = True + elif action == 'Custom_Command': RAN.node = test.findtext('node') RAN.command = test.findtext('command') RAN.command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes'] + RAN.CustomCommand(HTML) + elif action == 'Pull_Cluster_Image': string_field = test.findtext('images_to_pull') if (string_field is not None): @@ -367,8 +462,11 @@ def GetParametersFromXML(action): string_field = test.findtext('test_svr_id') if (string_field is not None): CLUSTER.testSvrId = string_field + if not CLUSTER.PullClusterImage(HTML,RAN): + RAN.prematureExit = True + else: - logging.warning(f"unknown action {action} from option-parsing point-of-view") + logging.warning(f"unknown action {action}, skip step") #check if given test is in list @@ -672,136 +770,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if (CheckClassValidity(xml_class_list, action, id) == False): continue CiTestObj.ShowTestID() - GetParametersFromXML(action) try: - if action == 'Build_eNB': - RAN.BuildeNB(HTML) - elif action == 'Custom_Command': - RAN.CustomCommand(HTML) - if RAN.prematureExit: - CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) - elif action == 'Initialize_eNB': - RAN.InitializeeNB(HTML, EPC) - if RAN.prematureExit: - CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) - elif action == 'Terminate_eNB': - RAN.TerminateeNB(HTML, EPC) - elif action == 'Initialize_UE': - CiTestObj.InitializeUE(HTML) - elif action == 'Terminate_UE': - CiTestObj.TerminateUE(HTML) - elif action == 'Attach_UE': - CiTestObj.AttachUE(HTML, RAN, EPC, CONTAINERS) - elif action == 'Detach_UE': - CiTestObj.DetachUE(HTML) - elif action == 'DataDisable_UE': - CiTestObj.DataDisableUE(HTML) - elif action == 'DataEnable_UE': - CiTestObj.DataEnableUE(HTML) - elif action == 'CheckStatusUE': - CiTestObj.CheckStatusUE(HTML) - elif action == 'Ping': - CiTestObj.Ping(HTML,RAN,EPC,CONTAINERS) - elif action == 'Iperf': - CiTestObj.Iperf(HTML,RAN,EPC,CONTAINERS) - elif action == 'Iperf2_Unidir': - CiTestObj.Iperf2_Unidir(HTML,RAN,EPC,CONTAINERS) - elif action == 'Initialize_HSS': - EPC.InitializeHSS(HTML) - elif action == 'Terminate_HSS': - EPC.TerminateHSS(HTML) - elif action == 'Initialize_MME': - EPC.InitializeMME(HTML) - elif action == 'Terminate_MME': - EPC.TerminateMME(HTML) - elif action == 'Initialize_SPGW': - EPC.InitializeSPGW(HTML) - elif action == 'Terminate_SPGW': - EPC.TerminateSPGW(HTML) - elif action == 'Initialize_5GCN': - EPC.Initialize5GCN(HTML) - elif action == 'Terminate_5GCN': - EPC.Terminate5GCN(HTML) - elif action == 'Deploy_EPC': - EPC.DeployEpc(HTML) - elif action == 'Undeploy_EPC': - EPC.UndeployEpc(HTML) - elif action == 'IdleSleep': - CiTestObj.IdleSleep(HTML) - elif action == 'Build_PhySim': - HTML=ldpc.Build_PhySim(HTML,CONST) - if ldpc.exitStatus==1: - RAN.prematureExit = True - elif action == 'Run_CUDATest': - HTML=ldpc.Run_CUDATest(HTML,CONST,id) - if ldpc.exitStatus==1: - RAN.prematureExit = True - elif action == 'Run_T2Test': - HTML=ldpc.Run_T2Test(HTML,CONST,id) - if ldpc.exitStatus==1: - RAN.prematureExit = True - elif action == 'Run_NRulsimTest': - HTML=ldpc.Run_NRulsimTest(HTML,CONST,id) - if ldpc.exitStatus==1: - RAN.prematureExit = True - elif action == 'Pull_Cluster_Image': - if not CLUSTER.PullClusterImage(HTML,RAN): - RAN.prematureExit = True - elif action == 'Build_Cluster_Image': - if not CLUSTER.BuildClusterImage(HTML): - RAN.prematureExit = True - elif action == 'Build_Image': - success = CONTAINERS.BuildImage(HTML) - if not success: - RAN.prematureExit = True - elif action == 'Build_Run_Tests': - success = CONTAINERS.BuildRunTests(HTML) - if not success: - RAN.prematureExit = True - elif action == 'Build_Proxy': - success = CONTAINERS.BuildProxy(HTML) - if not success: - RAN.prematureExit = True - elif action == 'Push_Local_Registry': - success = CONTAINERS.Push_Image_to_Local_Registry(HTML) - if not success: - RAN.prematureExit = True - elif action == 'Pull_Local_Registry': - success = CONTAINERS.Pull_Image_from_Local_Registry(HTML) - if not success: - RAN.prematureExit = True - elif action == 'Clean_Test_Server_Images': - success = CONTAINERS.Clean_Test_Server_Images(HTML) - if not success: - RAN.prematureExit = True - elif action == 'Create_Workspace': - CONTAINERS.Create_Workspace(HTML) - elif action == 'Deploy_Object': - CONTAINERS.DeployObject(HTML) - if CONTAINERS.exitStatus==1: - CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) - RAN.prematureExit = True - elif action == 'Undeploy_Object': - CONTAINERS.UndeployObject(HTML, RAN) - if CONTAINERS.exitStatus == 1: - CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) - RAN.prematureExit = True - elif action == 'Cppcheck_Analysis': - SCA.CppCheckAnalysis(HTML) - elif action == 'LicenceAndFormattingCheck': - ret = SCA.LicenceAndFormattingCheck(HTML) - if ret != 0: - RAN.prematureExit = True - elif action == 'Deploy_Run_PhySim': - PHYSIM.Deploy_PhySim(HTML, RAN) - elif action == 'IperfFromContainer': - CONTAINERS.IperfFromContainer(HTML, RAN, CiTestObj) - if CONTAINERS.exitStatus==1: - RAN.prematureExit = True - elif action == 'Push_Images_To_Test_Servers': - logging.debug('To be implemented') - else: - sys.exit('Invalid class (action) from xml') + ExecuteActionWithParam(action) + if RAN.prematureExit: + CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) except Exception as e: s = traceback.format_exc() logging.error(f'while running CI, an exception occurred:\n{s}') From 77a8f5fa991b15705804a12850104b1da299f5fa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 12:49:07 +0200 Subject: [PATCH 64/87] Basic test runner script --- ci-scripts/tests/README.md | 9 +++++ ci-scripts/tests/test-runner/run.sh | 49 +++++++++++++++++++++++++++ ci-scripts/tests/test-runner/test.xml | 41 ++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100755 ci-scripts/tests/test-runner/run.sh create mode 100644 ci-scripts/tests/test-runner/test.xml diff --git a/ci-scripts/tests/README.md b/ci-scripts/tests/README.md index 2fd3a45e70..1083f78e61 100644 --- a/ci-scripts/tests/README.md +++ b/ci-scripts/tests/README.md @@ -11,3 +11,12 @@ start with python tests/iperf-analysis.py -v It will indicate if all tests passed. + +# test-runner test + +This is not a true test, because the results need to be manually inspected. To +run this "test", run + + ./run.sh + +inside the `test-runner/` directory (important!). diff --git a/ci-scripts/tests/test-runner/run.sh b/ci-scripts/tests/test-runner/run.sh new file mode 100755 index 0000000000..40d0289453 --- /dev/null +++ b/ci-scripts/tests/test-runner/run.sh @@ -0,0 +1,49 @@ +#/bin/bash + +branch=$(git rev-parse --abbrev-ref HEAD) +commit=$(git rev-parse HEAD) +file=../../test_results.html +rm -f ${file} + +cd ../../ +python3 main.py \ + --mode=InitiateHtml \ + --ranRepository=https://gitlab.eurecom.fr/oai/openairinterface5g.git \ + --ranBranch=${branch} \ + --ranCommitID=${commit} \ + --ranAllowMerge=true \ + --ranTargetBranch=develop \ + --XMLTestFile=tests/test-runner/test.xml + +python3 main.py \ + --mode=TesteNB \ + --ranRepository=https://gitlab.eurecom.fr/oai/openairinterface5g.git \ + --ranBranch=${branch} \ + --ranCommitID=${commit} \ + --ranAllowMerge=true \ + --ranTargetBranch=develop \ + --eNBIPAddress=localhost \ + --eNBUserName=NONE \ + --eNBPassword=NONE \ + --eNBSourceCodePath=NONE \ + --UEIPAddress=localhost \ + --UEUserName=NONE \ + --UEPassword=NONE \ + --UESourceCodePath=NONE \ + --EPCIPAddress=localhost \ + --EPCType=OAI \ + --EPCUserName=NONE \ + --EPCPassword=NONE \ + --EPCSourceCodePath=NONE \ + --XMLTestFile=tests/test-runner/test.xml + +python3 main.py \ + --mode=FinalizeHtml \ + --finalStatus=true +cd - + +if [ -f ${file} ]; then + echo "results are in ${file}" +else + echo "ERROR: no results file created" +fi diff --git a/ci-scripts/tests/test-runner/test.xml b/ci-scripts/tests/test-runner/test.xml new file mode 100644 index 0000000000..e4b2f24d26 --- /dev/null +++ b/ci-scripts/tests/test-runner/test.xml @@ -0,0 +1,41 @@ + + + + test + Manual testing + wrench + 1 + + 000001 + + + + + Custom_Command + This should succeed + localhost + true + yes + + From 61ea76e7af650163f9f1fc8bc7330d3bf3744a0a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 12:51:44 +0200 Subject: [PATCH 65/87] Remove CI repeatCount XML property The repeatCount property is useless: it would be enough to specify the same XML multiple times to achieve the same thing. --- ci-scripts/cls_oai_html.py | 8 --- ci-scripts/cls_oaicitest.py | 2 - ci-scripts/main.py | 66 ++++++++----------- ci-scripts/tests/test-runner/test.xml | 1 - .../xml_files/container_4g_l2sim_proxy.xml | 1 - .../xml_files/container_4g_l2sim_tdd.xml | 1 - .../container_4g_rfsim_tdd_05MHz.xml | 1 - .../xml_files/container_5g_fdd_rfsim.xml | 1 - .../xml_files/container_5g_l2sim_tdd.xml | 1 - ci-scripts/xml_files/container_5g_rfsim.xml | 1 - .../xml_files/container_5g_rfsim_24prb.xml | 1 - .../xml_files/container_5g_rfsim_2x2.xml | 1 - .../container_5g_rfsim_fdd_phytest.xml | 1 - .../container_5g_rfsim_fr2_32prb.xml | 1 - .../xml_files/container_5g_rfsim_ntn_geo.xml | 1 - .../xml_files/container_5g_rfsim_sidelink.xml | 1 - .../xml_files/container_5g_rfsim_tdd_dora.xml | 1 - .../xml_files/container_5g_rfsim_u0_25prb.xml | 1 - .../xml_files/container_l2sim_proxy.xml | 1 - .../container_lte_n3xx_tdd_2x2_tm1.xml | 1 - .../container_lte_n3xx_tdd_2x2_tm2.xml | 1 - .../xml_files/container_nsa_b200_quectel.xml | 1 - .../container_nsa_b200_terminate.xml | 1 - .../xml_files/container_sa_aerial_quectel.xml | 1 - .../xml_files/container_sa_aw2s_asue.xml | 1 - .../xml_files/container_sa_b200_quectel.xml | 1 - .../xml_files/container_sa_b200_terminate.xml | 1 - .../container_sa_e1_b200_quectel.xml | 1 - .../container_sa_e1_b200_terminate.xml | 1 - .../container_sa_f1_b200_quectel.xml | 1 - .../container_sa_f1_b200_terminate.xml | 1 - .../xml_files/container_sa_fhi72_vvdn_up2.xml | 1 - .../container_sa_n310_2X2_100MHz_quectel.xml | 1 - .../container_sa_n310_2X2_60MHz_quectel.xml | 1 - .../xml_files/container_sa_n310_nrue.xml | 1 - .../container_sa_sc_b200_quectel.xml | 1 - .../container_sa_sc_b200_terminate.xml | 1 - ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 1 - .../fr1_nsa_2x2_quectel_attach_detach.xml | 1 - ci-scripts/xml_files/fr1_nsa_quectel.xml | 1 - .../fr1_nsa_quectel_attach_detach.xml | 1 - ci-scripts/xml_files/fr1_nsa_quectel_long.xml | 1 - ci-scripts/xml_files/gnb_phytest_usrp_run.xml | 1 - .../gnb_phytest_usrp_run_100_2x2.xml | 1 - .../xml_files/gnb_phytest_usrp_run_60.xml | 1 - .../xml_files/gnb_phytest_usrp_run_60_2x2.xml | 1 - ci-scripts/xml_files/gnb_usrp_build.xml | 1 - ci-scripts/xml_files/ldpc_gpu_test.xml | 1 - ci-scripts/xml_files/physim_build_source.xml | 1 - .../xml_files/t2_offload_dec_nr_ulsim.xml | 1 - .../xml_files/t2_offload_enc_nr_dlsim.xml | 1 - 51 files changed, 29 insertions(+), 95 deletions(-) diff --git a/ci-scripts/cls_oai_html.py b/ci-scripts/cls_oai_html.py index b927373124..dc2c3bf5c6 100644 --- a/ci-scripts/cls_oai_html.py +++ b/ci-scripts/cls_oai_html.py @@ -265,14 +265,6 @@ class HTMLManagement(): self.htmlFile.write('\n') self.htmlFile.close() - def CreateHtmlRetrySeparator(self, cntnumfails): - if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): - self.htmlFile = open('test_results.html', 'a') - self.htmlFile.write(' \n') - self.htmlFile.write(' ---- Try Run #' + str(cntnumfails) + ' ---- \n') - self.htmlFile.write(' \n') - self.htmlFile.close() - def CreateHtmlTestRow(self, options, status, processesStatus, machine='eNB'): if (self.htmlFooterCreated or (not self.htmlHeaderCreated)): return diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index fdc049be5d..bc98c9e829 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -232,7 +232,6 @@ class OaiCiTest(): self.ranAllowMerge = False self.ranTargetBranch = '' - self.FailReportCnt = 0 self.testCase_id = '' self.testXMLfiles = [] self.desc = '' @@ -246,7 +245,6 @@ class OaiCiTest(): self.iperf_options = '' self.iperf_tcp_rate_target = '' self.idle_sleep_time = 0 - self.repeatCounts = [] self.finalStatus = False self.UEIPAddress = '' self.UEUserName = '' diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 61cf3d1ce5..808c5cafba 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -680,8 +680,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if (HTML.nbTestXMLfiles == 1): HTML.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-0')) HTML.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-0')) - repeatCount = xmlRoot.findtext('repeatCount',default='1') - CiTestObj.repeatCounts.append(int(repeatCount)) all_tests=xmlRoot.findall('testCase') exclusion_tests=exclusion_tests.split() @@ -744,48 +742,42 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if CONTAINERS.eNB1IPAddress == '172.21.16.137': CONTAINERS.CheckAndAddRoute('nepes', CONTAINERS.eNB1IPAddress, CONTAINERS.eNB1UserName, CONTAINERS.eNB1Password) - CiTestObj.FailReportCnt = 0 - RAN.prematureExit=True + RAN.prematureExit=False HTML.startTime=int(round(time.time() * 1000)) - while CiTestObj.FailReportCnt < CiTestObj.repeatCounts[0] and RAN.prematureExit: - RAN.prematureExit=False - # At every iteration of the retry loop, a separator will be added - # pass CiTestObj.FailReportCnt as parameter of HTML.CreateHtmlRetrySeparator - HTML.CreateHtmlRetrySeparator(CiTestObj.FailReportCnt) - for test_case_id in todo_tests: + + for test_case_id in todo_tests: + for test in all_tests: if RAN.prematureExit: break - for test in all_tests: + id = test.get('id') + if test_case_id != id: + continue + CiTestObj.testCase_id = id + HTML.testCase_id=CiTestObj.testCase_id + EPC.testCase_id=CiTestObj.testCase_id + CiTestObj.desc = test.findtext('desc') + HTML.desc=CiTestObj.desc + action = test.findtext('class') + if (CheckClassValidity(xml_class_list, action, id) == False): + continue + CiTestObj.ShowTestID() + try: + ExecuteActionWithParam(action) if RAN.prematureExit: - break - id = test.get('id') - if test_case_id != id: - continue - CiTestObj.testCase_id = id - HTML.testCase_id=CiTestObj.testCase_id - EPC.testCase_id=CiTestObj.testCase_id - CiTestObj.desc = test.findtext('desc') - HTML.desc=CiTestObj.desc - action = test.findtext('class') - if (CheckClassValidity(xml_class_list, action, id) == False): - continue - CiTestObj.ShowTestID() - try: - ExecuteActionWithParam(action) - if RAN.prematureExit: - CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) - except Exception as e: - s = traceback.format_exc() - logging.error(f'while running CI, an exception occurred:\n{s}') - HTML.CreateHtmlTestRowQueue("N/A", 'KO', [f"CI test code encountered an exception:\n{s}"]) - RAN.prematureExit = True - CiTestObj.FailReportCnt += 1 - if CiTestObj.FailReportCnt == CiTestObj.repeatCounts[0] and RAN.prematureExit: - logging.error('\u001B[1;37;41mScenario failed ' + str(CiTestObj.FailReportCnt) + ' time(s)\u001B[0m') + CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) + except Exception as e: + s = traceback.format_exc() + logging.error(f'while running CI, an exception occurred:\n{s}') + HTML.CreateHtmlTestRowQueue("N/A", 'KO', [f"CI test code encountered an exception:\n{s}"]) + RAN.prematureExit = True + break + + if RAN.prematureExit: + logging.error('\u001B[1;37;41mScenario failed\u001B[0m') HTML.CreateHtmlTabFooter(False) sys.exit('Failed Scenario') else: - logging.info('\u001B[1;37;42mScenario passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)\u001B[0m') + logging.info('\u001B[1;37;42mScenario passed\u001B[0m') HTML.CreateHtmlTabFooter(True) elif re.match('^LoadParams$', mode, re.IGNORECASE): pass diff --git a/ci-scripts/tests/test-runner/test.xml b/ci-scripts/tests/test-runner/test.xml index e4b2f24d26..e1aadffb9e 100644 --- a/ci-scripts/tests/test-runner/test.xml +++ b/ci-scripts/tests/test-runner/test.xml @@ -25,7 +25,6 @@ test Manual testing wrench - 1 000001 diff --git a/ci-scripts/xml_files/container_4g_l2sim_proxy.xml b/ci-scripts/xml_files/container_4g_l2sim_proxy.xml index 1d59868855..792f9939fb 100644 --- a/ci-scripts/xml_files/container_4g_l2sim_proxy.xml +++ b/ci-scripts/xml_files/container_4g_l2sim_proxy.xml @@ -24,7 +24,6 @@ l2sim-4glte-proxy-build Build L2sim proxy image wrench - 1 100001 000001 diff --git a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml index 1a0e2e89e3..2bd0c5fcf9 100644 --- a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml +++ b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml @@ -24,7 +24,6 @@ l2sim-4glte-tdd Testing 4G LTE L2 sim - FDD eNB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml index 94bc18dc5a..f7b1e50ebb 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -24,7 +24,6 @@ rfsim-4glte-tdd05mhz Monolithic eNB - TDD 05MHz wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index 4a677ee41f..e1aff907a9 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -24,7 +24,6 @@ rfsim-5gnr-fdd Monolithic FDD gNB with SDAP wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_l2sim_tdd.xml b/ci-scripts/xml_files/container_5g_l2sim_tdd.xml index d53e2a4932..bef0a13e2d 100644 --- a/ci-scripts/xml_files/container_5g_l2sim_tdd.xml +++ b/ci-scripts/xml_files/container_5g_l2sim_tdd.xml @@ -24,7 +24,6 @@ l2sim-5gnr-tdd Testing 5G NR L2 sim - TDD gNB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index 2145207318..0e1b1d3710 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -24,7 +24,6 @@ rfsim-5gnr-tdd Monolithic SA TDD gNB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml index 6f4d800d4d..f25928ab32 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml @@ -24,7 +24,6 @@ rfsim-24prb-5gnr-tdd Monolithic SA TDD gNB 24PRB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml index 6e1dbef31d..7826a6e818 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml @@ -24,7 +24,6 @@ rfsim-5gnr-tdd-2x2 Monolithic SA TDD 2x2 gNB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml index 464197ef7a..c7d1824b4c 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml @@ -24,7 +24,6 @@ rfsim-5gnr-fdd-phytest Monolithic FDD phytest gNB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml index 9d1253b31f..311ec9b0bc 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml @@ -24,7 +24,6 @@ rfsim-fr2-32prb-5gnr-tdd Monolithic FR2 gNB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml index 0b72888889..9966bd0e90 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml @@ -24,7 +24,6 @@ rfsim-5gnr-ntn-geo Monolithic SA NTN GEO gNB wrench - 1 111111 100001 diff --git a/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml b/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml index daa1152722..8f1039f5cd 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml @@ -24,7 +24,6 @@ rfsim-5gnr-sidelink Sidelink test wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml index a6b754dacb..a169c78528 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml @@ -24,7 +24,6 @@ rfsim-tdd-dora-5gnr-tdd Monolithic do-ra TDD gNB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml index 6d5d99f595..51b59d35f1 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml @@ -24,7 +24,6 @@ rfsim-5gnr-fdd-u0-25prb Monolithic SA FDD u0 25PRB gNB wrench - 1 111111 800813 diff --git a/ci-scripts/xml_files/container_l2sim_proxy.xml b/ci-scripts/xml_files/container_l2sim_proxy.xml index 2f938ab8e5..59b09d3ef5 100644 --- a/ci-scripts/xml_files/container_l2sim_proxy.xml +++ b/ci-scripts/xml_files/container_l2sim_proxy.xml @@ -24,7 +24,6 @@ l2sim-4glte-5gnr-proxy-build Build L2sim proxy image wrench - 1 100001 000001 diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml index e7f7549a46..8316645417 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml @@ -25,7 +25,6 @@ TEST-LTE-2x2-N3XX-TM1 2.6 Ghz TDD LTE 2x2 TM1 tasks - 1 111111 diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml index 3792b673d5..96baab0793 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml @@ -25,7 +25,6 @@ TEST-LTE-2x2-N3XXi-TM2 2.6 Ghz TDD LTE 2x2 TM2 tasks - 1 111111 diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 037ca1dc8c..de6098209f 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -24,7 +24,6 @@ TEST-NSA-FR1-TM1-B200 NSA SanityCheck with QUECTEL tasks - 1 200000 100000 diff --git a/ci-scripts/xml_files/container_nsa_b200_terminate.xml b/ci-scripts/xml_files/container_nsa_b200_terminate.xml index c76e3c5891..b470cfb8b4 100644 --- a/ci-scripts/xml_files/container_nsa_b200_terminate.xml +++ b/ci-scripts/xml_files/container_nsa_b200_terminate.xml @@ -24,7 +24,6 @@ TEST-NSA-FR1-TM1-B200-terminate NSA tear-down in case of problem tasks - 1 010001 010002 diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel.xml b/ci-scripts/xml_files/container_sa_aerial_quectel.xml index 877b694e61..50a1a02256 100644 --- a/ci-scripts/xml_files/container_sa_aerial_quectel.xml +++ b/ci-scripts/xml_files/container_sa_aerial_quectel.xml @@ -24,7 +24,6 @@ TEST-AERIAL-SA AERIAL 100 MHz TDD SA tasks - 1 111111 000222 diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue.xml b/ci-scripts/xml_files/container_sa_aw2s_asue.xml index 0f96abaee8..4900330911 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue.xml @@ -24,7 +24,6 @@ TEST-5G-AW2S 20 MHz TDD SA tasks - 1 010000 001000 diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml index 4b6575df5f..acc9e15e5c 100644 --- a/ci-scripts/xml_files/container_sa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-B200 20 MHz TDD SA tasks - 1 100000 111111 diff --git a/ci-scripts/xml_files/container_sa_b200_terminate.xml b/ci-scripts/xml_files/container_sa_b200_terminate.xml index 26836fb096..2d7872e8d8 100644 --- a/ci-scripts/xml_files/container_sa_b200_terminate.xml +++ b/ci-scripts/xml_files/container_sa_b200_terminate.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-B200-terminate Tear-down tasks - 1 010001 010002 diff --git a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml index 963ab9981f..f31ef7e7eb 100644 --- a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-F1-E1-B200 40 MHz TDD F1+E1 SA tasks - 1 333333 300000 diff --git a/ci-scripts/xml_files/container_sa_e1_b200_terminate.xml b/ci-scripts/xml_files/container_sa_e1_b200_terminate.xml index ae61c1b6ce..811b047a4a 100644 --- a/ci-scripts/xml_files/container_sa_e1_b200_terminate.xml +++ b/ci-scripts/xml_files/container_sa_e1_b200_terminate.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-F1-E1-B200-terminate Tear-down tasks - 1 010001 010002 diff --git a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml index 5f4a09dd83..1b3c9baa33 100644 --- a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-F1-B200 10 MHz FDD F1 SA tasks - 1 100000 110002 diff --git a/ci-scripts/xml_files/container_sa_f1_b200_terminate.xml b/ci-scripts/xml_files/container_sa_f1_b200_terminate.xml index df02f63b7f..92e5472c85 100644 --- a/ci-scripts/xml_files/container_sa_f1_b200_terminate.xml +++ b/ci-scripts/xml_files/container_sa_f1_b200_terminate.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-F1-B200-terminate Tear-down tasks - 1 010001 010002 diff --git a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml index 2b3b02fb2b..3d2a7a9387 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml @@ -24,7 +24,6 @@ test-5g-fhi72-vvdn 100 MHz TDD SA VVDN tasks - 1 200000 110000 diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml index 643f0a0ab0..272582a46e 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-N310-2x2-100MHz 100 MHz TDD SA 2x2 tasks - 1 100000 111111 diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml index c5b12e7ac3..4c619255f1 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-N310-2x2-60MHz 60 MHz 2x2 TDD SA tasks - 1 100000 111111 diff --git a/ci-scripts/xml_files/container_sa_n310_nrue.xml b/ci-scripts/xml_files/container_sa_n310_nrue.xml index 92be5590b3..a44c703322 100644 --- a/ci-scripts/xml_files/container_sa_n310_nrue.xml +++ b/ci-scripts/xml_files/container_sa_n310_nrue.xml @@ -24,7 +24,6 @@ TEST-5G-NRUE 40 MHz TDD SA tasks - 1 010000 010001 800813 diff --git a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml index fd59e20574..425edc12ee 100644 --- a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-SC-FDMA-B200 40 MHz TDD SA with SC-FDMA tasks - 1 300000 311111 diff --git a/ci-scripts/xml_files/container_sa_sc_b200_terminate.xml b/ci-scripts/xml_files/container_sa_sc_b200_terminate.xml index f47c16258f..9db4c663f0 100644 --- a/ci-scripts/xml_files/container_sa_sc_b200_terminate.xml +++ b/ci-scripts/xml_files/container_sa_sc_b200_terminate.xml @@ -24,7 +24,6 @@ TEST-SA-FR1-B200-terminate Tear-down tasks - 1 010001 010002 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 5ca01a196e..20f502e9ac 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -24,7 +24,6 @@ TEST-NSA-FR1-TM2-Tab1 NSA 2x2 Ping DL UL with QUECTEL tasks - 1 100000 700000 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index f859cd1be9..b089d1d75c 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -24,7 +24,6 @@ TEST-NSA-FR1-TM2-Tab2 NSA 2x2 Attach-Detach with QUECTEL tasks - 1 100000 300000 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 1a08d33ecf..142e4014dd 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -24,7 +24,6 @@ TEST-NSA-FR1-TM1 NSA Ping DL UL with QUECTEL tasks - 1 100000 200000 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml index 261e2623dd..df8b1c049d 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml @@ -24,7 +24,6 @@ TEST-NSA-FR1-TM1 NSA Ping Attach Detach with QUECTEL tasks - 1 030000 040000 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml index cccbd3fa41..05fbcc4ab6 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml @@ -24,7 +24,6 @@ TEST-NSA-FR1-TM1 NSA Ping DL UL with QUECTEL (Longer) tasks - 1 030000 040000 diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml index 83e7d23f04..3bf54786b5 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml @@ -24,7 +24,6 @@ gNB-PHY-Test-40 Timing phytest 40 MHz tasks - 1 100000 090101 000001 090109 200000 diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_100_2x2.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_100_2x2.xml index fdad18d099..daea0f4456 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_100_2x2.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_100_2x2.xml @@ -24,7 +24,6 @@ gNB-PHY-Test-100-2x2 Timing phytest 100 MHz 2x2 tasks - 1 100000 390101 000001 390109 200000 diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml index 31be6e8ac4..b436e79b17 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml @@ -24,7 +24,6 @@ gNB-PHY-Test-60 Timing phytest 60 MHz tasks - 1 100000 190101 000001 190109 200000 diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml index 09dbbd7757..e6aeb6cdee 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml @@ -24,7 +24,6 @@ gNB-PHY-Test-60-2x2 Timing phytest 60 MHz 2x2 tasks - 1 100000 290101 000001 290109 200000 diff --git a/ci-scripts/xml_files/gnb_usrp_build.xml b/ci-scripts/xml_files/gnb_usrp_build.xml index 769128967a..cabf602bf9 100644 --- a/ci-scripts/xml_files/gnb_usrp_build.xml +++ b/ci-scripts/xml_files/gnb_usrp_build.xml @@ -24,7 +24,6 @@ gnb-build-tab Build-gNB wrench - 1 100000 010101 diff --git a/ci-scripts/xml_files/ldpc_gpu_test.xml b/ci-scripts/xml_files/ldpc_gpu_test.xml index 78d147b2fa..d50a841b16 100644 --- a/ci-scripts/xml_files/ldpc_gpu_test.xml +++ b/ci-scripts/xml_files/ldpc_gpu_test.xml @@ -25,7 +25,6 @@ test-ldpc-gpu Test-ldpc-GPU tasks - 1 000002 000003 000004 000005 000006 000007 000008 000009 000010 000011 000012 000013 000014 000015 000016 000017 000018 000019 000020 000021 diff --git a/ci-scripts/xml_files/physim_build_source.xml b/ci-scripts/xml_files/physim_build_source.xml index f062ca53ce..7ba2a06800 100644 --- a/ci-scripts/xml_files/physim_build_source.xml +++ b/ci-scripts/xml_files/physim_build_source.xml @@ -23,7 +23,6 @@ build-offload Build physical simulators tasks - 1 000001 diff --git a/ci-scripts/xml_files/t2_offload_dec_nr_ulsim.xml b/ci-scripts/xml_files/t2_offload_dec_nr_ulsim.xml index 3b991bafe3..b7125f100b 100644 --- a/ci-scripts/xml_files/t2_offload_dec_nr_ulsim.xml +++ b/ci-scripts/xml_files/t2_offload_dec_nr_ulsim.xml @@ -23,7 +23,6 @@ test-t2-offload-dec Test T2 Offload Decoder tasks - 1 010111 010112 010121 010122 010131 010132 010211 010212 010221 010222 010231 010232 diff --git a/ci-scripts/xml_files/t2_offload_enc_nr_dlsim.xml b/ci-scripts/xml_files/t2_offload_enc_nr_dlsim.xml index debf1aebf1..9a9b7b2437 100644 --- a/ci-scripts/xml_files/t2_offload_enc_nr_dlsim.xml +++ b/ci-scripts/xml_files/t2_offload_enc_nr_dlsim.xml @@ -23,7 +23,6 @@ test-t2-offload-enc Test T2 Offload Encoder tasks - 1 000111 000112 000121 000122 000131 000132 000211 000212 000221 000222 000231 000232 From 71807db4ab7a5c0f4e325586da7e6e5130ec584f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 14:28:34 +0200 Subject: [PATCH 66/87] Custom_Command(): no need for class members --- ci-scripts/cls_oaicitest.py | 19 +++++++++++++++++++ ci-scripts/main.py | 8 ++++---- ci-scripts/ran.py | 21 --------------------- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index bc98c9e829..8364f9a7fa 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -220,6 +220,25 @@ def Iperf_analyzeV2UDP(server_filename, iperf_bitrate_threshold, iperf_packetlos pal_msg += f' (too high! >{self.iperf_packetloss_threshold}%)' return (result, f'{req_msg}\n{bir_msg}\n{brl_msg}\n{jit_msg}\n{pal_msg}') +def Custom_Command(HTML, node, command, command_fail): + logging.info(f"Executing custom command on {node}") + cmd = cls_cmd.getConnection(node) + ret = cmd.run(command) + cmd.close() + logging.debug(f"Custom_Command: {command} on node: {node} - {'OK, command succeeded' if ret.returncode == 0 else f'Error, return code: {ret.returncode}'}") + status = 'OK' + message = [] + if ret.returncode != 0 and not command_fail: + message = [ret.stdout] + logging.warning(f'Custom_Command output: {message}') + status = 'Warning' + if ret.returncode != 0 and command_fail: + message = [ret.stdout] + logging.error(f'Custom_Command failed: output: {message}') + status = 'KO' + HTML.CreateHtmlTestRowQueue(command, status, message) + return status == 'OK' or status == 'Warning' + #----------------------------------------------------------- # OaiCiTest Class Definition #----------------------------------------------------------- diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 808c5cafba..a36005cec6 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -450,10 +450,10 @@ def ExecuteActionWithParam(action): RAN.prematureExit = True elif action == 'Custom_Command': - RAN.node = test.findtext('node') - RAN.command = test.findtext('command') - RAN.command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes'] - RAN.CustomCommand(HTML) + node = test.findtext('node') + command = test.findtext('command') + command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes'] + cls_oaicitest.Custom_Command(HTML, node, command, command_fail) elif action == 'Pull_Cluster_Image': string_field = test.findtext('images_to_pull') diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 56424c4f25..f64250d12d 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -224,27 +224,6 @@ class RANManagement(): mySSH.close() self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id, HTML) - def CustomCommand(self, HTML): - logging.info(f"Executing custom command on {self.node}") - cmd = cls_cmd.getConnection(self.node) - ret = cmd.run(self.command) - cmd.close() - logging.debug(f"CustomCommand: {self.command} on node: {self.node} - {'OK, command succeeded' if ret.returncode == 0 else f'Error, return code: {ret.returncode}'}") - status = 'OK' - message = [] - if ret.returncode != 0 and not self.command_fail: - message = [ret.stdout] - logging.warning(f'CustomCommand output: {message}') - status = 'Warning' - if self.command_fail: # important command since it would make the pipeline fail, so show output in HTML - message = [ret.stdout] - if ret.returncode != 0 and self.command_fail: - message = [ret.stdout] - logging.error(f'CustomCommand failed: output: {message}') - status = 'KO' - self.prematureExit = True - HTML.CreateHtmlTestRowQueue(self.command, status, message) - def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId, HTML): HTML.testCase_id=testcaseId From e969ddb8973888bb0728550b5db3daf1cc708e5a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 14:41:17 +0200 Subject: [PATCH 67/87] IdleSleep(): no need for class members --- ci-scripts/cls_oaicitest.py | 10 +++++----- ci-scripts/main.py | 8 ++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 8364f9a7fa..141605084f 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -239,6 +239,11 @@ def Custom_Command(HTML, node, command, command_fail): HTML.CreateHtmlTestRowQueue(command, status, message) return status == 'OK' or status == 'Warning' +def IdleSleep(HTML, idle_sleep_time): + time.sleep(idle_sleep_time) + HTML.CreateHtmlTestRow(f"{idle_sleep_time} sec", 'OK', CONST.ALL_PROCESSES_OK) + return True + #----------------------------------------------------------- # OaiCiTest Class Definition #----------------------------------------------------------- @@ -263,7 +268,6 @@ class OaiCiTest(): self.iperf_profile = '' self.iperf_options = '' self.iperf_tcp_rate_target = '' - self.idle_sleep_time = 0 self.finalStatus = False self.UEIPAddress = '' self.UEUserName = '' @@ -915,10 +919,6 @@ class OaiCiTest(): CONTAINERS.UndeployGenObject(HTML,RAN,self) RAN.prematureExit=True - def IdleSleep(self,HTML): - time.sleep(self.idle_sleep_time) - HTML.CreateHtmlTestRow(str(self.idle_sleep_time) + ' sec', 'OK', CONST.ALL_PROCESSES_OK) - def LogCollectBuild(self,RAN): # Some pipelines are using "none" IP / Credentials # In that case, just forget about it diff --git a/ci-scripts/main.py b/ci-scripts/main.py index a36005cec6..0fdf0f2f07 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -298,12 +298,8 @@ def ExecuteActionWithParam(action): CiTestObj.Iperf2_Unidir(HTML,RAN,EPC,CONTAINERS) elif action == 'IdleSleep': - string_field = test.findtext('idle_sleep_time_in_sec') - if (string_field is None): - CiTestObj.idle_sleep_time = 5 - else: - CiTestObj.idle_sleep_time = int(string_field) - CiTestObj.IdleSleep(HTML) + st = test.findtext('idle_sleep_time_in_sec') or "5" + cls_oaicitest.IdleSleep(HTML, int(st)) elif action == 'Build_PhySim': ldpc.buildargs = test.findtext('physim_build_args') From 7b895488678d61325924310a49263f51873ba7fe Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 12:57:29 +0200 Subject: [PATCH 68/87] Consistently return success true/false from task steps --- ci-scripts/cls_containerize.py | 15 ++++- ci-scripts/cls_oaicitest.py | 19 +++++- ci-scripts/cls_physim.py | 36 ++++------- ci-scripts/cls_physim1.py | 9 +-- ci-scripts/cls_static_code_analysis.py | 4 +- ci-scripts/epc.py | 33 ++++++++-- ci-scripts/ran.py | 88 +++++++++++++------------- ci-scripts/tests/deployment.py | 8 +-- ci-scripts/tests/ping-iperf.py | 6 +- 9 files changed, 125 insertions(+), 93 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index dfc0769fc7..ecf0b3d0f3 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -85,6 +85,7 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge sshSession.command('git log --oneline | head -n5', '\$', 5) logging.error(f'problems during checkout, is at: {sshSession.getBefore()}') self.exitStatus = 1 + return False else: logging.debug('successful checkout') # if the branch is not develop, then it is a merge request and we need to do @@ -94,6 +95,7 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge ranTargetBranch = 'develop' logging.debug(f'Merging with the target branch: {ranTargetBranch}') sshSession.command(f'git merge --ff origin/{ranTargetBranch} -m "Temporary merge for CI"', '\$', 30) + return True def ImageTagToUse(imageName, ranCommitID, ranBranch, ranAllowMerge): shortCommit = ranCommitID[0:8] @@ -969,8 +971,12 @@ class Containerize(): logging.info(f"Running on server {lIpAddr}") sshSession = cls_cmd.getConnection(lIpAddr) - CreateWorkspace(sshSession, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) - HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + success = CreateWorkspace(sshSession, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) + if success: + HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + else: + HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["cannot create workspace"]) + return success def DeployObject(self, HTML): lIpAddr, lUserName, lPassWord, lSourcePath = GetCredentials(self) @@ -988,7 +994,7 @@ class Containerize(): self.exitStatus = 1 logging.error('Could not deploy') HTML.CreateHtmlTestRow('Could not deploy', 'KO', CONST.ALL_PROCESSES_OK) - return + return False services_list = allServices if self.services[self.eNB_instance].split() == [] else self.services[self.eNB_instance].split() status = True imagesInfo="" @@ -1011,6 +1017,7 @@ class Containerize(): self.exitStatus = 1 imagesInfo += ("Unhealthy deployment! -- Check logs for reason!") HTML.CreateHtmlTestRowQueue('N/A', 'KO', [(imagesInfo)]) + return status def UndeployObject(self, HTML, RAN): lIpAddr, lUserName, lPassWord, lSourcePath = GetCredentials(self) @@ -1029,11 +1036,13 @@ class Containerize(): HTML.htmleNBFailureMsg='Could not copy logfile(s) to analyze it!' HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) self.exitStatus = 1 + return False else: log_results = [CheckLogs(self, mySSH, self.yamlPath[0].split('/'), service_name, HTML, RAN) for service_name, _ in services] self.exitStatus = 1 if any(log_results) else 0 logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') if self.exitStatus == 0 else logging.error('\u001B[1m Undeploying OAI Object Failed\u001B[0m') mySSH.close() + return self.exitStatus == 0 def CheckAndAddRoute(self, svrName, ipAddr, userName, password): logging.debug('Checking IP routing on ' + svrName) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 141605084f..58ae8366b6 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -291,6 +291,7 @@ class OaiCiTest(): messages.append(f'{uename}: initialized' if f.result() else f'{uename}: ERROR during Initialization') [f.result() for f in futures] HTML.CreateHtmlTestRowQueue('N/A', 'OK', messages) + return True def AttachUE(self, HTML, RAN, EPC, CONTAINERS): ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)] @@ -300,12 +301,14 @@ class OaiCiTest(): futures = [executor.submit(ue.checkMTU) for ue in ues] mtus = [f.result() for f in futures] messages = [f"UE {ue.getName()}: {ue.getIP()}" for ue in ues] - if all(attached) and all(mtus): + success = all(attached) and all(mtus) + if success: HTML.CreateHtmlTestRowQueue('N/A', 'OK', messages) else: logging.error(f'error attaching or wrong MTU: attached {attached}, mtus {mtus}') HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not retrieve UE IP address(es) or MTU(s) wrong!"]) self.AutoTerminateUEandeNB(HTML, RAN, EPC, CONTAINERS) + return success def DetachUE(self, HTML): ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)] @@ -314,18 +317,21 @@ class OaiCiTest(): [f.result() for f in futures] messages = [f"UE {ue.getName()}: detached" for ue in ues] HTML.CreateHtmlTestRowQueue('NA', 'OK', messages) + return True def DataDisableUE(self, HTML): ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids] with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: futures = [executor.submit(ue.dataDisable) for ue in ues] status = [f.result() for f in futures] - if all(status): + success = all(status) + if success: messages = [f"UE {ue.getName()}: data disabled" for ue in ues] HTML.CreateHtmlTestRowQueue('NA', 'OK', messages) else: logging.error(f'error enabling data: {status}') HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not disable UE data!"]) + return success def DataEnableUE(self, HTML): ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids] @@ -333,12 +339,14 @@ class OaiCiTest(): with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: futures = [executor.submit(ue.dataEnable) for ue in ues] status = [f.result() for f in futures] - if all(status): + success = all(status) + if success: messages = [f"UE {ue.getName()}: data enabled" for ue in ues] HTML.CreateHtmlTestRowQueue('NA', 'OK', messages) else: logging.error(f'error enabling data: {status}') HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not enable UE data!"]) + return success def CheckStatusUE(self,HTML): ues = [cls_module.Module_UE(n.strip()) for n in self.ue_ids] @@ -348,6 +356,7 @@ class OaiCiTest(): futures = [executor.submit(ue.check) for ue in ues] messages = [f.result() for f in futures] HTML.CreateHtmlTestRowQueue('NA', 'OK', messages) + return True def Ping_common(self, EPC, ue, RAN, logPath): # Launch ping on the EPC side (true for ltebox and old open-air-cn) @@ -455,6 +464,7 @@ class OaiCiTest(): else: HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', messages) self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) + return success def Iperf_Module(self, EPC, ue, svr, RAN, idx, ue_num, logPath): ueIP = ue.getIP() @@ -540,6 +550,7 @@ class OaiCiTest(): else: HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', messages) self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) + return success def Iperf2_Unidir(self,HTML,RAN,EPC,CONTAINERS): if self.ue_ids == [] or self.svr_id == None or len(self.ue_ids) != 1: @@ -580,6 +591,7 @@ class OaiCiTest(): else: HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', [f'{ue_header}\n{msg}']) self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) + return success def AnalyzeLogFile_UE(self, UElogFile,HTML,RAN): if (not os.path.isfile(f'{UElogFile}')): @@ -860,6 +872,7 @@ class OaiCiTest(): archive_info = [f'Log at: {a}' if a else 'No log available' for a in archives] messages = [f"UE {ue.getName()}: {log}" for (ue, log) in zip(ues, archive_info)] HTML.CreateHtmlTestRowQueue(f'N/A', 'OK', messages) + return True def AutoTerminateUEandeNB(self,HTML,RAN,EPC,CONTAINERS): if (RAN.Initialize_eNB_args != ''): diff --git a/ci-scripts/cls_physim.py b/ci-scripts/cls_physim.py index 3604065caf..9d2e85ff41 100644 --- a/ci-scripts/cls_physim.py +++ b/ci-scripts/cls_physim.py @@ -84,7 +84,7 @@ class PhySim: os.system('mv '+self.__runLogFile+' '+ self.__runLogPath+'/.') HTML.CreateHtmlTestRowQueue(self.runargs, 'OK', [info]) - return HTML + return True def __CheckResults_LDPCt2Test(self,HTML,CONST,testcase_id): thrs_KO = int(self.timethrs) @@ -113,18 +113,19 @@ class PhySim: HTML.CreateHtmlTestRowQueue(self.runargs, 'KO', ['no statistics']) self.exitStatus = 1 os.system(f'mv {self.__runLogFile} {self.__runLogPath}/.') - return HTML + return False #once parsed move the local logfile to its folder os.system(f'mv {self.__runLogFile} {self.__runLogPath}/.') - if float(time) < thrs_KO: + success = float(time) < thrs_KO + if success: HTML.CreateHtmlTestRowQueue(self.runargs, 'OK', [info]) else: error_msg = f'Processing time exceeds a limit of {thrs_KO} us' logging.error(error_msg) HTML.CreateHtmlTestRowQueue(self.runargs, 'KO', [info + '\n' + error_msg]) self.exitStatus = 1 - return HTML + return success def __CheckResults_NRulsimTest(self, HTML, CONST, testcase_id): #retrieve run log file and store it locally @@ -136,7 +137,7 @@ class PhySim: logging.error(error_msg) HTML.CreateHtmlTestRowQueue("could not recover results", 'KO', [error_msg]) self.exitStatus = 1 - return HTML + return False PUSCH_OK = False with open(self.__runLogFile) as f: @@ -153,7 +154,7 @@ class PhySim: logging.error(error_msg) HTML.CreateHtmlTestRowQueue(self.runargs, 'KO', 1, [error_msg]) self.exitStatus = 1 - return HTML + return PUSCH_OK def __CheckBuild_PhySim(self, HTML, CONST): self.__workSpacePath=self.eNBSourceCodePath+'/cmake_targets/' @@ -169,13 +170,13 @@ class PhySim: if 'BUILD SHOULD BE SUCCESSFUL' in f.read(): HTML.CreateHtmlTestRow(self.buildargs, 'OK', CONST.ALL_PROCESSES_OK, 'PhySim') self.exitStatus=0 - return HTML + return True logging.error('\u001B[1m Building Physical Simulators Failed\u001B[0m') HTML.CreateHtmlTestRow(self.buildargs, 'KO', CONST.ALL_PROCESSES_OK, 'LDPC') HTML.CreateHtmlTabFooter(False) #exitStatus=1 will do a sys.exit in main self.exitStatus = 1 - return HTML + return False #-----------------$ @@ -226,10 +227,7 @@ class PhySim: mySSH.command(f'./build_oai {self.buildargs} 2>&1 | tee {self.__buildLogFile}', '\$', 1500) mySSH.close() - #check build status and update HTML object - lHTML = cls_oai_html.HTMLManagement() - lHTML=self.__CheckBuild_PhySim(htmlObj,constObj) - return lHTML + return __CheckBuild_PhySim(htmlObj,constObj) def Run_CUDATest(self,htmlObj,constObj,testcase_id): @@ -245,10 +243,7 @@ class PhySim: #run and redirect the results to a log file mySSH.command(self.__workSpacePath+'ran_build/build/ldpctest ' + self.runargs + ' >> '+self.__runLogFile, '\$', 30) mySSH.close() - #return updated HTML to main - lHTML = cls_oai_html.HTMLManagement() - lHTML=self.__CheckResults_LDPCcudaTest(htmlObj,constObj,testcase_id) - return lHTML + return self.__CheckResults_LDPCcudaTest(htmlObj,constObj,testcase_id) def Run_T2Test(self,htmlObj,constObj,testcase_id): self.__workSpacePath = f'{self.eNBSourceCodePath}/cmake_targets/' @@ -262,10 +257,7 @@ class PhySim: #run and redirect the results to a log file mySSH.run(f'sudo {self.__workSpacePath}ran_build/build/{self.runsim} {self.runargs} > {self.__workSpacePath}{self.__runLogFile} 2>&1') mySSH.close() - #return updated HTML to main - lHTML = cls_oai_html.HTMLManagement() - lHTML=self.__CheckResults_LDPCt2Test(htmlObj,constObj,testcase_id) - return lHTML + return self.__CheckResults_LDPCt2Test(htmlObj,constObj,testcase_id) def Run_NRulsimTest(self, htmlObj, constObj, testcase_id): self.__workSpacePath=self.eNBSourceCodePath+'/cmake_targets/' @@ -276,6 +268,4 @@ class PhySim: mySSH.command(f'cd {self.__workSpacePath}', '\$', 5) mySSH.command(f'sudo {self.__workSpacePath}ran_build/build/nr_ulsim {self.runargs} > {self.__runLogFile} 2>&1', '\$', 30) mySSH.close() - #return updated HTML to main - lHTML = self.__CheckResults_NRulsimTest(htmlObj, constObj, testcase_id) - return lHTML + return self.__CheckResults_NRulsimTest(htmlObj, constObj, testcase_id) diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index 1888e00068..e3a24f5fc1 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -124,7 +124,7 @@ class PhySim: mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL) RAN.prematureExit = True - return + return False else: logging.debug('\u001B[1m Login to OC Cluster Successfully\u001B[0m') mySSH.command(f'oc project {ocProjectName}', '\$', 30) @@ -134,7 +134,7 @@ class PhySim: mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PROJECT_FAIL) RAN.prematureExit = True - return + return False else: logging.debug(f'\u001B[1m Now using project {ocProjectName}\u001B[0m') @@ -155,7 +155,7 @@ class PhySim: mySSH.close() self.AnalyzeLogFile_phySim() RAN.prematureExit = True - return + return False else: logging.debug('\u001B[1m Deployed PhySim Successfully using helm chart\u001B[0m') isRunning = False @@ -187,7 +187,7 @@ class PhySim: HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PHYSIM_DEPLOY_FAIL) HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult) RAN.prematureExit = True - return + return False # Waiting to complete the running test count = 0 isFinished = False @@ -255,6 +255,7 @@ class PhySim: HTML.CreateHtmlTestRow('Some test(s) timed-out!', 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult) logging.error('\u001B[1m Physical Simulator Fail\u001B[0m') + return self.testStatus def AnalyzeLogFile_phySim(self): mySSH = SSH.SSHConnection() diff --git a/ci-scripts/cls_static_code_analysis.py b/ci-scripts/cls_static_code_analysis.py index 55c479c16a..ab4283d534 100644 --- a/ci-scripts/cls_static_code_analysis.py +++ b/ci-scripts/cls_static_code_analysis.py @@ -214,7 +214,7 @@ class StaticCodeAnalysis(): HTML.CreateHtmlTestRowCppCheckResults(CCR) logging.info('\u001B[1m Static Code Analysis Pass\u001B[0m') - return 0 + return True def LicenceAndFormattingCheck(self, HTML): # Workspace is no longer recreated from scratch. @@ -356,4 +356,4 @@ class StaticCodeAnalysis(): HTML.htmleNBFailureMsg = 'Could not access oai-formatting-check.txt file' HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) - return finalStatus + return finalStatus == 0 diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index b03573685a..97d1f1a8cb 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -135,6 +135,7 @@ class EPCManagement(): logging.error('This option should not occur!') mySSH.close() HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) + return True def InitializeMME(self, HTML): if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': @@ -175,6 +176,7 @@ class EPCManagement(): logging.error('This option should not occur!') mySSH.close() HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) + return True def SetMmeIPAddress(self): # Not an error if we don't need an EPC @@ -241,12 +243,14 @@ class EPCManagement(): logging.error('This option should not occur!') mySSH.close() HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) + return True def Initialize5GCN(self, HTML): if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.Type == '': HELP.GenericHelp(CONST.Version) HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.Type) - sys.exit('Insufficient EPC Parameters') + logging.error('Insufficient EPC Parameters') + return False mySSH = cls_cmd.getConnection(self.IPAddress) html_cell = '' if re.match('ltebox', self.Type, re.IGNORECASE): @@ -306,7 +310,8 @@ class EPCManagement(): HTML.CreateHtmlTestRow('N/A', 'KO', report) HTML.CreateHtmlTabFooter(False) mySSH.close() - sys.exit("OC OAI CN5G: CN deployment failed!") + logging.error("OC OAI CN5G: CN deployment failed!") + return False for line in report.stdout.split('\n')[1:]: columns = line.strip().split() name = columns[0] @@ -317,6 +322,7 @@ class EPCManagement(): logging.error('This option should not occur!') mySSH.close() HTML.CreateHtmlTestRowQueue(self.Type, 'OK', [html_cell]) + return True def SetAmfIPAddress(self): # Not an error if we don't need an 5GCN @@ -472,6 +478,7 @@ class EPCManagement(): logging.error('This should not happen!') mySSH.close() HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + return True def TerminateMME(self, HTML): mySSH = SSH.SSHConnection() @@ -499,6 +506,7 @@ class EPCManagement(): logging.error('This should not happen!') mySSH.close() HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + return True def TerminateSPGW(self, HTML): mySSH = SSH.SSHConnection() @@ -542,6 +550,7 @@ class EPCManagement(): logging.error('This should not happen!') mySSH.close() HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + return True def Terminate5GCN(self, HTML): mySSH = cls_cmd.getConnection(self.IPAddress) @@ -583,25 +592,29 @@ class EPCManagement(): if not succeeded: HTML.CreateHtmlTestRow('N/A', 'KO', report) HTML.CreateHtmlTabFooter(False) - sys.exit("OC OAI CN5G: CN undeployment failed!") + logging.error("OC OAI CN5G: CN undeployment failed!") + return False else: message = report.stdout else: logging.error('This should not happen!') mySSH.close() HTML.CreateHtmlTestRowQueue(self.Type, 'OK', [message]) + return True def DeployEpc(self, HTML): logging.debug('Trying to deploy') if not re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) HTML.CreateHtmlTabFooter(False) - sys.exit('Deploy not possible with this EPC type: ' + self.Type) + logging.error('Deploy not possible with this EPC type: ' + self.Type) + return False if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': HELP.GenericHelp(CONST.Version) HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) - sys.exit('Insufficient EPC Parameters') + logging.error('Insufficient EPC Parameters') + return False mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.command('docker-compose --version', '\$', 5) @@ -610,7 +623,8 @@ class EPCManagement(): mySSH.close() HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) HTML.CreateHtmlTabFooter(False) - sys.exit('docker-compose not installed on ' + self.IPAddress) + logging.error('docker-compose not installed on ' + self.IPAddress) + return False # Checking if it is a MAGMA deployment self.isMagmaUsed = False @@ -660,7 +674,8 @@ class EPCManagement(): if not db_init_status: HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) HTML.CreateHtmlTabFooter(False) - sys.exit('Cassandra DB deployment/configuration went wrong!') + logging.error('Cassandra DB deployment/configuration went wrong!') + return True # deploying EPC cNFs mySSH.command('docker-compose up -d oai_spgwu', '\$', 60) @@ -729,10 +744,12 @@ class EPCManagement(): mySSH.close() logging.debug('Deployment OK') HTML.CreateHtmlTestRowQueue(self.Type, 'OK', [html_cell]) + return True else: mySSH.close() logging.debug('Deployment went wrong') HTML.CreateHtmlTestRowQueue(self.Type, 'KO', [html_cell]) + return False def UndeployEpc(self, HTML): logging.debug('Trying to undeploy') @@ -802,9 +819,11 @@ class EPCManagement(): if noMoreContainerNb == nbContainers and noMoreNetworkNb == 2: logging.debug('Undeployment OK') HTML.CreateHtmlTestRowQueue(self.Type, 'OK', [message]) + return True else: logging.debug('Undeployment went wrong') HTML.CreateHtmlTestRowQueue(self.Type, 'KO', [message]) + return False def LogCollectHSS(self): mySSH = SSH.SSHConnection() diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index f64250d12d..d02b927ea6 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -189,7 +189,7 @@ class RANManagement(): if not mismatch: mySSH.close() HTML.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) - return + return True mySSH.command('echo ' + lPassWord + ' | sudo -S git clean -x -d -ff', '\$', 30) # if the commit ID is provided use it to point to it @@ -219,10 +219,10 @@ class RANManagement(): mySSH.close() HTML.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) self.backgroundBuildTestId[int(self.eNB_instance)] = self.testCase_id - return + return True mySSH.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee compile_oai_enb.log', 'BUILD SHOULD BE SUCCESSFUL|build have failed', 900) mySSH.close() - self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id, HTML) + return self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id, HTML) def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId, HTML): HTML.testCase_id=testcaseId @@ -283,8 +283,7 @@ class RANManagement(): else: logging.error('\u001B[1m Building OAI ' + self.air_interface[self.eNB_instance] + ' Failed\u001B[0m') HTML.CreateHtmlTestRow(self.Build_eNB_args, 'KO', CONST.ALL_PROCESSES_OK) - HTML.CreateHtmlTabFooter(False) - sys.exit(1) + return buildStatus def InitializeeNB(self, HTML, EPC): if self.eNB_serverId[self.eNB_instance] == '0': @@ -453,8 +452,7 @@ class RANManagement(): copyin_res = mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.') if (copyin_res == 0): mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.') - self.prematureExit = True - return + return False else: mySSH.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | grep -E --text --color=never -i "wait|sync|Starting|Started"', '\$', 4) if rruCheck: @@ -492,45 +490,44 @@ class RANManagement(): mySSH.close() - HTML.CreateHtmlTestRow(f'{self.cmd_prefix} {self.air_interface[self.eNB_instance]} -O {config_file} {extra_options}', 'OK', CONST.ALL_PROCESSES_OK) logging.debug('\u001B[1m Initialize eNB/gNB Completed\u001B[0m') + return enbDidSync def CheckeNBProcess(self, status_queue): - try: - # At least the instance 0 SHALL be on! - if self.eNBstatuses[0] == 0: - lIpAddr = self.eNBIPAddress - lUserName = self.eNBUserName - lPassWord = self.eNBPassword - elif self.eNBstatuses[0] == 1: - lIpAddr = self.eNB1IPAddress - lUserName = self.eNB1UserName - lPassWord = self.eNB1Password - elif self.eNBstatuses[0] == 2: - lIpAddr = self.eNB2IPAddress - lUserName = self.eNB2UserName - lPassWord = self.eNB2Password - else: - lIpAddr = self.eNBIPAddress - lUserName = self.eNBUserName - lPassWord = self.eNBPassword - mySSH = SSH.SSHConnection() - mySSH.open(lIpAddr, lUserName, lPassWord) - if self.air_interface[self.eNB_instance] == '': - pattern = 'softmodem' - else: - pattern = self.air_interface[self.eNB_instance] - mySSH.command('stdbuf -o0 ps -aux | grep --color=never ' + pattern + ' | grep -v grep', '\$', 5) - result = re.search(pattern, mySSH.getBefore()) - if result is None: - logging.debug('\u001B[1;37;41m eNB Process Not Found! \u001B[0m') - status_queue.put(CONST.ENB_PROCESS_FAILED) - else: - status_queue.put(CONST.ENB_PROCESS_OK) - mySSH.close() - except: - os.kill(os.getppid(),signal.SIGUSR1) + # At least the instance 0 SHALL be on! + if self.eNBstatuses[0] == 0: + lIpAddr = self.eNBIPAddress + lUserName = self.eNBUserName + lPassWord = self.eNBPassword + elif self.eNBstatuses[0] == 1: + lIpAddr = self.eNB1IPAddress + lUserName = self.eNB1UserName + lPassWord = self.eNB1Password + elif self.eNBstatuses[0] == 2: + lIpAddr = self.eNB2IPAddress + lUserName = self.eNB2UserName + lPassWord = self.eNB2Password + else: + lIpAddr = self.eNBIPAddress + lUserName = self.eNBUserName + lPassWord = self.eNBPassword + mySSH = SSH.SSHConnection() + mySSH.open(lIpAddr, lUserName, lPassWord) + if self.air_interface[self.eNB_instance] == '': + pattern = 'softmodem' + else: + pattern = self.air_interface[self.eNB_instance] + mySSH.command('stdbuf -o0 ps -aux | grep --color=never ' + pattern + ' | grep -v grep', '\$', 5) + result = re.search(pattern, mySSH.getBefore()) + success = result is not None + if not success: + logging.debug('\u001B[1;37;41m eNB Process Not Found! \u001B[0m') + status_queue.put(CONST.ENB_PROCESS_FAILED) + else: + status_queue.put(CONST.ENB_PROCESS_OK) + mySSH.close() + return success def TerminateeNB(self, HTML, EPC): if self.eNB_serverId[self.eNB_instance] == '0': @@ -610,6 +607,7 @@ class RANManagement(): logStatus = self.AnalyzeLogFile_eNB(extracted_log_file, HTML, self.ran_checkers) HTML.CreateHtmlTestRow(self.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) self.eNBLogFiles[int(self.eNB_instance)] = '' + return True else: analyzeFile = False if self.eNBLogFiles[int(self.eNB_instance)] != '': @@ -628,7 +626,7 @@ class RANManagement(): HTML.htmleNBFailureMsg='Could not copy ' + nodeB_prefix + 'NB logfile to analyze it!' HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) self.eNBmbmsEnables[int(self.eNB_instance)] = False - return + return False if self.eNB_serverId[self.eNB_instance] != '0': #*stats.log files + pickle + png @@ -646,9 +644,8 @@ class RANManagement(): #display rt stats for gNB only if len(self.datalog_rt_stats)!=0 and nodeB_prefix == 'g': HTML.CreateHtmlDataLogTable(self.datalog_rt_stats) - self.prematureExit = True self.eNBmbmsEnables[int(self.eNB_instance)] = False - return + return False else: HTML.CreateHtmlTestRow(self.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) else: @@ -658,6 +655,7 @@ class RANManagement(): HTML.CreateHtmlDataLogTable(self.datalog_rt_stats) self.eNBmbmsEnables[int(self.eNB_instance)] = False self.eNBstatuses[int(self.eNB_instance)] = -1 + return True def LogCollecteNB(self): mySSH = SSH.SSHConnection() diff --git a/ci-scripts/tests/deployment.py b/ci-scripts/tests/deployment.py index e4176ec79d..f9927f06ad 100644 --- a/ci-scripts/tests/deployment.py +++ b/ci-scripts/tests/deployment.py @@ -31,15 +31,15 @@ class TestDeploymentMethods(unittest.TestCase): self.cont.eNBSourceCodePath = os.getcwd() def test_deploy(self): - self.cont.DeployObject(self.html) - self.assertEqual(self.cont.exitStatus, 0) + success = self.cont.DeployObject(self.html) + self.assertTrue(success) self.cont.UndeployObject(self.html, self.ran) def test_deployfails(self): old = self.cont.yamlPath self.cont.yamlPath[0] = 'tests/simple-fail/' - self.cont.DeployObject(self.html) - self.assertEqual(self.cont.exitStatus, 1) + success = self.cont.DeployObject(self.html) + self.assertFalse(success) self.cont.UndeployObject(self.html, self.ran) self.cont.yamlPath = old diff --git a/ci-scripts/tests/ping-iperf.py b/ci-scripts/tests/ping-iperf.py index e3444a4024..7fb019e5fb 100644 --- a/ci-scripts/tests/ping-iperf.py +++ b/ci-scripts/tests/ping-iperf.py @@ -36,7 +36,8 @@ class TestPingIperf(unittest.TestCase): self.ci.ping_args = "-c3 127.0.0.1" self.ci.ping_packetloss_threshold = "0" # TODO Should need nothing but options and UE(s) to use - self.ci.Ping(self.html, self.ran, self.epc, self.cont) + success = self.ci.Ping(self.html, self.ran, self.epc, self.cont) + self.assertTrue(success) def test_iperf(self): # note: needs to be five seconds because Iperf() adds -O 3, so if it is @@ -49,7 +50,8 @@ class TestPingIperf(unittest.TestCase): self.ci.iperf_bitrate_threshold = "0" self.ci.iperf_profile = "balanced" # TODO Should need nothing but options and UE(s) to use - self.ci.Iperf(self.html, self.ran, self.epc, self.cont) + success = self.ci.Iperf(self.html, self.ran, self.epc, self.cont) + self.assertTrue(success) if __name__ == '__main__': unittest.main() From 041b2b2d7a5173feb8dbeddccc42f30fe321573d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 15:17:37 +0200 Subject: [PATCH 69/87] Remove prematureExit/exitStatus, and implement in task main loop Use the previous commit on returning success from each task execution function, and implement handling of errors in the main loop. Add a script with which this is visible using Custom_Commands. --- ci-scripts/cls_containerize.py | 14 ++- ci-scripts/cls_oai_html.py | 2 + ci-scripts/cls_oaicitest.py | 2 - ci-scripts/cls_physim.py | 8 -- ci-scripts/cls_physim1.py | 7 +- ci-scripts/main.py | 122 ++++++++++++-------------- ci-scripts/ran.py | 2 - ci-scripts/tests/test-runner/test.xml | 28 ++++++ 8 files changed, 91 insertions(+), 94 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index ecf0b3d0f3..a7a80521af 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -84,7 +84,6 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge if sshSession.getBefore().count(f'HEAD is now at {ranCommitID[:6]}') != 1: sshSession.command('git log --oneline | head -n5', '\$', 5) logging.error(f'problems during checkout, is at: {sshSession.getBefore()}') - self.exitStatus = 1 return False else: logging.debug('successful checkout') @@ -319,7 +318,6 @@ class Containerize(): self.yamlPath = ['', '', ''] self.services = ['', '', ''] self.nb_healthy = [0, 0, 0] - self.exitStatus = 0 self.eNB_logFile = ['', '', ''] self.testCase_id = '' @@ -991,7 +989,6 @@ class Containerize(): deployStatus,allServices = DeployServices(mySSH,self.services[self.eNB_instance]) if deployStatus != 0: mySSH.close() - self.exitStatus = 1 logging.error('Could not deploy') HTML.CreateHtmlTestRow('Could not deploy', 'KO', CONST.ALL_PROCESSES_OK) return False @@ -1014,7 +1011,6 @@ class Containerize(): imagesInfo += ("Healthy deployment!") HTML.CreateHtmlTestRowQueue('N/A', 'OK', [(imagesInfo)]) else: - self.exitStatus = 1 imagesInfo += ("Unhealthy deployment! -- Check logs for reason!") HTML.CreateHtmlTestRowQueue('N/A', 'KO', [(imagesInfo)]) return status @@ -1035,14 +1031,16 @@ class Containerize(): if not copyin_res: HTML.htmleNBFailureMsg='Could not copy logfile(s) to analyze it!' HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) - self.exitStatus = 1 return False else: log_results = [CheckLogs(self, mySSH, self.yamlPath[0].split('/'), service_name, HTML, RAN) for service_name, _ in services] - self.exitStatus = 1 if any(log_results) else 0 - logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') if self.exitStatus == 0 else logging.error('\u001B[1m Undeploying OAI Object Failed\u001B[0m') + success = any(log_results) mySSH.close() - return self.exitStatus == 0 + if success: + logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') + else: + logging.error('\u001B[1m Undeploying OAI Object Failed\u001B[0m') + return success def CheckAndAddRoute(self, svrName, ipAddr, userName, password): logging.debug('Checking IP routing on ' + svrName) diff --git a/ci-scripts/cls_oai_html.py b/ci-scripts/cls_oai_html.py index dc2c3bf5c6..93176d1375 100644 --- a/ci-scripts/cls_oai_html.py +++ b/ci-scripts/cls_oai_html.py @@ -446,6 +446,8 @@ class HTMLManagement(): self.htmlFile.write(f' {status}\n') elif (str(status) == 'KO'): self.htmlFile.write(f' {status}\n') + elif str(status) == 'SKIP': + self.htmlFile.write(f' {status}\n') else: addOrangeBK = True self.htmlFile.write(f' {status}\n') diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 58ae8366b6..8ec97c2e6e 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -900,7 +900,6 @@ class OaiCiTest(): CONTAINERS.UndeployObject(HTML,RAN) else: CONTAINERS.UndeployGenObject(HTML,RAN, self) - RAN.prematureExit=True #this function is called only if eNB/gNB fails to start #RH to be re-factored @@ -930,7 +929,6 @@ class OaiCiTest(): CONTAINERS.UndeployObject(HTML,RAN) else: CONTAINERS.UndeployGenObject(HTML,RAN,self) - RAN.prematureExit=True def LogCollectBuild(self,RAN): # Some pipelines are using "none" IP / Credentials diff --git a/ci-scripts/cls_physim.py b/ci-scripts/cls_physim.py index 9d2e85ff41..7d4dd7d33a 100644 --- a/ci-scripts/cls_physim.py +++ b/ci-scripts/cls_physim.py @@ -52,7 +52,6 @@ class PhySim: self.ranCommitID= "" self.ranAllowMerge= "" self.ranTargetBranch= "" - self.exitStatus=0 self.forced_workspace_cleanup=False #private attributes self.__workSpacePath='' @@ -111,7 +110,6 @@ class PhySim: if res_enc is None and res_dec is None: logging.error(f'no statistics: res_enc {res_enc} res_dec {res_dec}') HTML.CreateHtmlTestRowQueue(self.runargs, 'KO', ['no statistics']) - self.exitStatus = 1 os.system(f'mv {self.__runLogFile} {self.__runLogPath}/.') return False @@ -124,7 +122,6 @@ class PhySim: error_msg = f'Processing time exceeds a limit of {thrs_KO} us' logging.error(error_msg) HTML.CreateHtmlTestRowQueue(self.runargs, 'KO', [info + '\n' + error_msg]) - self.exitStatus = 1 return success def __CheckResults_NRulsimTest(self, HTML, CONST, testcase_id): @@ -136,7 +133,6 @@ class PhySim: error_msg = f'could not recover test result file {filename}' logging.error(error_msg) HTML.CreateHtmlTestRowQueue("could not recover results", 'KO', [error_msg]) - self.exitStatus = 1 return False PUSCH_OK = False @@ -153,7 +149,6 @@ class PhySim: error_msg = 'error: no "PUSCH test OK"' logging.error(error_msg) HTML.CreateHtmlTestRowQueue(self.runargs, 'KO', 1, [error_msg]) - self.exitStatus = 1 return PUSCH_OK def __CheckBuild_PhySim(self, HTML, CONST): @@ -169,13 +164,10 @@ class PhySim: with open(self.__buildLogFile) as f: if 'BUILD SHOULD BE SUCCESSFUL' in f.read(): HTML.CreateHtmlTestRow(self.buildargs, 'OK', CONST.ALL_PROCESSES_OK, 'PhySim') - self.exitStatus=0 return True logging.error('\u001B[1m Building Physical Simulators Failed\u001B[0m') HTML.CreateHtmlTestRow(self.buildargs, 'KO', CONST.ALL_PROCESSES_OK, 'LDPC') HTML.CreateHtmlTabFooter(False) - #exitStatus=1 will do a sys.exit in main - self.exitStatus = 1 return False diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index e3a24f5fc1..0fa88aff32 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -65,7 +65,7 @@ class PhySim: #PUBLIC Methods$ #-----------------$ - def Deploy_PhySim(self, HTML, RAN): + def Deploy_PhySim(self, HTML): if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') @@ -123,7 +123,6 @@ class PhySim: logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m') mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL) - RAN.prematureExit = True return False else: logging.debug('\u001B[1m Login to OC Cluster Successfully\u001B[0m') @@ -133,7 +132,6 @@ class PhySim: mySSH.command('oc logout', '\$', 30) mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PROJECT_FAIL) - RAN.prematureExit = True return False else: logging.debug(f'\u001B[1m Now using project {ocProjectName}\u001B[0m') @@ -154,7 +152,6 @@ class PhySim: mySSH.command('oc logout', '\$', 30) mySSH.close() self.AnalyzeLogFile_phySim() - RAN.prematureExit = True return False else: logging.debug('\u001B[1m Deployed PhySim Successfully using helm chart\u001B[0m') @@ -186,7 +183,6 @@ class PhySim: mySSH.command('oc logout', '\$', 30) HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PHYSIM_DEPLOY_FAIL) HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult) - RAN.prematureExit = True return False # Waiting to complete the running test count = 0 @@ -248,7 +244,6 @@ class PhySim: HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult) logging.info('\u001B[1m Physical Simulator Pass\u001B[0m') else: - RAN.prematureExit = True if isFinished: HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK) else: diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 0fdf0f2f07..b6f59950ec 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -149,22 +149,15 @@ def ExecuteActionWithParam(action): if proxy_commit is not None: CONTAINERS.proxyCommit = proxy_commit if action == 'Build_eNB': - RAN.BuildeNB(HTML) + success = RAN.BuildeNB(HTML) elif action == 'Build_Image': success = CONTAINERS.BuildImage(HTML) - if not success: - RAN.prematureExit = True elif action == 'Build_Proxy': success = CONTAINERS.BuildProxy(HTML) - if not success: - RAN.prematureExit = True elif action == 'Build_Cluster_Image': - if not CLUSTER.BuildClusterImage(HTML): - RAN.prematureExit = True + success = CLUSTER.BuildClusterImage(HTML) elif action == 'Build_Run_Tests': success = CONTAINERS.BuildRunTests(HTML) - if not success: - RAN.prematureExit = True elif action == 'Initialize_eNB': RAN.eNB_Trace=test.findtext('eNB_Trace') @@ -200,7 +193,7 @@ def ExecuteActionWithParam(action): cmd_prefix = test.findtext('cmd_prefix') if cmd_prefix is not None: RAN.cmd_prefix = cmd_prefix - RAN.InitializeeNB(HTML, EPC) + success = RAN.InitializeeNB(HTML, EPC) elif action == 'Terminate_eNB': eNB_instance=test.findtext('eNB_instance') @@ -228,7 +221,7 @@ def ExecuteActionWithParam(action): RAN.air_interface[RAN.eNB_instance] = 'lte-softmodem' else: RAN.air_interface[RAN.eNB_instance] = air_interface.lower() +'-softmodem' - RAN.TerminateeNB(HTML, EPC) + success = RAN.TerminateeNB(HTML, EPC) elif action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Terminate_UE' or action == 'CheckStatusUE' or action == 'DataEnable_UE' or action == 'DataDisable_UE': CiTestObj.ue_ids = test.findtext('id').split(' ') @@ -240,19 +233,19 @@ def ExecuteActionWithParam(action): else: CiTestObj.nodes = [None] * len(CiTestObj.ue_ids) if action == 'Initialize_UE': - CiTestObj.InitializeUE(HTML) + success = CiTestObj.InitializeUE(HTML) elif action == 'Attach_UE': - CiTestObj.AttachUE(HTML, RAN, EPC, CONTAINERS) + success = CiTestObj.AttachUE(HTML, RAN, EPC, CONTAINERS) elif action == 'Detach_UE': - CiTestObj.DetachUE(HTML) + success = CiTestObj.DetachUE(HTML) elif action == 'Terminate_UE': - CiTestObj.TerminateUE(HTML) + success = CiTestObj.TerminateUE(HTML) elif action == 'CheckStatusUE': - CiTestObj.CheckStatusUE(HTML) + success = CiTestObj.CheckStatusUE(HTML) elif action == 'DataEnable_UE': - CiTestObj.DataEnableUE(HTML) + success = CiTestObj.DataEnableUE(HTML) elif action == 'DataDisable_UE': - CiTestObj.DataDisableUE(HTML) + success = CiTestObj.DataDisableUE(HTML) elif action == 'Ping': CiTestObj.ping_args = test.findtext('ping_args') @@ -266,7 +259,7 @@ def ExecuteActionWithParam(action): else: CiTestObj.nodes = [None] * len(CiTestObj.ue_ids) ping_rttavg_threshold = test.findtext('ping_rttavg_threshold') or '' - CiTestObj.Ping(HTML,RAN,EPC,CONTAINERS) + success = CiTestObj.Ping(HTML,RAN,EPC,CONTAINERS) elif action == 'Iperf' or action == 'Iperf2_Unidir': CiTestObj.iperf_args = test.findtext('iperf_args') @@ -293,13 +286,13 @@ def ExecuteActionWithParam(action): logging.error('test-case has wrong option ' + CiTestObj.iperf_options) CiTestObj.iperf_options = 'check' if action == 'Iperf': - CiTestObj.Iperf(HTML,RAN,EPC,CONTAINERS) + success = CiTestObj.Iperf(HTML,RAN,EPC,CONTAINERS) elif action == 'Iperf2_Unidir': - CiTestObj.Iperf2_Unidir(HTML,RAN,EPC,CONTAINERS) + success = CiTestObj.Iperf2_Unidir(HTML,RAN,EPC,CONTAINERS) elif action == 'IdleSleep': st = test.findtext('idle_sleep_time_in_sec') or "5" - cls_oaicitest.IdleSleep(HTML, int(st)) + success = cls_oaicitest.IdleSleep(HTML, int(st)) elif action == 'Build_PhySim': ldpc.buildargs = test.findtext('physim_build_args') @@ -311,54 +304,52 @@ def ExecuteActionWithParam(action): ldpc.forced_workspace_cleanup=True else: ldpc.forced_workspace_cleanup=False - HTML=ldpc.Build_PhySim(HTML,CONST) - if ldpc.exitStatus==1: - RAN.prematureExit = True + success = ldpc.Build_PhySim(HTML,CONST) elif action == 'Deploy_Run_PhySim': - PHYSIM.Deploy_PhySim(HTML, RAN) + success = PHYSIM.Deploy_PhySim(HTML) elif action == 'Initialize_MME': string_field = test.findtext('option') if (string_field is not None): EPC.mmeConfFile = string_field - EPC.InitializeMME(HTML) + success = EPC.InitializeMME(HTML) elif action == 'Initialize_HSS' or action == 'Initialize_SPGW': if action == 'Initialize_HSS': - EPC.InitializeHSS(HTML) + success = EPC.InitializeHSS(HTML) elif action == 'Initialize_SPGW': - EPC.InitializeSPGW(HTML) + success = EPC.InitializeSPGW(HTML) elif action == 'Terminate_HSS' or action == 'Terminate_MME' or action == 'Terminate_SPGW': if action == 'Terminate_HSS': - EPC.TerminateHSS(HTML) + success = EPC.TerminateHSS(HTML) elif action == 'Terminate_MME': - EPC.TerminateMME(HTML) + success = EPC.TerminateMME(HTML) elif action == 'Terminate_SPGW': - EPC.TerminateSPGW(HTML) + success = EPC.TerminateSPGW(HTML) elif action == 'Deploy_EPC': string_field = test.findtext('parameters') if (string_field is not None): EPC.yamlPath = string_field - EPC.DeployEpc(HTML) + success = EPC.DeployEpc(HTML) elif action == 'Undeploy_EPC': - EPC.UndeployEpc(HTML) + success = EPC.UndeployEpc(HTML) elif action == 'Initialize_5GCN': string_field = test.findtext('args') if (string_field is not None): EPC.cfgDeploy = string_field EPC.cnID = test.findtext('cn_id') - EPC.Initialize5GCN(HTML) + success = EPC.Initialize5GCN(HTML) elif action == 'Terminate_5GCN': string_field = test.findtext('args') if (string_field is not None): EPC.cfgUnDeploy = string_field EPC.cnID = test.findtext('cn_id') - EPC.Terminate5GCN(HTML) + success = EPC.Terminate5GCN(HTML) elif action == 'Deploy_Object' or action == 'Undeploy_Object' or action == "Create_Workspace": eNB_instance=test.findtext('eNB_instance') @@ -384,46 +375,38 @@ def ExecuteActionWithParam(action): if string_field is not None: CONTAINERS.services[CONTAINERS.eNB_instance] = string_field if action == 'Deploy_Object': - CONTAINERS.DeployObject(HTML) - if CONTAINERS.exitStatus==1: + success = CONTAINERS.DeployObject(HTML) + if not success: CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) - RAN.prematureExit = True elif action == 'Undeploy_Object': - CONTAINERS.UndeployObject(HTML, RAN) - if CONTAINERS.exitStatus == 1: + success = CONTAINERS.UndeployObject(HTML, RAN) + if not success: CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) - RAN.prematureExit = True elif action == 'Create_Workspace': - CONTAINERS.Create_Workspace(HTML) + success = CONTAINERS.Create_Workspace(HTML) elif action == 'Run_CUDATest' or action == 'Run_NRulsimTest' or action == 'Run_T2Test': ldpc.runargs = test.findtext('physim_run_args') ldpc.runsim = test.findtext('physim_run') ldpc.timethrs = test.findtext('physim_time_threshold') if action == 'Run_CUDATest': - HTML=ldpc.Run_CUDATest(HTML,CONST,id) + success = ldpc.Run_CUDATest(HTML,CONST,id) elif action == 'Run_NRulsimTest': - HTML=ldpc.Run_NRulsimTest(HTML,CONST,id) + success = ldpc.Run_NRulsimTest(HTML,CONST,id) elif action == 'Run_T2Test': - HTML=ldpc.Run_T2Test(HTML,CONST,id) - if ldpc.exitStatus==1: - RAN.prematureExit = True + success = ldpc.Run_T2Test(HTML,CONST,id) elif action == 'LicenceAndFormattingCheck': - ret = SCA.LicenceAndFormattingCheck(HTML) - if ret != 0: - RAN.prematureExit = True + success = SCA.LicenceAndFormattingCheck(HTML) elif action == 'Cppcheck_Analysis': - SCA.CppCheckAnalysis(HTML) + success = SCA.CppCheckAnalysis(HTML) elif action == 'Push_Local_Registry': string_field = test.findtext('registry_svr_id') if (string_field is not None): CONTAINERS.registrySvrId = string_field success = CONTAINERS.Push_Image_to_Local_Registry(HTML) - if not success: - RAN.prematureExit = True elif action == 'Pull_Local_Registry': string_field = test.findtext('test_svr_id') @@ -434,22 +417,18 @@ def ExecuteActionWithParam(action): if (string_field is not None): CONTAINERS.imageToPull = string_field.split() success = CONTAINERS.Pull_Image_from_Local_Registry(HTML) - if not success: - RAN.prematureExit = True elif action == 'Clean_Test_Server_Images': string_field = test.findtext('test_svr_id') if (string_field is not None): CONTAINERS.testSvrId = string_field success = CONTAINERS.Clean_Test_Server_Images(HTML) - if not success: - RAN.prematureExit = True elif action == 'Custom_Command': node = test.findtext('node') command = test.findtext('command') command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes'] - cls_oaicitest.Custom_Command(HTML, node, command, command_fail) + success = cls_oaicitest.Custom_Command(HTML, node, command, command_fail) elif action == 'Pull_Cluster_Image': string_field = test.findtext('images_to_pull') @@ -458,12 +437,13 @@ def ExecuteActionWithParam(action): string_field = test.findtext('test_svr_id') if (string_field is not None): CLUSTER.testSvrId = string_field - if not CLUSTER.PullClusterImage(HTML,RAN): - RAN.prematureExit = True + success = CLUSTER.PullClusterImage(HTML, RAN) else: logging.warning(f"unknown action {action}, skip step") + success = True # by default, we skip the step and print a warning + return success #check if given test is in list #it is in list if one of the strings in 'list' is at the beginning of 'test' @@ -738,13 +718,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if CONTAINERS.eNB1IPAddress == '172.21.16.137': CONTAINERS.CheckAndAddRoute('nepes', CONTAINERS.eNB1IPAddress, CONTAINERS.eNB1UserName, CONTAINERS.eNB1Password) - RAN.prematureExit=False + task_set_succeeded = True HTML.startTime=int(round(time.time() * 1000)) for test_case_id in todo_tests: for test in all_tests: - if RAN.prematureExit: - break id = test.get('id') if test_case_id != id: continue @@ -752,23 +730,31 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re HTML.testCase_id=CiTestObj.testCase_id EPC.testCase_id=CiTestObj.testCase_id CiTestObj.desc = test.findtext('desc') + always_exec = test.findtext('always_exec') in ['True', 'true', 'Yes', 'yes'] HTML.desc=CiTestObj.desc action = test.findtext('class') if (CheckClassValidity(xml_class_list, action, id) == False): continue CiTestObj.ShowTestID() + if not task_set_succeeded and not always_exec: + msg = f"skipping test due to prior error" + logging.warning(msg) + HTML.CreateHtmlTestRowQueue(msg, "SKIP", []) + break try: - ExecuteActionWithParam(action) - if RAN.prematureExit: + test_succeeded = ExecuteActionWithParam(action) + if not test_succeeded: + logging.error(f"test ID {test_case_id} action {action} failed ({test_succeeded}), skipping next tests") + task_set_succeeded = False CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) except Exception as e: s = traceback.format_exc() logging.error(f'while running CI, an exception occurred:\n{s}') HTML.CreateHtmlTestRowQueue("N/A", 'KO', [f"CI test code encountered an exception:\n{s}"]) - RAN.prematureExit = True + task_set_succeeded = False break - if RAN.prematureExit: + if not task_set_succeeded: logging.error('\u001B[1;37;41mScenario failed\u001B[0m') HTML.CreateHtmlTabFooter(False) sys.exit('Failed Scenario') diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index d02b927ea6..9fc62eadd4 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -55,7 +55,6 @@ class RANManagement(): def __init__(self): - self.prematureExit = False self.ranRepository = '' self.ranBranch = '' self.ranAllowMerge = False @@ -1269,7 +1268,6 @@ class RANManagement(): rruMsg = 'Slave RRU DID NOT receive the RRU_frame_resynch command from RAU' logging.debug('\u001B[1;37;41m ' + rruMsg + ' \u001B[0m') htmleNBFailureMsg += rruMsg + '\n' - self.prematureExit = True global_status = CONST.ENB_PROCESS_SLAVE_RRU_NOT_SYNCED if foundSegFault: logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with a Segmentation Fault! \u001B[0m') diff --git a/ci-scripts/tests/test-runner/test.xml b/ci-scripts/tests/test-runner/test.xml index e1aadffb9e..d5efacfdae 100644 --- a/ci-scripts/tests/test-runner/test.xml +++ b/ci-scripts/tests/test-runner/test.xml @@ -27,6 +27,9 @@ wrench 000001 + 000002 + 000003 + 000004 @@ -37,4 +40,29 @@ true yes + + + Custom_Command + This should fail + localhost + false + yes + + + + Custom_Command + This should be skipped + localhost + true + yes + + + + Custom_Command + This should be executed because marked so + true + localhost + true + yes + From 8bdc399b276d30d22aa6d85304839d5b030d16a1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 20 Sep 2024 20:20:38 +0200 Subject: [PATCH 70/87] Remove AutoTerminateUEeNB() functions, use auto_exec to make CI always undeploy --- ci-scripts/cls_oaicitest.py | 76 ++----------------- ci-scripts/main.py | 13 +--- ci-scripts/tests/ping-iperf.py | 6 +- .../xml_files/container_4g_l2sim_tdd.xml | 9 +++ .../container_4g_rfsim_fdd_05MHz.xml | 9 +++ .../container_4g_rfsim_fdd_05MHz_noS1.xml | 9 +++ .../container_4g_rfsim_fdd_10MHz.xml | 9 +++ .../container_4g_rfsim_fdd_20MHz.xml | 9 +++ .../xml_files/container_4g_rfsim_fembms.xml | 9 +++ .../xml_files/container_4g_rfsim_mbms.xml | 9 +++ .../container_4g_rfsim_tdd_05MHz.xml | 9 +++ .../xml_files/container_5g_e1_rfsim.xml | 9 +++ .../xml_files/container_5g_f1_rfsim.xml | 9 +++ .../xml_files/container_5g_fdd_rfsim.xml | 9 +++ .../xml_files/container_5g_l2sim_tdd.xml | 9 +++ ci-scripts/xml_files/container_5g_rfsim.xml | 9 +++ .../xml_files/container_5g_rfsim_24prb.xml | 9 +++ .../xml_files/container_5g_rfsim_2x2.xml | 9 +++ .../container_5g_rfsim_f1_accelleran.xml | 9 +++ .../container_5g_rfsim_fdd_phytest.xml | 9 +++ .../container_5g_rfsim_fr2_32prb.xml | 9 +++ .../xml_files/container_5g_rfsim_ntn_geo.xml | 9 +++ .../xml_files/container_5g_rfsim_sidelink.xml | 9 +++ .../xml_files/container_5g_rfsim_tdd_dora.xml | 18 +++++ .../xml_files/container_5g_rfsim_u0_25prb.xml | 9 +++ .../container_lte_b200_fdd_05Mhz_tm1.xml | 4 + ...container_lte_b200_fdd_05Mhz_tm1_if4_5.xml | 4 + ...lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml | 4 + .../container_lte_b200_fdd_10Mhz_tm1.xml | 4 + .../container_lte_b200_fdd_10Mhz_tm1_cdrx.xml | 4 + ...container_lte_b200_fdd_10Mhz_tm1_oaiue.xml | 20 +++++ .../container_lte_b200_fdd_20Mhz_tm1.xml | 4 + .../container_lte_b200_tdd_05Mhz_tm1.xml | 4 + ...container_lte_b200_tdd_05Mhz_tm1_if4_5.xml | 5 +- .../container_lte_b200_tdd_05Mhz_tm2.xml | 4 + .../container_lte_b200_tdd_10Mhz_tm1.xml | 4 + .../container_lte_b200_tdd_20Mhz_tm1.xml | 4 + ...e_b200_tdd_20Mhz_tm1_default_scheduler.xml | 4 + .../container_lte_n3xx_tdd_2x2_tm1.xml | 10 +++ .../container_lte_n3xx_tdd_2x2_tm2.xml | 11 +++ .../xml_files/container_nsa_b200_quectel.xml | 22 ++++++ .../xml_files/container_sa_aerial_quectel.xml | 11 +++ .../xml_files/container_sa_aw2s_asue.xml | 11 +++ .../xml_files/container_sa_b200_quectel.xml | 4 + .../container_sa_e1_b200_quectel.xml | 14 +++- .../container_sa_f1_b200_quectel.xml | 4 + .../xml_files/container_sa_fhi72_vvdn_up2.xml | 21 +++++ .../container_sa_n310_2X2_100MHz_quectel.xml | 11 +++ .../container_sa_n310_2X2_60MHz_quectel.xml | 11 +++ .../xml_files/container_sa_n310_nrue.xml | 18 +++++ .../container_sa_sc_b200_quectel.xml | 4 + ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 6 ++ .../fr1_nsa_2x2_quectel_attach_detach.xml | 5 ++ ci-scripts/xml_files/fr1_nsa_quectel.xml | 4 + .../fr1_nsa_quectel_attach_detach.xml | 3 + ci-scripts/xml_files/fr1_nsa_quectel_long.xml | 4 + ci-scripts/xml_files/gnb_phytest_usrp_run.xml | 2 + .../gnb_phytest_usrp_run_100_2x2.xml | 2 + .../xml_files/gnb_phytest_usrp_run_60.xml | 2 + .../xml_files/gnb_phytest_usrp_run_60_2x2.xml | 2 + 60 files changed, 470 insertions(+), 83 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 8ec97c2e6e..78c20fb172 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -293,7 +293,7 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue('N/A', 'OK', messages) return True - def AttachUE(self, HTML, RAN, EPC, CONTAINERS): + def AttachUE(self, HTML): ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)] with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: futures = [executor.submit(ue.attach) for ue in ues] @@ -307,7 +307,6 @@ class OaiCiTest(): else: logging.error(f'error attaching or wrong MTU: attached {attached}, mtus {mtus}') HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["Could not retrieve UE IP address(es) or MTU(s) wrong!"]) - self.AutoTerminateUEandeNB(HTML, RAN, EPC, CONTAINERS) return success def DetachUE(self, HTML): @@ -358,7 +357,7 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue('NA', 'OK', messages) return True - def Ping_common(self, EPC, ue, RAN, logPath): + def Ping_common(self, EPC, ue, logPath): # Launch ping on the EPC side (true for ltebox and old open-air-cn) ping_status = 0 ueIP = ue.getIP() @@ -429,7 +428,7 @@ class OaiCiTest(): return (True, message) - def Ping(self,HTML,RAN,EPC,CONTAINERS): + def Ping(self, HTML, EPC, CONTAINERS): if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') @@ -444,7 +443,7 @@ class OaiCiTest(): ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)] logging.debug(ues) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: - futures = [executor.submit(self.Ping_common, EPC, ue, RAN, logPath) for ue in ues] + futures = [executor.submit(self.Ping_common, EPC, ue, logPath) for ue in ues] results = [f.result() for f in futures] # each result in results is a tuple, first member goes to successes, second to messages successes, messages = map(list, zip(*results)) @@ -463,10 +462,9 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', messages) else: HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', messages) - self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) return success - def Iperf_Module(self, EPC, ue, svr, RAN, idx, ue_num, logPath): + def Iperf_Module(self, EPC, ue, svr, idx, ue_num, logPath): ueIP = ue.getIP() if not ueIP: return (False, f"UE {ue.getName()} has no IP address") @@ -512,7 +510,7 @@ class OaiCiTest(): return (status, f'{ue_header}\n{msg}') - def Iperf(self,HTML,RAN,EPC,CONTAINERS): + def Iperf(self,HTML,EPC,CONTAINERS): if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') @@ -530,7 +528,7 @@ class OaiCiTest(): svr = cls_module.Module_UE(self.svr_id,self.svr_node) logging.debug(ues) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: - futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, RAN, i, len(ues), logPath) for i, ue in enumerate(ues)] + futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, i, len(ues), logPath) for i, ue in enumerate(ues)] results = [f.result() for f in futures] # each result in results is a tuple, first member goes to successes, second to messages successes, messages = map(list, zip(*results)) @@ -549,10 +547,9 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue(self.iperf_args, 'OK', messages) else: HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', messages) - self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) return success - def Iperf2_Unidir(self,HTML,RAN,EPC,CONTAINERS): + def Iperf2_Unidir(self,HTML,EPC,CONTAINERS): if self.ue_ids == [] or self.svr_id == None or len(self.ue_ids) != 1: raise Exception("no module names in self.ue_ids or/and self.svr_id provided, multi UE scenario not supported") ue = cls_module.Module_UE(self.ue_ids[0].strip(),self.nodes[0].strip()) @@ -590,7 +587,6 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue(self.iperf_args, 'OK', [f'{ue_header}\n{msg}']) else: HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', [f'{ue_header}\n{msg}']) - self.AutoTerminateUEandeNB(HTML,RAN,EPC,CONTAINERS) return success def AnalyzeLogFile_UE(self, UElogFile,HTML,RAN): @@ -874,62 +870,6 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue(f'N/A', 'OK', messages) return True - def AutoTerminateUEandeNB(self,HTML,RAN,EPC,CONTAINERS): - if (RAN.Initialize_eNB_args != ''): - self.testCase_id = 'AUTO-KILL-RAN' - HTML.testCase_id = self.testCase_id - self.desc = 'Automatic Termination of all RAN nodes' - HTML.desc = self.desc - self.ShowTestID() - #terminate all RAN nodes eNB/gNB/OCP - for instance in range(0, len(RAN.air_interface)): - if RAN.air_interface[instance]!='': - logging.debug(f'Auto Termination of Instance {instance} : {RAN.air_interface[instance]}') - RAN.eNB_instance=instance - RAN.TerminateeNB(HTML,EPC) - if CONTAINERS.yamlPath[0] != '': - self.testCase_id = 'AUTO-KILL-CONTAINERS' - HTML.testCase_id = self.testCase_id - self.desc = 'Automatic Termination of all RAN containers' - HTML.desc = self.desc - self.ShowTestID() - for instance in range(0, len(CONTAINERS.yamlPath)): - if CONTAINERS.yamlPath[instance]!='': - CONTAINERS.eNB_instance=instance - if CONTAINERS.deployKind[instance]: - CONTAINERS.UndeployObject(HTML,RAN) - else: - CONTAINERS.UndeployGenObject(HTML,RAN, self) - - #this function is called only if eNB/gNB fails to start - #RH to be re-factored - def AutoTerminateeNB(self,HTML,RAN,EPC,CONTAINERS): - if (RAN.Initialize_eNB_args != ''): - self.testCase_id = 'AUTO-KILL-RAN' - HTML.testCase_id = self.testCase_id - self.desc = 'Automatic Termination of all RAN nodes' - HTML.desc = self.desc - self.ShowTestID() - #terminate all RAN nodes eNB/gNB/OCP - for instance in range(0, len(RAN.air_interface)): - if RAN.air_interface[instance]!='': - logging.debug(f'Auto Termination of Instance {instance} : {RAN.air_interface[instance]}') - RAN.eNB_instance=instance - RAN.TerminateeNB(HTML,EPC) - if CONTAINERS.yamlPath[0] != '': - self.testCase_id = 'AUTO-KILL-CONTAINERS' - HTML.testCase_id = self.testCase_id - self.desc = 'Automatic Termination of all RAN containers' - HTML.desc = self.desc - self.ShowTestID() - for instance in range(0, len(CONTAINERS.yamlPath)): - if CONTAINERS.yamlPath[instance]!='': - CONTAINERS.eNB_instance=instance - if CONTAINERS.deployKind[instance]: - CONTAINERS.UndeployObject(HTML,RAN) - else: - CONTAINERS.UndeployGenObject(HTML,RAN,self) - def LogCollectBuild(self,RAN): # Some pipelines are using "none" IP / Credentials # In that case, just forget about it diff --git a/ci-scripts/main.py b/ci-scripts/main.py index b6f59950ec..9c6a20d935 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -235,7 +235,7 @@ def ExecuteActionWithParam(action): if action == 'Initialize_UE': success = CiTestObj.InitializeUE(HTML) elif action == 'Attach_UE': - success = CiTestObj.AttachUE(HTML, RAN, EPC, CONTAINERS) + success = CiTestObj.AttachUE(HTML) elif action == 'Detach_UE': success = CiTestObj.DetachUE(HTML) elif action == 'Terminate_UE': @@ -259,7 +259,7 @@ def ExecuteActionWithParam(action): else: CiTestObj.nodes = [None] * len(CiTestObj.ue_ids) ping_rttavg_threshold = test.findtext('ping_rttavg_threshold') or '' - success = CiTestObj.Ping(HTML,RAN,EPC,CONTAINERS) + success = CiTestObj.Ping(HTML,EPC,CONTAINERS) elif action == 'Iperf' or action == 'Iperf2_Unidir': CiTestObj.iperf_args = test.findtext('iperf_args') @@ -286,9 +286,9 @@ def ExecuteActionWithParam(action): logging.error('test-case has wrong option ' + CiTestObj.iperf_options) CiTestObj.iperf_options = 'check' if action == 'Iperf': - success = CiTestObj.Iperf(HTML,RAN,EPC,CONTAINERS) + success = CiTestObj.Iperf(HTML, EPC, CONTAINERS) elif action == 'Iperf2_Unidir': - success = CiTestObj.Iperf2_Unidir(HTML,RAN,EPC,CONTAINERS) + success = CiTestObj.Iperf2_Unidir(HTML, EPC, CONTAINERS) elif action == 'IdleSleep': st = test.findtext('idle_sleep_time_in_sec') or "5" @@ -376,12 +376,8 @@ def ExecuteActionWithParam(action): CONTAINERS.services[CONTAINERS.eNB_instance] = string_field if action == 'Deploy_Object': success = CONTAINERS.DeployObject(HTML) - if not success: - CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) elif action == 'Undeploy_Object': success = CONTAINERS.UndeployObject(HTML, RAN) - if not success: - CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) elif action == 'Create_Workspace': success = CONTAINERS.Create_Workspace(HTML) @@ -746,7 +742,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if not test_succeeded: logging.error(f"test ID {test_case_id} action {action} failed ({test_succeeded}), skipping next tests") task_set_succeeded = False - CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) except Exception as e: s = traceback.format_exc() logging.error(f'while running CI, an exception occurred:\n{s}') diff --git a/ci-scripts/tests/ping-iperf.py b/ci-scripts/tests/ping-iperf.py index 7fb019e5fb..6ba35d04d3 100644 --- a/ci-scripts/tests/ping-iperf.py +++ b/ci-scripts/tests/ping-iperf.py @@ -14,7 +14,6 @@ sys.path.append('./') # to find OAI imports below import cls_oai_html import cls_oaicitest import cls_containerize -import ran import epc class TestPingIperf(unittest.TestCase): @@ -30,13 +29,12 @@ class TestPingIperf(unittest.TestCase): self.epc.UserName = None self.epc.Password = None self.epc.SourceCodePath = os.getcwd() - self.ran = ran.RANManagement() def test_ping(self): self.ci.ping_args = "-c3 127.0.0.1" self.ci.ping_packetloss_threshold = "0" # TODO Should need nothing but options and UE(s) to use - success = self.ci.Ping(self.html, self.ran, self.epc, self.cont) + success = self.ci.Ping(self.html, self.epc, self.cont) self.assertTrue(success) def test_iperf(self): @@ -50,7 +48,7 @@ class TestPingIperf(unittest.TestCase): self.ci.iperf_bitrate_threshold = "0" self.ci.iperf_profile = "balanced" # TODO Should need nothing but options and UE(s) to use - success = self.ci.Iperf(self.html, self.ran, self.epc, self.cont) + success = self.ci.Iperf(self.html, self.epc, self.cont) self.assertTrue(success) if __name__ == '__main__': diff --git a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml index 2bd0c5fcf9..28f55c6d68 100644 --- a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml +++ b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml @@ -37,6 +37,7 @@ 030011 030012 100001 + 222222 @@ -139,8 +140,16 @@ Undeploy_Object + true Undeploy all OAI 4G stack ci-scripts/yaml_files/4g_l2sim_fdd + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index a637d79cba..c717ba87b9 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -40,6 +40,7 @@ 030011 030012 100011 + 222222 @@ -154,10 +155,18 @@ Undeploy_Object + true Undeploy all OAI 4G stack ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml index 642342e7b8..67f66d2e6c 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml @@ -36,6 +36,7 @@ 030011 030012 100011 + 222222 @@ -125,10 +126,18 @@ Undeploy_Object + true Undeploy all OAI 4G stack ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml index cddecd09d0..f04057d8bf 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -40,6 +40,7 @@ 030011 030012 100011 + 222222 @@ -154,10 +155,18 @@ Undeploy_Object + true Undeploy all OAI 4G stack ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml index 619257cbc1..449341e13e 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -40,6 +40,7 @@ 030011 030012 100011 + 222222 @@ -154,10 +155,18 @@ Undeploy_Object + true Undeploy all OAI 4G stack ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fembms.xml b/ci-scripts/xml_files/container_4g_rfsim_fembms.xml index d33832d3c2..7ef304e648 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fembms.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fembms.xml @@ -33,6 +33,7 @@ 000001 030011 100011 + 222222 @@ -92,10 +93,18 @@ Undeploy_Object + true Undeploy all OAI 4G stack ci-scripts/yaml_files/4g_rfsimulator_fembms 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_mbms.xml b/ci-scripts/xml_files/container_4g_rfsim_mbms.xml index 04ec93ebf5..8236192138 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_mbms.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_mbms.xml @@ -33,6 +33,7 @@ 000001 030011 100011 + 222222 @@ -92,10 +93,18 @@ Undeploy_Object + true Undeploy all OAI 4G stack ci-scripts/yaml_files/4g_rfsimulator_mbms 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml index f7b1e50ebb..eb84827141 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -40,6 +40,7 @@ 030011 030012 100011 + 222222 @@ -147,10 +148,18 @@ Undeploy_Object + true Undeploy all OAI 4G stack ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_e1_rfsim.xml b/ci-scripts/xml_files/container_5g_e1_rfsim.xml index 87827cbdf7..fa8f47a558 100644 --- a/ci-scripts/xml_files/container_5g_e1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_e1_rfsim.xml @@ -33,6 +33,7 @@ 000024 020021 100021 + 222222 @@ -93,6 +94,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_e1 1,0,0,0 @@ -101,4 +103,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml index 56071f4b1b..a246727da1 100644 --- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml @@ -35,6 +35,7 @@ 030021 030022 100021 + 222222 @@ -150,6 +151,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_f1_rfsimulator 30,30,100,100 @@ -158,4 +160,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index e1aff907a9..a1454ed8bd 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -35,6 +35,7 @@ 030011 030012 100011 + 222222 @@ -119,6 +120,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_fdd_rfsimulator 1,0,0,0 @@ -127,4 +129,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_l2sim_tdd.xml b/ci-scripts/xml_files/container_5g_l2sim_tdd.xml index bef0a13e2d..aa9fd2ece9 100644 --- a/ci-scripts/xml_files/container_5g_l2sim_tdd.xml +++ b/ci-scripts/xml_files/container_5g_l2sim_tdd.xml @@ -35,6 +35,7 @@ 020001 020002 100001 + 222222 @@ -113,6 +114,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_l2sim_tdd 20,50,100,100 @@ -121,4 +123,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index 0e1b1d3710..edc9f1f30f 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -50,6 +50,7 @@ 333333 020006 100001 + 222222 @@ -245,6 +246,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator 1,0,0,0 @@ -253,4 +255,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml index f25928ab32..92f853fa99 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml @@ -35,6 +35,7 @@ 030001 030002 100001 + 222222 @@ -119,6 +120,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_24prb 1,0,0,0 @@ -127,4 +129,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml index 7826a6e818..67b2273a68 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml @@ -35,6 +35,7 @@ 030001 030002 100001 + 222222 @@ -119,6 +120,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_2x2 0 @@ -127,4 +129,11 @@ 1,0,0,0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran.xml b/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran.xml index 31d9a04790..07df4a751e 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran.xml @@ -32,6 +32,7 @@ 020021 100021 100022 + 222222 @@ -74,10 +75,18 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_accelleran 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml index c7d1824b4c..8d43480c8e 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml @@ -35,6 +35,7 @@ 030011 030012 100011 + 222222 @@ -119,6 +120,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest 10,100,100,100 @@ -127,4 +129,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml index 311ec9b0bc..ee88b9de87 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml @@ -32,6 +32,7 @@ 020001 020002 100001 + 222222 @@ -87,6 +88,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb 10,0,0,0 @@ -95,4 +97,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml index 9966bd0e90..2a8147140d 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml @@ -34,6 +34,7 @@ 020001 020002 100001 + 222222 @@ -95,10 +96,18 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_ntn_geo 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml b/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml index 8f1039f5cd..f3be815e30 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml @@ -32,6 +32,7 @@ 000004 000005 100001 + 222222 @@ -83,6 +84,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_sidelink 1,0,0,0 @@ -91,4 +93,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml index a169c78528..3b48f7b901 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml @@ -33,6 +33,8 @@ 020001 020002 100001 + 004000 + 222222 @@ -93,6 +95,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_tdd_dora 0,0,0,0 @@ -101,4 +104,19 @@ 0 + + Custom_Command + true + Clean-Up any residual volume + cacofonix + docker volume rm 5g_rfsimulator_tdd_dora_rrc.config + + + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml index 51b59d35f1..cb4a9cd9f7 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml @@ -35,6 +35,7 @@ 030001 030002 100001 + 222222 @@ -119,6 +120,7 @@ Undeploy_Object + true Undeploy all OAI 5G stack ci-scripts/yaml_files/5g_rfsimulator_u0_25prb 1,0,0,0 @@ -127,4 +129,11 @@ 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml index 268be0974c..54261b3505 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml @@ -54,6 +54,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml Custom_Command + true Enable Sleep States hutch sudo cpupower idle-set -E @@ -86,6 +87,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1 0 @@ -99,6 +101,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -109,6 +112,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml Detach_UE + true Detach UEs adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml index adfe8860d6..3c47ffce7b 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml @@ -53,6 +53,7 @@ Custom_Command + true Enable Sleep States hutch sudo cpupower idle-set -E @@ -94,6 +95,7 @@ Undeploy_Object + true Undeploy RCC/RRU ci-scripts/yaml_files/lte_b200_fdd_05Mhz_if4.5 0 @@ -107,6 +109,7 @@ Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -117,6 +120,7 @@ Detach_UE + true Detach UEs adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml index 673bf65609..2674c4198d 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml @@ -52,6 +52,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm Custom_Command + true Enable Sleep States hutch sudo cpupower idle-set -E @@ -72,6 +73,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity 0 @@ -85,6 +87,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -95,6 +98,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml index 472122d2e4..ea95961cba 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml @@ -54,6 +54,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Custom_Command + true Enable Sleep States hutch sudo cpupower idle-set -E @@ -80,6 +81,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1 0 @@ -93,6 +95,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -103,6 +106,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml index 1534150b01..9f927db4d4 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml @@ -53,6 +53,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Custom_Command + true Enable Sleep States hutch sudo cpupower idle-set -E @@ -73,6 +74,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx 0 @@ -86,6 +88,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -96,6 +99,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml index 0e58e6b6ed..cefa6cd5c1 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml @@ -41,6 +41,8 @@ 030211 200000 200001 +222222 +333333 @@ -70,12 +72,14 @@ Custom_Command + true Enable Sleep States (hutch) hutch sudo cpupower idle-set -E Custom_Command + true Enable Sleep States (carabe) carabe sudo cpupower idle-set -E @@ -121,6 +125,7 @@ Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_magma 0 @@ -129,6 +134,7 @@ Undeploy_Object + true Undeploy LTE-UE ci-scripts/yaml_files/lte_b200_fdd_10Mhz_oai_ue_magma 1 @@ -180,4 +186,18 @@ nano-cn4g + + Clean_Test_Server_Images + true + Clean Test Images on eNB Test Server + 0 + + + + Clean_Test_Server_Images + true + Clean Test Images on LTE-UE Test Server + 1 + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml index 48aa606fa4..07960f3a37 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml @@ -53,6 +53,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Custom_Command + true Enable Sleep States hutch sudo cpupower idle-set -E @@ -79,6 +80,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1 0 @@ -92,6 +94,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -102,6 +105,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml index a512156ff5..52a8df3146 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml @@ -54,6 +54,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml Custom_Command + true Enable Sleep States starsky sudo cpupower idle-set -E @@ -87,6 +88,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1 0 @@ -100,6 +102,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -110,6 +113,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml index 827675f3fb..62c5e5e476 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml @@ -33,7 +33,6 @@ 030135 040301 040532 040631 040632 040634 040635 040681 040682 040684 040685 040401 040201 030231 -040101 200000 @@ -53,6 +52,7 @@ Custom_Command + true Enable Sleep States starsky sudo cpupower idle-set -E @@ -95,6 +95,7 @@ Undeploy_Object + true Undeploy RRU/RCC ci-scripts/yaml_files/lte_b200_tdd_05Mhz_if4.5 0 @@ -108,6 +109,7 @@ Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -118,6 +120,7 @@ Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml index 77a13d9407..9111f00365 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml @@ -52,6 +52,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm2.xml Custom_Command + true Enable Sleep States starsky sudo cpupower idle-set -E @@ -78,6 +79,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm2.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2 0 @@ -91,6 +93,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm2.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -101,6 +104,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm2.xml Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml index ed37d24eae..574e75d780 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml @@ -52,6 +52,7 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml Custom_Command + true Enable Sleep States starsky sudo cpupower idle-set -E @@ -78,6 +79,7 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1 0 @@ -91,6 +93,7 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -101,6 +104,7 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml index 1a9983e67e..516bc48444 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml @@ -52,6 +52,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml Custom_Command + true Enable Sleep States starsky sudo cpupower idle-set -E @@ -78,6 +79,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1 0 @@ -91,6 +93,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -101,6 +104,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml index e3f0f49140..8156eb517d 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml @@ -53,6 +53,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml Custom_Command + true Enable Sleep States starsky sudo cpupower idle-set -E @@ -79,6 +80,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler 0 @@ -92,6 +94,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml Terminate_UE + true Terminate UE adb_ue_1 adb_ue_2 @@ -102,6 +105,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml Detach_UE + true Detach UE adb_ue_1 adb_ue_2 diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml index 8316645417..cfae0e6188 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml @@ -40,6 +40,7 @@ 070001 010010 030201 +333333 @@ -130,12 +131,14 @@ Detach_UE + true Detach UE up2 Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm1 0 @@ -146,5 +149,12 @@ --> + + Clean_Test_Server_Images + true + Clean Test Images + 0 + + diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml index 96baab0793..1df5ea169c 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml @@ -40,6 +40,7 @@ 071001 010010 031201 +333333 @@ -130,12 +131,14 @@ Detach_UE + true Detach UE up2 Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm2 0 @@ -146,5 +149,13 @@ --> + + Clean_Test_Server_Images + true + Clean Test Images + 0 + + + diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index de6098209f..7e831b2454 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -49,6 +49,8 @@ 030201 300000 600000 + 222220 + 222221 @@ -81,6 +83,7 @@ Custom_Command + true Enable Sleep States (nepes) nepes sudo cpupower idle-set -E @@ -93,6 +96,7 @@ Custom_Command + true Enable Sleep States (ofqot) ofqot sudo cpupower idle-set -E @@ -105,6 +109,7 @@ Terminate_UE + true Terminate Quectel idefix @@ -115,6 +120,7 @@ Detach_UE + true Detach UE idefix @@ -224,6 +230,7 @@ Undeploy_Object + true Undeploy eNB ci-scripts/yaml_files/nsa_b200_enb 0 @@ -232,6 +239,7 @@ Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/nsa_b200_gnb 1 @@ -240,5 +248,19 @@ 10,100,100,100 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 1 + + diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel.xml b/ci-scripts/xml_files/container_sa_aerial_quectel.xml index 50a1a02256..43fdf4b65b 100644 --- a/ci-scripts/xml_files/container_sa_aerial_quectel.xml +++ b/ci-scripts/xml_files/container_sa_aerial_quectel.xml @@ -36,6 +36,7 @@ 000033 000222 222222 + 333333 @@ -107,12 +108,14 @@ Detach_UE + true Detach Quectel up2-aerial Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/sa_gnb_aerial 0 @@ -120,5 +123,13 @@ 20,100,100,100 20,100,100,100 + + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue.xml b/ci-scripts/xml_files/container_sa_aw2s_asue.xml index 4900330911..3929687f1b 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue.xml @@ -56,6 +56,7 @@ 004000 000002 030000 + 333333 @@ -242,12 +243,14 @@ Detach_UE + true Detach UE amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 amarisoft_ue_16 Terminate_UE + true Terminate UE amarisoft_ue @@ -260,10 +263,18 @@ Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/sa_aw2s_gnb 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml index acc9e15e5c..4776bd784e 100644 --- a/ci-scripts/xml_files/container_sa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml @@ -70,6 +70,7 @@ Custom_Command + true Enable Sleep States ofqot sudo cpupower idle-set -E @@ -82,6 +83,7 @@ Terminate_UE + true Terminate Quectel idefix @@ -92,6 +94,7 @@ Detach_UE + true Detach UE idefix @@ -203,6 +206,7 @@ Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/sa_b200_gnb 0 diff --git a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml index f31ef7e7eb..4e4eab92c1 100644 --- a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml @@ -49,6 +49,7 @@ 310002 330201 200000 + 222222 @@ -66,6 +67,7 @@ Terminate_UE + true Terminate Quectel idefix @@ -76,6 +78,7 @@ Detach_UE + true Detach Quectel idefix @@ -118,6 +121,7 @@ Custom_Command + true Enable Sleep States ofqot sudo cpupower idle-set -E @@ -201,7 +205,8 @@ Undeploy_Object - Undeploy CU-DU + true + Undeploy CUCP/CU-UP/DU ci-scripts/yaml_files/sa_e1_b200_gnb 0 0 @@ -209,5 +214,12 @@ 10,100,100,100 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml index 1b3c9baa33..4cce964633 100644 --- a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml @@ -66,6 +66,7 @@ Terminate_UE + true Terminate Quectel idefix @@ -76,6 +77,7 @@ Detach_UE + true Detach Quectel idefix @@ -110,6 +112,7 @@ Custom_Command + true Enable Sleep States ofqot sudo cpupower idle-set -E @@ -226,6 +229,7 @@ Undeploy_Object + true Undeploy CU-DU ci-scripts/yaml_files/sa_f1_b200_gnb 0 diff --git a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml index 3d2a7a9387..b81ef51d5b 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml @@ -39,6 +39,8 @@ 103000 100002 130000 + 777777 + 888888 @@ -127,6 +129,7 @@ Detach_UE + true Detach UE up2-fhi72 @@ -139,10 +142,28 @@ Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/sa_fhi_7.2_vvdn_gnb 0 0 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + + + Custom_Command + true + Set CPU to idle state, set kernel parameters to default values + cacofonix + /opt/FHI7.2/setup_cleanup.sh + yes + + + diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml index 272582a46e..c713e5a431 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml @@ -39,6 +39,7 @@ 000001 040201 200000 + 033333 @@ -58,6 +59,7 @@ Custom_Command + true Enable Sleep States matix sudo cpupower idle-set -E @@ -71,6 +73,7 @@ Detach_UE + true Detach UE up2 @@ -139,6 +142,7 @@ Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/5g_sa_n310_2x2_100MHz 0 @@ -148,5 +152,12 @@ 10,100,100,100 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml index 4c619255f1..fc0baadaca 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml @@ -39,6 +39,7 @@ 000001 030201 200000 + 333333 @@ -58,6 +59,7 @@ Custom_Command + true Enable Sleep States matix sudo cpupower idle-set -E @@ -71,6 +73,7 @@ Detach_UE + true Detach UE up2 @@ -139,6 +142,7 @@ Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/5g_sa_n310_2x2_60MHz 0 @@ -148,5 +152,12 @@ 10,100,100,100 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_sa_n310_nrue.xml b/ci-scripts/xml_files/container_sa_n310_nrue.xml index a44c703322..f00a452403 100644 --- a/ci-scripts/xml_files/container_sa_n310_nrue.xml +++ b/ci-scripts/xml_files/container_sa_n310_nrue.xml @@ -36,6 +36,8 @@ 000100 000200 040001 040000 + 333333 + 444444 @@ -139,6 +141,7 @@ Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/5g_sa_n310_gnb 0 @@ -149,10 +152,25 @@ Undeploy_Object + true Undeploy nr UE ci-scripts/yaml_files/5g_sa_n310_nrue 1 1 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 1 + + diff --git a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml index 425edc12ee..d0dc59f3cc 100644 --- a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml @@ -64,6 +64,7 @@ Custom_Command + true Enable Sleep States ofqot sudo cpupower idle-set -E @@ -76,6 +77,7 @@ Terminate_UE + true Terminate Quectel idefix @@ -86,6 +88,7 @@ Detach_UE + true Detach UE idefix @@ -197,6 +200,7 @@ Undeploy_Object + true Undeploy gNB ci-scripts/yaml_files/sa_sc_b200_gnb 0 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 20f502e9ac..caea61f3b4 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -57,6 +57,7 @@ Custom_Command + true Enable Sleep States (obelix) obelix sudo cpupower idle-set -E @@ -69,6 +70,7 @@ Custom_Command + true Enable Sleep States (asterix) asterix sudo cpupower idle-set -E @@ -81,6 +83,7 @@ Terminate_UE + true Terminate Quectel nrmodule2_quectel @@ -91,6 +94,7 @@ Detach_UE + true Detach Quectel nrmodule2_quectel @@ -183,6 +187,7 @@ Terminate_eNB + true Terminate eNB 0 0 @@ -191,6 +196,7 @@ Terminate_eNB + true Terminate gNB 1 1 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index b089d1d75c..170bb6443b 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -62,6 +62,7 @@ Terminate_UE + true Terminate Quectel nrmodule2_quectel @@ -84,6 +85,7 @@ Custom_Command + true Enable Sleep States (asterix) asterix sudo cpupower idle-set -E @@ -96,6 +98,7 @@ Custom_Command + true Enable Sleep States (obelix) obelix sudo cpupower idle-set -E @@ -151,6 +154,7 @@ Terminate_eNB + true Terminate eNB 0 0 @@ -159,6 +163,7 @@ Terminate_eNB + true Terminate gNB 1 1 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 142e4014dd..755f3ad969 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -91,6 +91,7 @@ Terminate_UE + true Terminate Quectel idefix @@ -101,6 +102,7 @@ Detach_UE + true Detach Quectel idefix @@ -174,6 +176,7 @@ Terminate_eNB + true Terminate eNB 0 0 @@ -182,6 +185,7 @@ Terminate_eNB + true Terminate gNB 1 1 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml index df8b1c049d..66bcf54be2 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml @@ -57,6 +57,7 @@ Terminate_UE + true Terminate Quectel idefix @@ -139,6 +140,7 @@ Terminate_eNB + true Terminate eNB 0 0 @@ -147,6 +149,7 @@ Terminate_eNB + true Terminate gNB 1 1 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml index 05fbcc4ab6..aebf6bf668 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml @@ -53,6 +53,7 @@ Terminate_UE + true Terminate Quectel idefix @@ -63,6 +64,7 @@ Detach_UE + true Detach Quectel idefix @@ -136,6 +138,7 @@ Terminate_eNB + true Terminate eNB 0 0 @@ -144,6 +147,7 @@ Terminate_eNB + true Terminate gNB 1 1 diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml index 3bf54786b5..88f5079b68 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml @@ -36,6 +36,7 @@ Custom_Command + true Enable Sleep States caracal sudo cpupower idle-set -E @@ -60,6 +61,7 @@ Terminate_eNB + true Terminate gNB NR diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_100_2x2.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_100_2x2.xml index daea0f4456..f81d747bfe 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_100_2x2.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_100_2x2.xml @@ -36,6 +36,7 @@ Custom_Command + true Enable Sleep States caracal sudo cpupower idle-set -E @@ -60,6 +61,7 @@ Terminate_eNB + true Terminate gNB NR diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml index b436e79b17..4b0fec92e2 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml @@ -36,6 +36,7 @@ Custom_Command + true Enable Sleep States caracal sudo cpupower idle-set -E @@ -60,6 +61,7 @@ Terminate_eNB + true Terminate gNB NR diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml index e6aeb6cdee..f9e298127f 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml @@ -36,6 +36,7 @@ Custom_Command + true Enable Sleep States caracal sudo cpupower idle-set -E @@ -60,6 +61,7 @@ Terminate_eNB + true Terminate gNB NR From 5d5ade16972f3703d15a79a208528d9bd16aba2f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 23 Sep 2024 16:52:16 +0200 Subject: [PATCH 71/87] Remove superfluous cleanup/terminate/teardown XMLs After the previous commit, the CI will always do an undeployment step even if the CI failed. Hence, these XMLs are not necessary anymore. Some XMLs are updated to do what their "cleanup XML" counterparts did, such as removing additional images. --- .../xml_files/container_4g_l2sim_tdd_down.xml | 47 ----------- .../container_4g_rfsim_fdd_05MHz_down.xml | 47 ----------- ...container_4g_rfsim_fdd_05MHz_noS1_down.xml | 47 ----------- .../container_4g_rfsim_fdd_10MHz_down.xml | 47 ----------- .../container_4g_rfsim_fdd_20MHz_down.xml | 47 ----------- .../container_4g_rfsim_fembms_down.xml | 47 ----------- .../container_4g_rfsim_mbms_down.xml | 47 ----------- .../container_4g_rfsim_tdd_05MHz_down.xml | 47 ----------- .../xml_files/container_5g_e1_rfsim_down.xml | 47 ----------- .../xml_files/container_5g_f1_rfsim_down.xml | 47 ----------- .../xml_files/container_5g_fdd_rfsim_down.xml | 47 ----------- .../xml_files/container_5g_l2sim_tdd_down.xml | 47 ----------- .../container_5g_rfsim_24prb_down.xml | 47 ----------- .../xml_files/container_5g_rfsim_2x2_down.xml | 47 ----------- .../xml_files/container_5g_rfsim_down.xml | 47 ----------- .../container_5g_rfsim_f1_accelleran_down.xml | 47 ----------- .../container_5g_rfsim_fdd_phytest_down.xml | 55 ------------- .../container_5g_rfsim_fr2_32prb_down.xml | 47 ----------- .../container_5g_rfsim_ntn_geo_down.xml | 47 ----------- .../container_5g_rfsim_sidelink_down.xml | 47 ----------- .../container_5g_rfsim_tdd_dora_down.xml | 55 ------------- .../container_5g_rfsim_u0_25prb_down.xml | 47 ----------- .../container_lte_b200_fdd_05Mhz_tm1.xml | 8 ++ ...container_lte_b200_fdd_05Mhz_tm1_if4_5.xml | 8 ++ ...lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml | 8 ++ .../container_lte_b200_fdd_10Mhz_tm1.xml | 8 ++ .../container_lte_b200_fdd_10Mhz_tm1_cdrx.xml | 8 ++ ...r_lte_b200_fdd_10Mhz_tm1_oaiue_cleanup.xml | 63 --------------- .../container_lte_b200_fdd_20Mhz_tm1.xml | 8 ++ .../container_lte_b200_fdd_cleanup.xml | 38 --------- .../container_lte_b200_tdd_05Mhz_tm1.xml | 8 ++ ...container_lte_b200_tdd_05Mhz_tm1_if4_5.xml | 8 ++ .../container_lte_b200_tdd_10Mhz_tm1.xml | 8 ++ .../container_lte_b200_tdd_20Mhz_tm1.xml | 8 ++ ...e_b200_tdd_20Mhz_tm1_default_scheduler.xml | 8 ++ .../container_lte_b200_tdd_cleanup.xml | 38 --------- .../container_lte_n3xx_tdd_2x2_cleanup.xml | 54 ------------- .../container_nsa_b200_terminate.xml | 77 ------------------- .../container_sa_aerial_quectel_cleanup.xml | 54 ------------- .../container_sa_aw2s_asue_cleanup.xml | 55 ------------- .../xml_files/container_sa_b200_terminate.xml | 53 ------------- .../container_sa_e1_b200_terminate.xml | 60 --------------- .../container_sa_f1_b200_terminate.xml | 53 ------------- .../container_sa_fhi72_vvdn_up2_cleanup.xml | 63 --------------- .../container_sa_n310_2X2_100MHz_cleanup.xml | 55 ------------- .../container_sa_n310_2X2_60MHz_cleanup.xml | 55 ------------- .../container_sa_n310_nrue_cleanup.xml | 64 --------------- .../container_sa_sc_b200_terminate.xml | 53 ------------- 48 files changed, 88 insertions(+), 1885 deletions(-) delete mode 100644 ci-scripts/xml_files/container_4g_l2sim_tdd_down.xml delete mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml delete mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml delete mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml delete mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml delete mode 100644 ci-scripts/xml_files/container_4g_rfsim_fembms_down.xml delete mode 100644 ci-scripts/xml_files/container_4g_rfsim_mbms_down.xml delete mode 100644 ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_e1_rfsim_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_f1_rfsim_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_l2sim_tdd_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_24prb_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_2x2_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_f1_accelleran_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_fdd_phytest_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_fr2_32prb_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_ntn_geo_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_sidelink_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_tdd_dora_down.xml delete mode 100644 ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml delete mode 100644 ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_lte_b200_fdd_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_nsa_b200_terminate.xml delete mode 100644 ci-scripts/xml_files/container_sa_aerial_quectel_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_sa_aw2s_asue_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_sa_b200_terminate.xml delete mode 100644 ci-scripts/xml_files/container_sa_e1_b200_terminate.xml delete mode 100644 ci-scripts/xml_files/container_sa_f1_b200_terminate.xml delete mode 100644 ci-scripts/xml_files/container_sa_fhi72_vvdn_up2_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_sa_n310_2X2_100MHz_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_sa_n310_2X2_60MHz_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_sa_n310_nrue_cleanup.xml delete mode 100644 ci-scripts/xml_files/container_sa_sc_b200_terminate.xml diff --git a/ci-scripts/xml_files/container_4g_l2sim_tdd_down.xml b/ci-scripts/xml_files/container_4g_l2sim_tdd_down.xml deleted file mode 100644 index 8ac78f544d..0000000000 --- a/ci-scripts/xml_files/container_4g_l2sim_tdd_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - l2sim-4glte-down - CleanUp 4G L2 sim - FDD eNB - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 4G stack - ci-scripts/yaml_files/4g_l2sim_fdd - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml deleted file mode 100644 index f7ac0a00d6..0000000000 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-4glte-fdd05mhz-down - CleanUp 4G RF - trash - - 100011 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 4G stack - ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml deleted file mode 100644 index d1b6d6ab93..0000000000 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-4glte-fdd05mhz-nos1-down - CleanUp 4G RF - trash - - 100011 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 4G stack - ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1 - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml deleted file mode 100644 index 2cb868e17a..0000000000 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-4glte-fdd10mhz-down - CleanUp 4G RF - trash - - 100011 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 4G stack - ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml deleted file mode 100644 index 0582267082..0000000000 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-4glte-fdd20mhz-down - CleanUp 4G RF - trash - - 100011 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 4G stack - ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_4g_rfsim_fembms_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fembms_down.xml deleted file mode 100644 index d78e9794e0..0000000000 --- a/ci-scripts/xml_files/container_4g_rfsim_fembms_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-4glte-fembms-down - CleanUp 4G RF - trash - - 100011 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 4G stack - ci-scripts/yaml_files/4g_rfsimulator_fembms - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_4g_rfsim_mbms_down.xml b/ci-scripts/xml_files/container_4g_rfsim_mbms_down.xml deleted file mode 100644 index 3ad172be93..0000000000 --- a/ci-scripts/xml_files/container_4g_rfsim_mbms_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-4glte-mbms-down - CleanUp 4G RF - trash - - 100011 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 4G stack - ci-scripts/yaml_files/4g_rfsimulator_mbms - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml deleted file mode 100644 index 0a6d6bb890..0000000000 --- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-4glte-tdd05mhz-down - CleanUp 4G RF - trash - - 100011 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 4G stack - ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_e1_rfsim_down.xml b/ci-scripts/xml_files/container_5g_e1_rfsim_down.xml deleted file mode 100644 index 3f10e0e32c..0000000000 --- a/ci-scripts/xml_files/container_5g_e1_rfsim_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-down-e1 - CleanUp E1+F1 split - trash - - 100022 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_e1 - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim_down.xml b/ci-scripts/xml_files/container_5g_f1_rfsim_down.xml deleted file mode 100644 index 18b917697c..0000000000 --- a/ci-scripts/xml_files/container_5g_f1_rfsim_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-down-f1 - CleanUp CU-DU F1 split - trash - - 100022 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_f1_rfsimulator - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml deleted file mode 100644 index 85421f7b6d..0000000000 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-fdd-down - CleanUp Monolithic FDD gNB with SDAP - trash - - 100012 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_fdd_rfsimulator - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_l2sim_tdd_down.xml b/ci-scripts/xml_files/container_5g_l2sim_tdd_down.xml deleted file mode 100644 index 36ce7c71f6..0000000000 --- a/ci-scripts/xml_files/container_5g_l2sim_tdd_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - l2sim-5gnr-down - CleanUp 5G L2 sim - TDD gNB - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_l2sim_tdd - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_24prb_down.xml b/ci-scripts/xml_files/container_5g_rfsim_24prb_down.xml deleted file mode 100644 index 09084b0503..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_24prb_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-24prb-5gnr-down - CleanUp Monolithic SA TDD gNB 24PRB - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_24prb - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_2x2_down.xml b/ci-scripts/xml_files/container_5g_rfsim_2x2_down.xml deleted file mode 100644 index 5d92987c5b..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_2x2_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-2x2-down - CleanUp SA Monolithic TDD 2x2 gNB - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_2x2 - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_down.xml b/ci-scripts/xml_files/container_5g_rfsim_down.xml deleted file mode 100644 index 0c9348e8d6..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-down - CleanUp SA Monolithic TDD gNB - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran_down.xml b/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran_down.xml deleted file mode 100644 index c8960ccae8..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-down-f1-accelleran - CleanUp - trash - - 100022 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_accelleran - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest_down.xml b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest_down.xml deleted file mode 100644 index 14c3f0f32a..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest_down.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - rfsim-5gnr-fdd-phytest-down - CleanUp Monolithic FDD phytest gNB - trash - - 100012 - 004000 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest - 0 - 0 - - - - Custom_Command - Clean-Up any residual volume - cacofonix - docker volume rm 5g_rfsimulator_fdd_phytest_rrc.config - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb_down.xml b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb_down.xml deleted file mode 100644 index 9537b0d5bb..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-fr2-32prb-5gnr-down - CleanUp Monolithic FR2 do-ra gNB - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo_down.xml b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo_down.xml deleted file mode 100644 index 48b4a67fb2..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-ntn-geo-down - CleanUp SA Monolithic NTN GEO gNB - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_ntn_geo - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_sidelink_down.xml b/ci-scripts/xml_files/container_5g_rfsim_sidelink_down.xml deleted file mode 100644 index 6608ebc572..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_sidelink_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-sidelink-down - CleanUp sidelink test - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_sidelink - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora_down.xml b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora_down.xml deleted file mode 100644 index 35ebe2314a..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora_down.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - rfsim-tdd-dora-5gnr-down - CleanUp Monolithic do-ra TDD gNB - trash - - 100002 - 004000 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_tdd_dora - 0 - 0 - - - - Custom_Command - Clean-Up any residual volume - cacofonix - docker volume rm 5g_rfsimulator_tdd_dora_rrc.config - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml deleted file mode 100644 index 78b9aacc95..0000000000 --- a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - rfsim-5gnr-u0-25prb-down - CleanUp SA Monolithic FDD u0 25PRB gNB - trash - - 100002 - 222222 - - - - - Undeploy_Object - Undeploy all OAI 5G stack - ci-scripts/yaml_files/5g_rfsimulator_u0_25prb - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml index 54261b3505..607c1ebcdd 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml @@ -36,6 +36,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 200000 +222222 @@ -206,5 +207,12 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml index 3c47ffce7b..53eec11f20 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml @@ -35,6 +35,7 @@ 040301 040531 040633 040634 040636 040671 040672 040673 040401 040201 030231 200000 +222222 @@ -189,4 +190,11 @@ ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml index 2674c4198d..669f46f2ec 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml @@ -35,6 +35,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030202 200000 +222222 @@ -171,5 +172,12 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm adb_ue_1 adb_ue_2 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml index ea95961cba..2aa378b223 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml @@ -37,6 +37,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml 040301 040511 040613 040614 040615 040651 040652 040653 040654 040401 040201 030211 200000 +222222 @@ -201,5 +202,12 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml index 9f927db4d4..55653d6e4a 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml @@ -36,6 +36,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml 040201 030212 200000 +222222 @@ -133,5 +134,12 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue_cleanup.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue_cleanup.xml deleted file mode 100644 index 03d502fe14..0000000000 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue_cleanup.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - images-clean-up - Images Clean-Up - trash - -000000 -111111 -222222 -333333 - - - - - Undeploy_Object - Undeploy eNB - ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_magma - 0 - 0 - - - - Undeploy_Object - Undeploy LTE-UE - ci-scripts/yaml_files/lte_b200_fdd_10Mhz_oai_ue_magma - 1 - 1 - - - - Clean_Test_Server_Images - Clean Test Images on eNB Test Server - 0 - - - - Clean_Test_Server_Images - Clean Test Images on LTE-UE Test Server - 1 - - - diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml index 07960f3a37..61fa2dea11 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml @@ -36,6 +36,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml 040301 040521 040623 040624 040625 040662 040401 040201 030221 200000 +222222 @@ -201,5 +202,12 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_cleanup.xml b/ci-scripts/xml_files/container_lte_b200_fdd_cleanup.xml deleted file mode 100644 index bc9d2cb361..0000000000 --- a/ci-scripts/xml_files/container_lte_b200_fdd_cleanup.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - test-fdd-cleanup - CleanUp 4G LTE FDD - trash - - 222222 - - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml index 52a8df3146..76bd380f4f 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml @@ -36,6 +36,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml 040301 040501 040602 040601 040603 040604 040605 040642 040641 040643 040644 040645 040401 040201 030204 200000 +222222 @@ -218,4 +219,11 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml index 62c5e5e476..ec280240e0 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml @@ -34,6 +34,7 @@ 040301 040532 040631 040632 040634 040635 040681 040682 040684 040685 040401 040201 030231 200000 +222222 @@ -204,4 +205,11 @@ ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml index 574e75d780..7218dcc576 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml @@ -35,6 +35,7 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml 040301 040511 040612 040611 040613 040614 040615 040652 040651 040653 040654 040655 040401 040201 030214 200000 +222222 @@ -209,4 +210,11 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml index 516bc48444..4ed3e89e59 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml @@ -35,6 +35,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml 040301 040521 040622 040621 040623 040662 040401 040201 030224 200000 +222222 @@ -207,4 +208,11 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml index 8156eb517d..9ae77ccec3 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml @@ -35,6 +35,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml 040301 040522 040627 040626 040628 040629 040630 040667 040666 040668 040669 040670 040401 040201 030225 200000 +222222 @@ -212,4 +213,11 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml ltebox-nano + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml b/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml deleted file mode 100644 index 671ef0e5f4..0000000000 --- a/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - test-tdd-cleanup - CleanUp 4G LTE TDD - trash - - 222222 - - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_cleanup.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_cleanup.xml deleted file mode 100644 index 01c89ae585..0000000000 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_cleanup.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - images-clean-up - Images Clean-Up - trash - -111111 -222222 -333333 - - - - - Detach_UE - Detach UE - up2 - - - - Undeploy_Object - Undeploy eNB - ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm2 - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images - 0 - - - diff --git a/ci-scripts/xml_files/container_nsa_b200_terminate.xml b/ci-scripts/xml_files/container_nsa_b200_terminate.xml deleted file mode 100644 index b470cfb8b4..0000000000 --- a/ci-scripts/xml_files/container_nsa_b200_terminate.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - TEST-NSA-FR1-TM1-B200-terminate - NSA tear-down in case of problem - tasks - - 010001 - 010002 - 030202 - 030201 - 222220 - 222221 - - - - - Detach_UE - Detach UE - idefix - - - Terminate_UE - Terminate Quectel - idefix - - - - Undeploy_Object - Undeploy eNB - ci-scripts/yaml_files/nsa_b200_enb - 0 - 0 - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/nsa_b200_gnb - 1 - 1 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 1 - - - - diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel_cleanup.xml b/ci-scripts/xml_files/container_sa_aerial_quectel_cleanup.xml deleted file mode 100644 index 4a8a88fd8a..0000000000 --- a/ci-scripts/xml_files/container_sa_aerial_quectel_cleanup.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - test-aerial-cleanup - CleanUp AERIAL - trash - - 000000 - 111111 - 222222 - - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/sa_gnb_aerial - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - - Detach_UE - Terminate UE - up2-aerial - - - diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue_cleanup.xml b/ci-scripts/xml_files/container_sa_aw2s_asue_cleanup.xml deleted file mode 100644 index 0b90afeee3..0000000000 --- a/ci-scripts/xml_files/container_sa_aw2s_asue_cleanup.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - test-aw2s-cleanup - CleanUp AW2S ASUE - trash - - 111111 - 222222 - 333333 - - - - - Terminate_UE - Terminate UE - amarisoft_ue - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/sa_aw2s_gnb - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - - diff --git a/ci-scripts/xml_files/container_sa_b200_terminate.xml b/ci-scripts/xml_files/container_sa_b200_terminate.xml deleted file mode 100644 index 2d7872e8d8..0000000000 --- a/ci-scripts/xml_files/container_sa_b200_terminate.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - TEST-SA-FR1-B200-terminate - Tear-down - tasks - - 010001 - 010002 - 030201 - - - - - Detach_UE - Detach UE - idefix - - - Terminate_UE - Terminate Quectel - idefix - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/sa_b200_gnb - 0 - 0 - - - diff --git a/ci-scripts/xml_files/container_sa_e1_b200_terminate.xml b/ci-scripts/xml_files/container_sa_e1_b200_terminate.xml deleted file mode 100644 index 811b047a4a..0000000000 --- a/ci-scripts/xml_files/container_sa_e1_b200_terminate.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - TEST-SA-FR1-F1-E1-B200-terminate - Tear-down - tasks - - 010001 - 010002 - 330201 - 222222 - - - - - Detach_UE - Detach UE - idefix - - - Terminate_UE - Terminate Quectel - idefix - - - - Undeploy_Object - Undeploy CU-CP/CU-UP/DU - ci-scripts/yaml_files/sa_e1_b200_gnb - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_sa_f1_b200_terminate.xml b/ci-scripts/xml_files/container_sa_f1_b200_terminate.xml deleted file mode 100644 index 92e5472c85..0000000000 --- a/ci-scripts/xml_files/container_sa_f1_b200_terminate.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - TEST-SA-FR1-F1-B200-terminate - Tear-down - tasks - - 010001 - 010002 - 230201 - - - - - Detach_UE - Detach UE - idefix - - - Terminate_UE - Terminate Quectel - idefix - - - - Undeploy_Object - Undeploy CU-DU - ci-scripts/yaml_files/sa_f1_b200_gnb - 0 - 0 - - - diff --git a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2_cleanup.xml b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2_cleanup.xml deleted file mode 100644 index 1a9aecfc8a..0000000000 --- a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2_cleanup.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - cleanup-fhi72-vvdn - Cleanup VVDN - trash - - 555555 - 666666 - 777777 - 888888 - - - - - Detach_UE - Detach UE - up2-fhi72 - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/sa_fhi_7.2_vvdn_gnb - 0 - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - - Custom_Command - Set CPU to idle state, set kernel parameters to default values - cacofonix - /opt/FHI7.2/setup_cleanup.sh - yes - - - diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_cleanup.xml b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_cleanup.xml deleted file mode 100644 index eb62cdbdd3..0000000000 --- a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_cleanup.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - test-cleanup - CleanUp SA 2x2 - trash - - 011111 - 022222 - 033333 - - - - - Detach_UE - Detach UE - up2 - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/5g_sa_n310_2x2_100MHz - 0 - 0 - oai-gnb - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_cleanup.xml b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_cleanup.xml deleted file mode 100644 index 3efd2f7be8..0000000000 --- a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_cleanup.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - test-cleanup - CleanUp SA 2x2 - trash - - 111111 - 222222 - 333333 - - - - - Detach_UE - Detach UE - up2 - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/5g_sa_n310_2x2_60MHz - 0 - 0 - oai-gnb - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - diff --git a/ci-scripts/xml_files/container_sa_n310_nrue_cleanup.xml b/ci-scripts/xml_files/container_sa_n310_nrue_cleanup.xml deleted file mode 100644 index 035e38a40d..0000000000 --- a/ci-scripts/xml_files/container_sa_n310_nrue_cleanup.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - test-aw2s-cleanup - CleanUp of test servers - trash - - 111111 - 222222 - 333333 - 444444 - - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/5g_sa_n310_gnb - 0 - 0 - - - - Undeploy_Object - Undeploy nr UE - ci-scripts/yaml_files/5g_sa_n310_nrue - 1 - 1 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 0 - - - - Clean_Test_Server_Images - Clean Test Images on Test Server - 1 - - - - diff --git a/ci-scripts/xml_files/container_sa_sc_b200_terminate.xml b/ci-scripts/xml_files/container_sa_sc_b200_terminate.xml deleted file mode 100644 index 9db4c663f0..0000000000 --- a/ci-scripts/xml_files/container_sa_sc_b200_terminate.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - TEST-SA-FR1-B200-terminate - Tear-down - tasks - - 010001 - 010002 - 030201 - - - - - Detach_UE - Detach UE - idefix - - - Terminate_UE - Terminate Quectel - idefix - - - - Undeploy_Object - Undeploy gNB - ci-scripts/yaml_files/sa_sc_b200_gnb - 0 - 0 - - - From 606e2c749a62d8aaa4525de84a417d671e5a5b8c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 26 Sep 2024 01:12:05 +0200 Subject: [PATCH 72/87] cls_cmd: execute commands through bash The next commit will use "echo -e". The problem with that is that bash and sh differ: - in bash: this results in "a\nb" (a+newline+b) - in sh: this results in -e a\nb (-e a+newline+b) The problem is that by default, commands are executed through sh, which nobody expects. Change to bash, which is likely more aligned with what people want to use. --- ci-scripts/cls_cmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_cmd.py b/ci-scripts/cls_cmd.py index 52fae37a08..f1527fd08a 100644 --- a/ci-scripts/cls_cmd.py +++ b/ci-scripts/cls_cmd.py @@ -106,10 +106,10 @@ class LocalCmd(Cmd): if line.strip().endswith('&'): # if we wait for stdout, subprocess does not return before the end of the command # however, we don't want to wait for commands with &, so just return fake command - ret = sp.run(line, shell=True, cwd=self.cwd, timeout=5) + ret = sp.run(line, shell=True, cwd=self.cwd, timeout=5, executable='/bin/bash') time.sleep(0.1) else: - ret = sp.run(line, shell=True, cwd=self.cwd, stdout=sp.PIPE, stderr=sp.STDOUT, timeout=timeout) + ret = sp.run(line, shell=True, cwd=self.cwd, stdout=sp.PIPE, stderr=sp.STDOUT, timeout=timeout, executable='/bin/bash') except Exception as e: ret = sp.CompletedProcess(args=line, returncode=255, stdout=f'Exception: {str(e)}'.encode('utf-8')) if ret.stdout is None: From f21b5d2ef4e1003e3c66ff822a9769659e8dea28 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 25 Sep 2024 13:54:06 +0200 Subject: [PATCH 73/87] CI: Add basic unittest for cls_cmd --- ci-scripts/tests/cmd.py | 56 +++++++++++++++++++++++++ ci-scripts/tests/scripts/hello-fail.sh | 4 ++ ci-scripts/tests/scripts/hello-world.sh | 4 ++ 3 files changed, 64 insertions(+) create mode 100644 ci-scripts/tests/cmd.py create mode 100755 ci-scripts/tests/scripts/hello-fail.sh create mode 100755 ci-scripts/tests/scripts/hello-world.sh diff --git a/ci-scripts/tests/cmd.py b/ci-scripts/tests/cmd.py new file mode 100644 index 0000000000..09503a9ff1 --- /dev/null +++ b/ci-scripts/tests/cmd.py @@ -0,0 +1,56 @@ +import sys +import logging +logging.basicConfig( + level=logging.DEBUG, + stream=sys.stdout, + format="[%(asctime)s] %(levelname)8s: %(message)s" +) +import os + +import unittest + +sys.path.append('./') # to find OAI imports below +import cls_cmd + +class TestCmd(unittest.TestCase): + def test_local_cmd(self): + with cls_cmd.getConnection("localhost") as cmd: + self.assertTrue(isinstance(cmd, cls_cmd.LocalCmd)) + with cls_cmd.getConnection("None") as cmd: + self.assertTrue(isinstance(cmd, cls_cmd.LocalCmd)) + with cls_cmd.getConnection("none") as cmd: + self.assertTrue(isinstance(cmd, cls_cmd.LocalCmd)) + with cls_cmd.getConnection(None) as cmd: + self.assertTrue(isinstance(cmd, cls_cmd.LocalCmd)) + ret = cmd.run("true") + self.assertEqual(ret.args, "true") + self.assertEqual(ret.returncode, 0) + self.assertEqual(ret.stdout, "") + ret = cmd.run("false") + self.assertEqual(ret.args, "false") + self.assertEqual(ret.returncode, 1) + self.assertEqual(ret.stdout, "") + ret = cmd.run("echo test") + self.assertEqual(ret.args, "echo test") + self.assertEqual(ret.returncode, 0) + self.assertEqual(ret.stdout, "test") + + @unittest.skip("need to be able to passwordlessly SSH to localhost, also disable stty -ixon") + def test_remote_cmd(self): + with cls_cmd.getConnection("127.0.0.1") as cmd: + self.assertTrue(isinstance(cmd, cls_cmd.RemoteCmd)) + ret = cmd.run("true") + self.assertEqual(ret.args, "true") + self.assertEqual(ret.returncode, 0) + self.assertEqual(ret.stdout, "") + ret = cmd.run("false") + self.assertEqual(ret.args, "false") + self.assertEqual(ret.returncode, 1) + self.assertEqual(ret.stdout, "") + ret = cmd.run("echo test") + self.assertEqual(ret.args, "echo test") + self.assertEqual(ret.returncode, 0) + self.assertEqual(ret.stdout, "test") + +if __name__ == '__main__': + unittest.main() diff --git a/ci-scripts/tests/scripts/hello-fail.sh b/ci-scripts/tests/scripts/hello-fail.sh new file mode 100755 index 0000000000..a14d3b9a6f --- /dev/null +++ b/ci-scripts/tests/scripts/hello-fail.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo $@ +false diff --git a/ci-scripts/tests/scripts/hello-world.sh b/ci-scripts/tests/scripts/hello-world.sh new file mode 100755 index 0000000000..959918d85a --- /dev/null +++ b/ci-scripts/tests/scripts/hello-world.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -x +echo hello, world From 0d63861bf1ad37558e63b9eb2bbcd3360318606a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 26 Sep 2024 09:17:52 +0200 Subject: [PATCH 74/87] cls_cmd.py: local copy: don't copy if src/tgt identical --- ci-scripts/cls_cmd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci-scripts/cls_cmd.py b/ci-scripts/cls_cmd.py index f1527fd08a..c934479dbe 100644 --- a/ci-scripts/cls_cmd.py +++ b/ci-scripts/cls_cmd.py @@ -129,6 +129,8 @@ class LocalCmd(Cmd): def copyin(self, src, tgt, recursive=False): if src[0] != '/' or tgt[0] != '/': raise Exception(f'support only absolute file paths (src {src} tgt {tgt})!') + if src == tgt: + return # nothing to copy, file is already where it should go opt = '-r' if recursive else '' return self.run(f'cp {opt} {src} {tgt}').returncode == 0 From 3feaa93ba0d6cb2a1cff6591871f25701a3f70b1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 26 Sep 2024 16:59:44 +0200 Subject: [PATCH 75/87] cls_cmd: print the host on which a command is executed --- ci-scripts/cls_cmd.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ci-scripts/cls_cmd.py b/ci-scripts/cls_cmd.py index c934479dbe..cef99964be 100644 --- a/ci-scripts/cls_cmd.py +++ b/ci-scripts/cls_cmd.py @@ -101,7 +101,7 @@ class LocalCmd(Cmd): def run(self, line, timeout=300, silent=False, reportNonZero=True): if not silent: - logging.info(line) + logging.info(f"local> {line}") try: if line.strip().endswith('&'): # if we wait for stdout, subprocess does not return before the end of the command @@ -168,6 +168,7 @@ class RemoteCmd(Cmd): def __init__(self, hostname, d=None): cIdx = 0 + self.hostname = hostname logging.getLogger('paramiko').setLevel(logging.ERROR) # prevent spamming through Paramiko self.client = paramiko.SSHClient() self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) @@ -205,7 +206,7 @@ class RemoteCmd(Cmd): def run(self, line, timeout=300, silent=False, reportNonZero=True): if not silent: - logging.info(line) + logging.info(f"ssh[{self.hostname}]> {line}") if self.cwd: line = f"cd {self.cwd} && {line}" try: @@ -235,7 +236,7 @@ class RemoteCmd(Cmd): # if recursive is True, tgt must be a directory (and src is file or directory) # if recursive is False, tgt and src must be a file name def copyout(self, src, tgt, recursive=False): - logging.debug(f"copyout: local:{src} -> remote:{tgt}") + logging.debug(f"copyout: local:{src} -> {self.hostname}:{tgt}") if recursive: tmpfile = f"{uuid.uuid4()}.tar" abstmpfile = f"/tmp/{tmpfile}" @@ -253,7 +254,7 @@ class RemoteCmd(Cmd): # if recursive is True, tgt must be a directory (and src is file or directory) # if recursive is False, tgt and src must be a file name def copyin(self, src, tgt, recursive=False): - logging.debug(f"copyin: remote:{src} -> local:{tgt}") + logging.debug(f"copyin: {self.hostname}:{src} -> local:{tgt}") if recursive: tmpfile = f"{uuid.uuid4()}.tar" abstmpfile = f"/tmp/{tmpfile}" From d81abdaf7b6fc03e93eb5ddb943c83ad92fd0b4f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 25 Sep 2024 16:37:57 +0200 Subject: [PATCH 76/87] Reimplement Native Build (CI step Build_eNB) The BuildeNB steps either does things that are already implemented (created workspace), or things that we don't use (separate build_wait), and is generally quite convoluted when all it does is calling build_oai. Reimplement by reusing Create_Workspace, and make build_oai in a single step. To clean up, make a new module in which this function does not need a class instantiation. Instead, we give all necessary parameters directly. --- ci-scripts/cls_native.py | 64 +++++++++ ci-scripts/main.py | 3 +- ci-scripts/ran.py | 179 ------------------------ ci-scripts/xml_files/gnb_usrp_build.xml | 8 +- 4 files changed, 73 insertions(+), 181 deletions(-) create mode 100644 ci-scripts/cls_native.py diff --git a/ci-scripts/cls_native.py b/ci-scripts/cls_native.py new file mode 100644 index 0000000000..d9c281907a --- /dev/null +++ b/ci-scripts/cls_native.py @@ -0,0 +1,64 @@ +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ +#--------------------------------------------------------------------- + +import logging +import re + +import cls_cmd +import cls_oai_html +import constants as CONST + +class Native(): + + def Build(test_case, HTML, host, directory, options): + logging.debug(f'Building on server: {host}') + HTML.testCase_id = test_case + + with cls_cmd.getConnection(host) as ssh: + base = f"{directory}/cmake_targets" + ret = ssh.run(f"{base}/build_oai {options} > {base}/log/build_oai.log", timeout=900) + success = ret.returncode == 0 + logs = ssh.run(f"cat {base}/log/build_oai.log", silent=True) + logging.debug(f"build finished with code {ret.returncode}, output:\n{logs.stdout}") + + # create log directory, and copy build logs + target = f"{base}/build_log_{test_case}/" + ssh.run(f"mkdir -p {target}") + ssh.run(f"mv {base}/log/* {target}") + + # check if build artifacts are there + # NOTE: build_oai should fail with exit code if it could not build, but it does not + build_dir = f"{base}/ran_build/build" + build_gnb = re.search('--gNB', options) is not None + if build_gnb: + success = success and ssh.run(f"ls {build_dir}/nr-softmodem").returncode == 0 + build_enb = re.search('--eNB', options) is not None + if build_enb: + success = success and ssh.run(f"ls {build_dir}/lte-softmodem").returncode == 0 + + if success: + logging.info('\u001B[1m Building OAI Pass\u001B[0m') + HTML.CreateHtmlTestRow(options, 'OK', CONST.ALL_PROCESSES_OK) + else: + logging.error('\u001B[1m Building OAI Failed\u001B[0m') + HTML.CreateHtmlTestRow(options, 'KO', CONST.ALL_PROCESSES_OK) + return success diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 9c6a20d935..dba19d0aa2 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -44,6 +44,7 @@ import cls_containerize #class Containerize for all container-based operations import cls_static_code_analysis #class for static code analysis import cls_physim1 #class PhySim for physical simulators deploy and run import cls_cluster # class for building/deploying on cluster +import cls_native # class for all native/source-based operations import sshconnection import epc @@ -149,7 +150,7 @@ def ExecuteActionWithParam(action): if proxy_commit is not None: CONTAINERS.proxyCommit = proxy_commit if action == 'Build_eNB': - success = RAN.BuildeNB(HTML) + success = cls_native.Native.Build(HTML.testCase_id, HTML, RAN.eNBIPAddress, RAN.eNBSourceCodePath, RAN.Build_eNB_args) elif action == 'Build_Image': success = CONTAINERS.BuildImage(HTML) elif action == 'Build_Proxy': diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 9fc62eadd4..4c56c5e8ac 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -105,185 +105,6 @@ class RANManagement(): # RAN management functions #----------------------------------------------------------- - def BuildeNB(self, HTML): - if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - if self.eNB_serverId[self.eNB_instance] == '0': - lIpAddr = self.eNBIPAddress - lUserName = self.eNBUserName - lPassWord = self.eNBPassword - lSourcePath = self.eNBSourceCodePath - elif self.eNB_serverId[self.eNB_instance] == '1': - lIpAddr = self.eNB1IPAddress - lUserName = self.eNB1UserName - lPassWord = self.eNB1Password - lSourcePath = self.eNB1SourceCodePath - elif self.eNB_serverId[self.eNB_instance] == '2': - lIpAddr = self.eNB2IPAddress - lUserName = self.eNB2UserName - lPassWord = self.eNB2Password - lSourcePath = self.eNB2SourceCodePath - if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - logging.debug('Building on server: ' + lIpAddr) - mySSH = SSH.SSHConnection() - mySSH.open(lIpAddr, lUserName, lPassWord) - - # Check if we build an 5G-NR gNB or an LTE eNB - result = re.search('--RU', self.Build_eNB_args) - if result is not None: - self.air_interface[self.eNB_instance] = 'oairu' - else: - result = re.search('--gNB', self.Build_eNB_args) - if result is not None: - self.air_interface[self.eNB_instance] = 'nr-softmodem' - else: - self.air_interface[self.eNB_instance] = 'lte-softmodem' - - # Worakround for some servers, we need to erase completely the workspace - if self.Build_eNB_forced_workspace_cleanup: - mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf ' + lSourcePath, '\$', 15) - self.testCase_id = HTML.testCase_id - # on RedHat/CentOS .git extension is mandatory - result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository) - if result is not None: - full_ran_repo_name = self.ranRepository.replace('git/', 'git') - else: - full_ran_repo_name = self.ranRepository + '.git' - mySSH.command('mkdir -p ' + lSourcePath, '\$', 5) - mySSH.command('cd ' + lSourcePath, '\$', 5) - mySSH.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + full_ran_repo_name + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600) - # Raphael: here add a check if git clone or git fetch went smoothly - mySSH.command('git config user.email "jenkins@openairinterface.org"', '\$', 5) - mySSH.command('git config user.name "OAI Jenkins"', '\$', 5) - mySSH.command('git advice.detachedHead false', '\$', 5) - # Checking the BUILD INFO file - if not self.backgroundBuild: - mySSH.command('ls *.txt', '\$', 5) - result = re.search('LAST_BUILD_INFO', mySSH.getBefore()) - if result is not None: - mismatch = False - mySSH.command('grep --colour=never SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2) - result = re.search(self.ranCommitID, mySSH.getBefore()) - if result is None: - mismatch = True - mySSH.command('grep --colour=never MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) - if (self.ranAllowMerge): - result = re.search('YES', mySSH.getBefore()) - if result is None: - mismatch = True - mySSH.command('grep --colour=never TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) - if self.ranTargetBranch == '': - result = re.search('develop', mySSH.getBefore()) - else: - result = re.search(self.ranTargetBranch, mySSH.getBefore()) - if result is None: - mismatch = True - else: - result = re.search('NO', mySSH.getBefore()) - if result is None: - mismatch = True - if not mismatch: - mySSH.close() - HTML.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) - return True - - mySSH.command('echo ' + lPassWord + ' | sudo -S git clean -x -d -ff', '\$', 30) - # if the commit ID is provided use it to point to it - if self.ranCommitID != '': - mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 30) - # if the branch is not develop, then it is a merge request and we need to do - # the potential merge. Note that merge conflicts should already been checked earlier - if (self.ranAllowMerge): - if self.ranTargetBranch == '': - if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'): - mySSH.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 30) - else: - logging.debug('Merging with the target branch: ' + self.ranTargetBranch) - mySSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 30) - logging.debug(mySSH.getBefore()) # print what git said when merging/checking out - mySSH.command('source oaienv', '\$', 5) - mySSH.command('cd cmake_targets', '\$', 5) - mySSH.command('mkdir -p log', '\$', 5) - mySSH.command('chmod 777 log', '\$', 5) - # no need to remove in log (git clean did the trick) - if self.backgroundBuild: - mySSH.command('echo "./build_oai ' + self.Build_eNB_args + '" > ./my-lte-softmodem-build.sh', '\$', 5) - mySSH.command('chmod 775 ./my-lte-softmodem-build.sh', '\$', 5) - mySSH.command('echo ' + lPassWord + ' | sudo -S ls', '\$', 5) - logging.debug(mySSH.getBefore()) # print current directory contents for verification - mySSH.command('echo $USER; nohup sudo -E ./my-lte-softmodem-build.sh' + ' > ' + lSourcePath + '/cmake_targets/compile_oai_enb.log ' + ' 2>&1 &', lUserName, 5) - mySSH.close() - HTML.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) - self.backgroundBuildTestId[int(self.eNB_instance)] = self.testCase_id - return True - mySSH.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee compile_oai_enb.log', 'BUILD SHOULD BE SUCCESSFUL|build have failed', 900) - mySSH.close() - return self.checkBuildeNB(lIpAddr, lUserName, lPassWord, lSourcePath, self.testCase_id, HTML) - - def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId, HTML): - HTML.testCase_id=testcaseId - - mySSH = SSH.SSHConnection() - mySSH.open(lIpAddr, lUserName, lPassWord) - mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 3) - mySSH.command('ls ran_build/build', '\$', 3) - mySSH.command('ls ran_build/build', '\$', 3) - - #check if we have the build corresponding to the air interface keywords (nr-softmode, lte-softmodem) - logging.info('CHECK Build with IP='+lIpAddr+' SourcePath='+lSourcePath) - result = re.search(self.air_interface[self.eNB_instance], mySSH.getBefore()) - if result is None: - buildStatus = False #if not, build failed - else: - buildStatus = True - # Generating a BUILD INFO file - mySSH.command('echo "SRC_BRANCH: ' + self.ranBranch + '" > ../LAST_BUILD_INFO.txt', '\$', 2) - mySSH.command('echo "SRC_COMMIT: ' + self.ranCommitID + '" >> ../LAST_BUILD_INFO.txt', '\$', 2) - if (self.ranAllowMerge): - mySSH.command('echo "MERGED_W_TGT_BRANCH: YES" >> ../LAST_BUILD_INFO.txt', '\$', 2) - if self.ranTargetBranch == '': - mySSH.command('echo "TGT_BRANCH: develop" >> ../LAST_BUILD_INFO.txt', '\$', 2) - else: - mySSH.command('echo "TGT_BRANCH: ' + self.ranTargetBranch + '" >> ../LAST_BUILD_INFO.txt', '\$', 2) - else: - mySSH.command('echo "MERGED_W_TGT_BRANCH: NO" >> ../LAST_BUILD_INFO.txt', '\$', 2) - - - mySSH.command('mkdir -p build_log_' + testcaseId, '\$', 5) - mySSH.command('mv log/* ' + 'build_log_' + testcaseId, '\$', 5) - mySSH.command('mv compile_oai_enb.log ' + 'build_log_' + testcaseId, '\$', 5) - if self.eNB_serverId[self.eNB_instance] != '0': - mySSH.command('cd cmake_targets', '\$', 5) - mySSH.command('if [ -e tmp_build' + testcaseId + '.zip ]; then rm -f tmp_build' + testcaseId + '.zip; fi', '\$', 5) - mySSH.command('zip -r -qq tmp_build' + testcaseId + '.zip build_log_' + testcaseId, '\$', 5) - mySSH.close() - if (os.path.isfile('./tmp_build' + testcaseId + '.zip')): - os.remove('./tmp_build' + testcaseId + '.zip') - mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/tmp_build' + testcaseId + '.zip', '.') - if (os.path.isfile('./tmp_build' + testcaseId + '.zip')): - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './tmp_build' + testcaseId + '.zip', self.eNBSourceCodePath + '/cmake_targets/.') - os.remove('./tmp_build' + testcaseId + '.zip') - mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) - mySSH.command('cd ' + self.eNBSourceCodePath + '/cmake_targets', '\$', 5) - #-qq quiet / -u update orcreate files - mySSH.command('unzip -o -u -qq -DD tmp_build' + testcaseId + '.zip', '\$', 5) - mySSH.command('rm -f tmp_build' + testcaseId + '.zip', '\$', 5) - mySSH.close() - else: - mySSH.close() - - #generate logging info depending on buildStatus and air interface - if buildStatus: - logging.info('\u001B[1m Building OAI ' + self.air_interface[self.eNB_instance] + ' Pass\u001B[0m') - HTML.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) - else: - logging.error('\u001B[1m Building OAI ' + self.air_interface[self.eNB_instance] + ' Failed\u001B[0m') - HTML.CreateHtmlTestRow(self.Build_eNB_args, 'KO', CONST.ALL_PROCESSES_OK) - return buildStatus - def InitializeeNB(self, HTML, EPC): if self.eNB_serverId[self.eNB_instance] == '0': lIpAddr = self.eNBIPAddress diff --git a/ci-scripts/xml_files/gnb_usrp_build.xml b/ci-scripts/xml_files/gnb_usrp_build.xml index cabf602bf9..da0c321956 100644 --- a/ci-scripts/xml_files/gnb_usrp_build.xml +++ b/ci-scripts/xml_files/gnb_usrp_build.xml @@ -26,15 +26,21 @@ wrench 100000 +000000 010101 + + Create_Workspace + Creating new Workspace + + TesteNB Build_eNB Build gNB (USRP) - --gNB -w USRP --ninja -c -P --build-lib "ldpc_cuda ldpc_t2" --cmake-opt -DASN1C_EXEC=/opt/asn1c/bin/asn1c + --gNB -w USRP --ninja -c -P --build-lib ldpc_cuda --build-lib ldpc_t2 --cmake-opt -DASN1C_EXEC=/opt/asn1c/bin/asn1c True From 5201a5c37a191d091a9cf9042c6cc05fb8d80f82 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Sep 2024 10:59:23 +0200 Subject: [PATCH 77/87] Reimplement DeployObject()/UndeployObject() This reimplements the CI deployment functions, and makes them a bit more robust. Concretely: - Introduce a generic "deployment tag" option that can be used to override the tag to use for specific images. By default, it is the current "branch-commitID[0:8]" tag name (requires the change from function ImageTagToUse() to CreateTag(), impacting also pull/push image functions) - Avoid sed for image names, and use an .env file that docker-compose picks up automatically; the deployment analyzes a potentially existing .env file and updates instead of simply overriding. For instance, some pipelines might use -asan images for the gNB and "normal" (non-asan) images for UE, and a simple overwriting might make the -asan image name tag disappear for the gNB, resulting in deployment failures). Finally, undeployment removes the .env file, so that there are no modifications in the repository after undeployment. - Redo the previous behavior of autodetecting asan, and use that (the current function always uses asan, no matter what) - Remove deployKind/displayedNewTags globals, as they are not necessary - Make the usedImage output in HTML slimmer - On undeployment, print service names next to undeploy analysis, and return success/failure. - Make the functions generally less verbose and easier to read Note that as of and only in this commit, deployment does not work, as all the YAML files have not been updated to work with this updated version. The next commit adds tests for the new deployment, and updates one YAML file (also being used in the tests). The follow-up commit then modifies all YAML files. --- ci-scripts/cls_cluster.py | 3 +- ci-scripts/cls_containerize.py | 323 +++++++++++++++++++-------------- ci-scripts/main.py | 1 + ci-scripts/tests/deployment.py | 3 + 4 files changed, 193 insertions(+), 137 deletions(-) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 5ddf3872b2..7051ddc446 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -263,7 +263,8 @@ class Cluster: return False for image in self.imageToPull: imagePrefix = f'{self.OCRegistry}/{CI_OC_RAN_NAMESPACE}' - imageTag = cls_containerize.ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge) + tag = cls_containerize.CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge) + imageTag = f"{image}:{tag}" ret = cmd.run(f'docker pull {imagePrefix}/{imageTag}') if ret.returncode != 0: logging.error(f'Could not pull {image} from local registry : {self.OCRegistry}') diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index a7a80521af..f1694c9855 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -96,7 +96,7 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge sshSession.command(f'git merge --ff origin/{ranTargetBranch} -m "Temporary merge for CI"', '\$', 30) return True -def ImageTagToUse(imageName, ranCommitID, ranBranch, ranAllowMerge): +def CreateTag(ranCommitID, ranBranch, ranAllowMerge): shortCommit = ranCommitID[0:8] if ranAllowMerge: # Allowing contributor to have a name/branchName format @@ -104,8 +104,7 @@ def ImageTagToUse(imageName, ranCommitID, ranBranch, ranAllowMerge): tagToUse = f'{branchName}-{shortCommit}' else: tagToUse = f'develop-{shortCommit}' - fullTag = f'{imageName}:{tagToUse}' - return fullTag + return tagToUse def CopyLogsToExecutor(cmd, sourcePath, log_name): cmd.cd(f'{sourcePath}/cmake_targets') @@ -182,108 +181,142 @@ def GetCredentials(instance): else: raise Exception ("Only supports maximum of 3 servers") -def GetContainerName(mySSH, svcName): - ret = mySSH.run(f"docker compose -f docker-compose.y*ml config --format json {svcName} | jq -r '.services.\"{svcName}\".container_name'") - containerName = ret.stdout - return containerName +def GetContainerName(ssh, svcName, file): + ret = ssh.run(f"docker compose -f {file} config --format json {svcName} | jq -r '.services.\"{svcName}\".container_name'", silent=True) + return ret.stdout -def GetImageInfo(mySSH, containerName): - usedImage = '' - ret = mySSH.run('docker inspect --format="{{.Config.Image}}" ' + containerName) - usedImage = ret.stdout.strip() - logging.debug('Used image is: ' + usedImage) - if usedImage: - ret = mySSH.run('docker image inspect --format "* Size = {{.Size}} bytes\n* Creation = {{.Created}}\n* Id = {{.Id}}" ' + usedImage) - imageInfo = f"Used image is {usedImage}\n{ret.stdout}\n" - return imageInfo +def GetImageName(ssh, svcName, file): + ret = ssh.run(f"docker compose -f {file} config --format json {svcName} | jq -r '.services.\"{svcName}\".image'", silent=True) + if ret.returncode != 0: + return f"cannot retrieve image info for {containerName}: {ret.stdout}" else: - return f"Could not retrieve used image info for {containerName}!\n" + return ret.stdout.strip() -def GetContainerHealth(mySSH, containerName): - if containerName is None: - return False - time.sleep(5) - for _ in range(3): - if containerName != 'db_init': - result = mySSH.run(f'docker inspect --format="{{{{.State.Health.Status}}}}" {containerName}') - if result.stdout == 'healthy': - return True - else: - time.sleep(10) +def GetContainerHealth(ssh, containerName): + if containerName is None: + return False + if 'db_init' in containerName or 'db-init' in containerName: # exits with 0, there cannot be healthy + return True + time.sleep(5) + for _ in range(3): + result = ssh.run(f'docker inspect --format="{{{{.State.Health.Status}}}}" {containerName}', silent=True) + if result.stdout == 'healthy': + return True + time.sleep(10) + return False + +def ExistEnvFilePrint(ssh, wd, prompt='env vars in existing'): + ret = ssh.run(f'cat {wd}/.env', silent=True) + if ret.returncode != 0: + return False + env_vars = ret.stdout.strip().splitlines() + logging.info(f'{prompt} {wd}/.env: {env_vars}') + return True + +def WriteEnvFile(ssh, services, wd, tag): + ret = ssh.run(f'cat {wd}/.env', silent=True) + registry = "oai-ci" # pull_images() gives us this registry path + envs = {"REGISTRY":registry, "TAG": tag} + if ret.returncode == 0: # it exists, we have to update + # transforms env file to dictionary + old_envs = {} + for l in ret.stdout.strip().splitlines(): + var, val = l.split('=', 1) + old_envs[var] = val.strip('"') + # will retain the old environment variables + envs = {**envs, **old_envs} + for svc in services.split(): + # In some scenarios we have the choice of either pulling normal images + # or -asan images. We need to detect which kind we did pull. + fullImageName = GetImageName(ssh, svc, f"{wd}/docker-compose.y*ml") + image = fullImageName.split("/")[-1].split(":")[0] + checkimg = f"{registry}/{image}-asan:{tag}" + ret = ssh.run(f'docker image inspect {checkimg}', reportNonZero=False) + if ret.returncode == 0: + logging.info(f"detected pulled image {checkimg}") + if "oai-gnb" in image: envs["GNB_IMG"] = "oai-gnb-asan" + elif "oai-nr-ue" in image: envs["NRUE_IMG"] = "oai-nr-ue-asan" + elif "oai-nr-cuup" in image: envs["NRCUUP_IMG"] = "oai-nr-cuup-asan" + else: logging.warning("undetected image format {image}, cannot use asan") + env_string = "\n".join([f"{var}=\"{val}\"" for var,val in envs.items()]) + ssh.run(f'echo -e \'{env_string}\' > {wd}/.env', silent=True) + ExistEnvFilePrint(ssh, wd, prompt='New env vars in file') + +def GetServices(ssh, requested, file): + if requested == [] or requested is None or requested == "": + logging.warning('No service name given: starting all services in docker-compose.yml!') + ret = ssh.run(f'docker compose -f {file} config --services') + if ret.returncode != 0: + return "" else: - return True - return False + return ' '.join(ret.stdout.splitlines()) + else: + return requested -def ReTagImages(mySSH,IMAGES,ranCommitID,ranBranch,ranAllowMerge,displayedNewTags): - mySSH.run('cp docker-compose.y*ml ci-docker-compose.yml', 5) - for image in IMAGES: - imageTag = ImageTagToUse(image, ranCommitID, ranBranch, ranAllowMerge) - if image == 'oai-gnb' or image == 'oai-nr-ue' or image == 'oai-nr-cuup': - ret = mySSH.run(f'docker image inspect oai-ci/{imageTag}', reportNonZero=False, silent=False) - if ret.returncode != 0: - imageTag = imageTag.replace('oai-gnb', 'oai-gnb-asan') - imageTag = imageTag.replace('oai-nr-ue', 'oai-nr-ue-asan') - imageTag = imageTag.replace('oai-nr-cuup', 'oai-nr-cuup-asan') - if not displayedNewTags: - logging.debug(f'\u001B[1m Using sanitized version of {image} with {imageTag}\u001B[0m') - mySSH.run(f'sed -i -e "s@oaisoftwarealliance/{image}:develop@oai-ci/{imageTag}@" ci-docker-compose.yml',silent=True) +def CopyinContainerLog(ssh, lSourcePath, yaml, containerName, filename): + remote_filename = f"{lSourcePath}/cmake_targets/log/{filename}" + ssh.run(f'docker logs {containerName} &> {remote_filename}') + local_dir = f"{os.getcwd()}/../cmake_targets/log/{yaml}" + os.system(f'mkdir -p {local_dir}') + local_filename = f"{local_dir}/{filename}" + return ssh.copyin(remote_filename, local_filename) -def DeployServices(mySSH,svcName): - allServices = [] - if svcName == '': - logging.warning('No service name given: starting all services in ci-docker-compose.yml!') - ret = mySSH.run(f'docker compose -f ci-docker-compose.yml config --services') - allServices = ret.stdout.splitlines() - deployStatus = mySSH.run(f'docker compose --file ci-docker-compose.yml up -d -- {svcName}', 50) - return deployStatus.returncode,allServices - -def CopyinContainerLog(mySSH,lSourcePath,ymlPath,containerName,filename): - logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[2]}' - os.system(f'mkdir -p {logPath}') - mySSH.run(f'docker logs {containerName} > {lSourcePath}/cmake_targets/log/{filename} 2>&1') - copyin_res = mySSH.copyin(f'{lSourcePath}/cmake_targets/log/{filename}', os.path.join(logPath, filename)) - return copyin_res - -def GetRunningServices(mySSH,yamlDir): - ret = mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml config --services') +def GetRunningServices(ssh, file): + ret = ssh.run(f'docker compose -f {file} config --services') + if ret.returncode != 0: + return None allServices = ret.stdout.splitlines() - services = [] + running_services = [] for s in allServices: # outputs the hash if the container is running - ret = mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml ps --all --quiet -- {s}') - c = ret.stdout - logging.debug(f'running service {s} with container id {c}') - if ret.stdout != "" and ret.returncode == 0: # something is running for that service - services.append((s, c)) - logging.info(f'stopping services {[s for s, _ in services]}') - return services + ret = ssh.run(f'docker compose -f {file} ps --all --quiet -- {s}') + if ret.returncode != 0: + logging.info(f"service {s}: {ret.stdout}") + elif ret.stdout == "": + logging.warning(f"could not retrieve information for service {s}") + else: + c = ret.stdout + logging.debug(f'running service {s} with container id {c}') + running_services.append((s, c)) + logging.info(f'stopping services: {running_services}') + return running_services -def CheckLogs(self,mySSH,ymlPath,service_name,HTML,RAN): - logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[2]}' +def CheckLogs(self, yaml, service_name, HTML, RAN): + logPath = f'{os.getcwd()}/../cmake_targets/log/{yaml}' filename = f'{logPath}/{service_name}-{HTML.testCase_id}.log' - isFailed = 0 + success = True if (any(sub in service_name for sub in ['oai_ue','oai-nr-ue','lte_ue'])): logging.debug(f'\u001B[1m Analyzing UE logfile {filename} \u001B[0m') logStatus = cls_oaicitest.OaiCiTest().AnalyzeLogFile_UE(filename, HTML, RAN) + opt = f"UE log analysis for service {service_name}" + # usage of htmlUEFailureMsg/htmleNBFailureMsg is because Analyze log files + # abuse HTML to store their reports, and we here want to put custom options, + # which is not possible with CreateHtmlTestRow + # solution: use HTML templates, where we don't need different HTML write funcs if (logStatus < 0): - HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus) - isFailed = 1 + HTML.CreateHtmlTestRowQueue(opt, 'KO', [HTML.htmlUEFailureMsg]) + success = False else: - HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRowQueue(opt, 'OK', [HTML.htmlUEFailureMsg]) + HTML.htmlUEFailureMsg = "" elif service_name == 'nv-cubb': msg = 'Undeploy PNF/Nvidia CUBB' HTML.CreateHtmlTestRow(msg, 'OK', CONST.ALL_PROCESSES_OK) elif (any(sub in service_name for sub in ['enb','rru','rcc','cu','du','gnb'])): logging.debug(f'\u001B[1m Analyzing XnB logfile {filename}\u001B[0m') logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers) + opt = f"xNB log analysis for service {service_name}" if (logStatus < 0): - HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) - isFailed = 1 + HTML.CreateHtmlTestRowQueue(opt, 'KO', [HTML.htmleNBFailureMsg]) + success = False else: - HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRowQueue(opt, 'OK', [HTML.htmleNBFailureMsg]) + HTML.htmlUEFailureMsg = "" else: logging.info(f'Skipping to analyze log for service name {service_name}') - return isFailed + HTML.CreateHtmlTestRowQueue(f"service {service_name}", 'OK', ["no analysis function"]) + logging.debug(f"log check: service {service_name} passed analysis {success}") + return success #----------------------------------------------------------- # Class Declaration @@ -314,10 +347,9 @@ class Containerize(): self.proxyCommit = None self.eNB_instance = 0 self.eNB_serverId = ['', '', ''] - self.deployKind = [True, True, True] self.yamlPath = ['', '', ''] self.services = ['', '', ''] - self.nb_healthy = [0, 0, 0] + self.deploymentTag = '' self.eNB_logFile = ['', '', ''] self.testCase_id = '' @@ -329,7 +361,6 @@ class Containerize(): self.deployedContainers = [] self.tsharkStarted = False - self.displayedNewTags = False self.pingContName = '' self.pingOptions = '' self.pingLossThreshold = '' @@ -828,19 +859,20 @@ class Containerize(): if self.ranAllowMerge: orgTag = 'ci-temp' for image in IMAGES: - tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge) - mySSH.command(f'docker image tag {image}:{orgTag} {imagePrefix}/{tagToUse}', '\$', 5) + tagToUse = CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge) + imageTag = f"{image}:{tagToUse}" + mySSH.command(f'docker image tag {image}:{orgTag} {imagePrefix}/{imageTag}', '\$', 5) if re.search('Error response from daemon: No such image:', mySSH.getBefore()) is not None: continue - mySSH.command(f'docker push {imagePrefix}/{tagToUse}', '\$', 120) + mySSH.command(f'docker push {imagePrefix}/{imageTag}', '\$', 120) if re.search(': digest:', mySSH.getBefore()) is None: logging.debug(mySSH.getBefore()) - msg = f'Could not push {image} to local registry : {tagToUse}' + msg = f'Could not push {image} to local registry : {imageTag}' logging.error(msg) mySSH.close() HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK) return False - mySSH.command(f'docker rmi {imagePrefix}/{tagToUse} {image}:{orgTag}', '\$', 30) + mySSH.command(f'docker rmi {imagePrefix}/{imageTag} {image}:{orgTag}', '\$', 30) mySSH.command(f'docker logout {imagePrefix}', '\$', 5) if re.search('Removing login credentials', mySSH.getBefore()) is None: @@ -886,18 +918,19 @@ class Containerize(): HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK) return False for image in self.imageToPull: - tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge) - cmd = f'docker pull {imagePrefix}/{tagToUse}' + tagToUse = CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge) + imageTag = f"{image}:{tagToUse}" + cmd = f'docker pull {imagePrefix}/{imageTag}' response = myCmd.run(cmd, timeout=120) if response.returncode != 0: logging.debug(response) - msg = f'Could not pull {image} from local registry : {tagToUse}' + msg = f'Could not pull {image} from local registry : {imageTag}' logging.error(msg) myCmd.close() HTML.CreateHtmlTestRow('msg', 'KO', CONST.ALL_PROCESSES_OK) return False - myCmd.run(f'docker tag {imagePrefix}/{tagToUse} oai-ci/{tagToUse}') - myCmd.run(f'docker rmi {imagePrefix}/{tagToUse}') + myCmd.run(f'docker tag {imagePrefix}/{imageTag} oai-ci/{imageTag}') + myCmd.run(f'docker rmi {imagePrefix}/{imageTag}') response = myCmd.run(f'docker logout {imagePrefix}') if response.returncode != 0: msg = 'Could not log off from local registry' @@ -938,7 +971,8 @@ class Containerize(): myCmd = cls_cmd.LocalCmd() for image in IMAGES: - imageTag = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge) + tag = CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge) + imageTag = f"{image}:{tag}" cmd = f'docker rmi oai-ci/{imageTag}' myCmd.run(cmd, reportNonZero=False) @@ -982,38 +1016,49 @@ class Containerize(): HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') logging.debug('\u001B[1m Deploying OAI Object on server: ' + lIpAddr + '\u001B[0m') - self.deployKind[self.eNB_instance] = True - mySSH = cls_cmd.getConnection(lIpAddr, f'{lSourcePath}/{self.yamlPath[self.eNB_instance]}') - logging.info(f'Current working directory: {lSourcePath}/{self.yamlPath[self.eNB_instance]}') - ReTagImages(mySSH,IMAGES,self.ranCommitID, self.ranBranch, self.ranAllowMerge, self.displayedNewTags) - deployStatus,allServices = DeployServices(mySSH,self.services[self.eNB_instance]) - if deployStatus != 0: - mySSH.close() - logging.error('Could not deploy') - HTML.CreateHtmlTestRow('Could not deploy', 'KO', CONST.ALL_PROCESSES_OK) - return False - services_list = allServices if self.services[self.eNB_instance].split() == [] else self.services[self.eNB_instance].split() - status = True - imagesInfo="" - for svcName in services_list: - containerName = GetContainerName(mySSH, svcName) - healthy = GetContainerHealth(mySSH,containerName) - self.testCase_id = HTML.testCase_id - self.eNB_logFile[self.eNB_instance] = f'{svcName}-{self.testCase_id}.log' - if not healthy: - logging.warning(f"Deployment Failed: Trying to copy container logs {self.eNB_logFile[self.eNB_instance]}") - CopyinContainerLog(mySSH,lSourcePath,self.yamlPath[0].split('/'),containerName,self.eNB_logFile[self.eNB_instance]) - status = False - imagesInfo += (GetImageInfo(mySSH, containerName)) - mySSH.close() - imagesInfo += ("\n") - if status: - imagesInfo += ("Healthy deployment!") - HTML.CreateHtmlTestRowQueue('N/A', 'OK', [(imagesInfo)]) + yaml = self.yamlPath[self.eNB_instance].strip('/') + wd = f'{lSourcePath}/{yaml}' + + with cls_cmd.getConnection(lIpAddr) as ssh: + services = GetServices(ssh, self.services[self.eNB_instance], f"{wd}/docker-compose.y*ml") + if services == [] or services == ' ' or services == None: + msg = "Cannot determine services to start" + logging.error(msg) + HTML.CreateHtmlTestRowQueue('N/A', 'KO', [msg]) + return False + + ExistEnvFilePrint(ssh, wd) + WriteEnvFile(ssh, services, wd, self.deploymentTag) + + logging.info(f"will start services {services}") + status = ssh.run(f'docker compose -f {wd}/docker-compose.y*ml up -d -- {services}') + if status.returncode != 0: + msg = f"cannot deploy services {services}: {status.stdout}" + logging.error(msg) + HTML.CreateHtmlTestRowQueue('N/A', 'KO', [msg]) + return False + + imagesInfo = [] + fstatus = True + for svc in services.split(): + containerName = GetContainerName(ssh, svc, f"{wd}/docker-compose.y*ml") + healthy = GetContainerHealth(ssh, containerName) + if not healthy: + tgtlogfile = f'{svc}-{HTML.testCase_id}.log' + logging.warning(f"Deployment Failed: Trying to copy container logs to {tgtlogfile}") + yaml_dir = yaml.split('/')[-1] + CopyinContainerLog(ssh, lSourcePath, yaml_dir, containerName, tgtlogfile) + imagesInfo += [f"Failed to deploy: service {svc}"] + fstatus = False + else: + image = GetImageName(ssh, svc, f"{wd}/docker-compose.y*ml") + logging.info(f"service {svc} healthy, container {containerName}, image {image}") + imagesInfo += [f"service {svc} healthy, image {image}"] + if fstatus: + HTML.CreateHtmlTestRowQueue('N/A', 'OK', ['\n'.join(imagesInfo)]) else: - imagesInfo += ("Unhealthy deployment! -- Check logs for reason!") - HTML.CreateHtmlTestRowQueue('N/A', 'KO', [(imagesInfo)]) - return status + HTML.CreateHtmlTestRowQueue('N/A', 'KO', ['\n'.join(imagesInfo)]) + return fstatus def UndeployObject(self, HTML, RAN): lIpAddr, lUserName, lPassWord, lSourcePath = GetCredentials(self) @@ -1021,21 +1066,27 @@ class Containerize(): HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') logging.debug(f'\u001B[1m Undeploying OAI Object from server: {lIpAddr}\u001B[0m') - mySSH = cls_cmd.getConnection(lIpAddr) - yamlDir = f'{lSourcePath}/{self.yamlPath[self.eNB_instance]}' - services = GetRunningServices(mySSH, yamlDir) - mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml stop -t3') - copyin_res = True - copyin_res = all(CopyinContainerLog(mySSH, lSourcePath, self.yamlPath[0].split('/'), container_id, f'{service_name}-{HTML.testCase_id}.log') for service_name, container_id in services) - mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml down -v') + yaml = self.yamlPath[self.eNB_instance].strip('/') + wd = f'{lSourcePath}/{yaml}' + yaml_dir = yaml.split('/')[-1] + with cls_cmd.getConnection(lIpAddr) as ssh: + ExistEnvFilePrint(ssh, wd) + services = GetRunningServices(ssh, f"{wd}/docker-compose.y*ml") + copyin_res = None + if services is not None: + all_serv = " ".join([s for s, _ in services]) + ssh.run(f'docker compose -f {wd}/docker-compose.y*ml stop -- {all_serv}') + copyin_res = all(CopyinContainerLog(ssh, lSourcePath, yaml_dir, c, f'{s}-{HTML.testCase_id}.log') for s, c in services) + else: + logging.warning('could not identify services to stop => no log file') + ssh.run(f'docker compose -f {wd}/docker-compose.y*ml down -v') + ssh.run(f'rm {wd}/.env') if not copyin_res: - HTML.htmleNBFailureMsg='Could not copy logfile(s) to analyze it!' - HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) + HTML.CreateHtmlTestRowQueue('N/A', 'KO', ['Could not copy logfile(s)']) return False else: - log_results = [CheckLogs(self, mySSH, self.yamlPath[0].split('/'), service_name, HTML, RAN) for service_name, _ in services] - success = any(log_results) - mySSH.close() + log_results = [CheckLogs(self, yaml_dir, s, HTML, RAN) for s, _ in services] + success = all(log_results) if success: logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') else: diff --git a/ci-scripts/main.py b/ci-scripts/main.py index dba19d0aa2..415ea76c27 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -375,6 +375,7 @@ def ExecuteActionWithParam(action): string_field = test.findtext('services') if string_field is not None: CONTAINERS.services[CONTAINERS.eNB_instance] = string_field + CONTAINERS.deploymentTag = cls_containerize.CreateTag(CONTAINERS.ranCommitID, CONTAINERS.ranBranch, CONTAINERS.ranAllowMerge) if action == 'Deploy_Object': success = CONTAINERS.DeployObject(HTML) elif action == 'Undeploy_Object': diff --git a/ci-scripts/tests/deployment.py b/ci-scripts/tests/deployment.py index f9927f06ad..4de3bb0889 100644 --- a/ci-scripts/tests/deployment.py +++ b/ci-scripts/tests/deployment.py @@ -24,6 +24,9 @@ class TestDeploymentMethods(unittest.TestCase): self.cont = cls_containerize.Containerize() self.ran = ran.RANManagement() self.cont.yamlPath[0] = 'tests/simple-dep/' + self.cont.ranAllowMerge = True + self.cont.ranBranch = 'develop' + self.cont.ranCommitID = '1234567890' self.cont.eNB_serverId[0] = '0' self.cont.eNBIPAddress = 'localhost' self.cont.eNBUserName = None From 51bf5c0fc962af6afe848d8c8139698e58b2b1fe Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Sep 2024 18:19:38 +0200 Subject: [PATCH 78/87] Introduce CI deployment tests based on OAI images --- ci-scripts/tests/README.md | 5 +- ci-scripts/tests/deployment.py | 50 ++++++++++++++++--- .../tests/simple-dep/docker-compose.yml | 2 +- .../docker-compose.yaml | 4 +- 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/ci-scripts/tests/README.md b/ci-scripts/tests/README.md index 1083f78e61..f926ea4ac5 100644 --- a/ci-scripts/tests/README.md +++ b/ci-scripts/tests/README.md @@ -10,7 +10,10 @@ start with python tests/ping-iperf.py -v python tests/iperf-analysis.py -v -It will indicate if all tests passed. +It will indicate if all tests passed. It assumes that these images are present: + +- `oai-ci/oai-nr-ue:develop-12345678` +- `oai-ci/oai-gnb:develop-12345678` # test-runner test diff --git a/ci-scripts/tests/deployment.py b/ci-scripts/tests/deployment.py index 4de3bb0889..a6cf8e06b0 100644 --- a/ci-scripts/tests/deployment.py +++ b/ci-scripts/tests/deployment.py @@ -23,10 +23,10 @@ class TestDeploymentMethods(unittest.TestCase): self.ci = cls_oaicitest.OaiCiTest() self.cont = cls_containerize.Containerize() self.ran = ran.RANManagement() - self.cont.yamlPath[0] = 'tests/simple-dep/' + self.cont.yamlPath[0] = '' self.cont.ranAllowMerge = True - self.cont.ranBranch = 'develop' - self.cont.ranCommitID = '1234567890' + self.cont.ranBranch = '' + self.cont.ranCommitID = '' self.cont.eNB_serverId[0] = '0' self.cont.eNBIPAddress = 'localhost' self.cont.eNBUserName = None @@ -34,17 +34,51 @@ class TestDeploymentMethods(unittest.TestCase): self.cont.eNBSourceCodePath = os.getcwd() def test_deploy(self): - success = self.cont.DeployObject(self.html) - self.assertTrue(success) - self.cont.UndeployObject(self.html, self.ran) + self.cont.yamlPath[0] = 'tests/simple-dep/' + self.cont.deploymentTag = "noble" + deploy = self.cont.DeployObject(self.html) + undeploy = self.cont.UndeployObject(self.html, self.ran) + self.assertTrue(deploy) + self.assertTrue(undeploy) def test_deployfails(self): + # fails reliably old = self.cont.yamlPath self.cont.yamlPath[0] = 'tests/simple-fail/' - success = self.cont.DeployObject(self.html) - self.assertFalse(success) + deploy = self.cont.DeployObject(self.html) self.cont.UndeployObject(self.html, self.ran) + self.assertFalse(deploy) self.cont.yamlPath = old + def test_deploy_ran(self): + self.cont.yamlPath[0] = 'yaml_files/5g_rfsimulator_tdd_dora' + self.cont.services[0] = "oai-gnb" + self.cont.deploymentTag = 'develop-12345678' + deploy = self.cont.DeployObject(self.html) + undeploy = self.cont.UndeployObject(self.html, self.ran) + self.assertTrue(deploy) + self.assertTrue(undeploy) + + def test_deploy_multiran(self): + self.cont.yamlPath[0] = 'yaml_files/5g_rfsimulator_tdd_dora' + self.cont.services[0] = "oai-gnb oai-nr-ue" + self.cont.deploymentTag = 'develop-12345678' + deploy = self.cont.DeployObject(self.html) + undeploy = self.cont.UndeployObject(self.html, self.ran) + self.assertTrue(deploy) + self.assertTrue(undeploy) + + def test_deploy_staged(self): + self.cont.yamlPath[0] = 'yaml_files/5g_rfsimulator_tdd_dora' + self.cont.services[0] = "oai-gnb" + self.cont.deploymentTag = 'develop-12345678' + deploy1 = self.cont.DeployObject(self.html) + self.cont.services[0] = "oai-nr-ue" + deploy2 = self.cont.DeployObject(self.html) + undeploy = self.cont.UndeployObject(self.html, self.ran) + self.assertTrue(deploy1) + self.assertTrue(deploy2) + self.assertTrue(undeploy) + if __name__ == '__main__': unittest.main() diff --git a/ci-scripts/tests/simple-dep/docker-compose.yml b/ci-scripts/tests/simple-dep/docker-compose.yml index 950e30a814..058bba9931 100644 --- a/ci-scripts/tests/simple-dep/docker-compose.yml +++ b/ci-scripts/tests/simple-dep/docker-compose.yml @@ -1,6 +1,6 @@ services: test: - image: ubuntu:jammy + image: ubuntu:${TAG:-jammy} container_name: test_container cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml index f5a3d9a042..89f6562697 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml @@ -1,6 +1,6 @@ services: oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -25,7 +25,7 @@ services: retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL From fc0bc2357c5507ef291fb699b92e3ffdb8da68d9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Sep 2024 11:19:45 +0200 Subject: [PATCH 79/87] Modify all YAML files to work with .env files from DeployObject() --- .../4g_l2sim_fdd/docker-compose.yml | 6 ++--- .../docker-compose.yml | 4 ++-- .../docker-compose.yml | 4 ++-- .../docker-compose.yml | 4 ++-- .../docker-compose.yml | 4 ++-- .../4g_rfsimulator_fembms/docker-compose.yml | 4 ++-- .../4g_rfsimulator_mbms/docker-compose.yml | 4 ++-- .../docker-compose.yml | 4 ++-- .../5g_f1_rfsimulator/docker-compose.yaml | 6 ++--- .../5g_fdd_rfsimulator/docker-compose.yaml | 4 ++-- .../5g_l2sim_tdd/docker-compose.yaml | 4 ++-- .../5g_rfsimulator/docker-compose.yaml | 22 +++++++++---------- .../5g_rfsimulator_24prb/docker-compose.yaml | 4 ++-- .../5g_rfsimulator_2x2/docker-compose.yaml | 4 ++-- .../docker-compose.yaml | 4 ++-- .../5g_rfsimulator_e1/docker-compose.yaml | 20 ++++++++--------- .../docker-compose.yaml | 4 ++-- .../docker-compose.yaml | 4 ++-- .../docker-compose.yaml | 4 ++-- .../docker-compose.yaml | 4 ++-- .../docker-compose.yaml | 4 ++-- .../5g_sa_n310_2x2_100MHz/docker-compose.yml | 2 +- .../5g_sa_n310_2x2_60MHz/docker-compose.yml | 2 +- .../5g_sa_n310_gnb/docker-compose.yml | 2 +- .../5g_sa_n310_nrue/docker-compose.yml | 2 +- .../fr1_enb_mono_fdd_tim/docker-compose.yml | 2 +- .../docker-compose.yml | 4 ++-- .../lte_b200_fdd_05Mhz_tm1/docker-compose.yml | 2 +- .../docker-compose.yml | 2 +- .../docker-compose.yml | 2 +- .../lte_b200_fdd_10Mhz_tm1/docker-compose.yml | 2 +- .../docker-compose.yml | 2 +- .../docker-compose.yml | 2 +- .../lte_b200_fdd_20Mhz_tm1/docker-compose.yml | 2 +- .../docker-compose.yml | 4 ++-- .../lte_b200_tdd_05Mhz_tm1/docker-compose.yml | 2 +- .../lte_b200_tdd_05Mhz_tm2/docker-compose.yml | 2 +- .../lte_b200_tdd_10Mhz_tm1/docker-compose.yml | 2 +- .../lte_b200_tdd_20Mhz_tm1/docker-compose.yml | 2 +- .../docker-compose.yml | 2 +- .../lte_n3xx_tdd_2x2_tm1/docker-compose.yml | 2 +- .../lte_n3xx_tdd_2x2_tm2/docker-compose.yml | 2 +- .../nsa_b200_enb/docker-compose.yml | 2 +- .../nsa_b200_gnb/docker-compose.yml | 2 +- .../yaml_files/sa_aw2s_gnb/docker-compose.yml | 2 +- .../yaml_files/sa_b200_gnb/docker-compose.yml | 2 +- .../sa_e1_b200_gnb/docker-compose.yml | 6 ++--- .../sa_f1_b200_gnb/docker-compose.yml | 4 ++-- .../docker-compose.yml | 2 +- .../sa_fhi_7.2_vvdn_gnb/docker-compose.yml | 2 +- .../sa_gnb_aerial/docker-compose.yaml | 2 +- .../sa_sc_b200_gnb/docker-compose.yml | 2 +- 52 files changed, 97 insertions(+), 97 deletions(-) diff --git a/ci-scripts/yaml_files/4g_l2sim_fdd/docker-compose.yml b/ci-scripts/yaml_files/4g_l2sim_fdd/docker-compose.yml index 0595a180cd..c02b009eea 100644 --- a/ci-scripts/yaml_files/4g_l2sim_fdd/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_l2sim_fdd/docker-compose.yml @@ -178,7 +178,7 @@ services: retries: 5 oai_enb: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: l2sim4g-oai-enb network_mode: "host" @@ -210,7 +210,7 @@ services: retries: 5 oai_ue1: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: l2sim4g-oai-lte-ue1 network_mode: "host" @@ -229,7 +229,7 @@ services: retries: 5 oai_ue2: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: l2sim4g-oai-lte-ue2 network_mode: "host" diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml index d1f3d439ac..97c4ee82ab 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml @@ -178,7 +178,7 @@ services: retries: 5 oai_enb0: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: rfsim4g-oai-enb networks: @@ -196,7 +196,7 @@ services: retries: 5 oai_ue0: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: rfsim4g-oai-lte-ue0 networks: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml index 6f9049c503..2bc0e97a35 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml @@ -1,6 +1,6 @@ services: oai_enb0: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: rfsim4g-oai-enb networks: @@ -18,7 +18,7 @@ services: retries: 5 oai_ue0: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: rfsim4g-oai-lte-ue0 networks: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml index 65f2431f4c..c77dfdfd27 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml @@ -178,7 +178,7 @@ services: retries: 5 oai_enb0: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: rfsim4g-oai-enb networks: @@ -196,7 +196,7 @@ services: retries: 5 oai_ue0: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: rfsim4g-oai-lte-ue0 networks: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml index 778700ee3b..25e3d797bb 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml @@ -178,7 +178,7 @@ services: retries: 5 oai_enb0: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: rfsim4g-oai-enb networks: @@ -196,7 +196,7 @@ services: retries: 5 oai_ue0: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: rfsim4g-oai-lte-ue0 networks: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fembms/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fembms/docker-compose.yml index 62e5356115..da5399d5e6 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fembms/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fembms/docker-compose.yml @@ -1,6 +1,6 @@ services: oai_enb0: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: rfsim4g-oai-enb networks: @@ -18,7 +18,7 @@ services: retries: 5 oai_ue0: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: rfsim4g-oai-lte-ue0 networks: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_mbms/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_mbms/docker-compose.yml index 7fd381e5d5..d3a2f02ab2 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_mbms/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_mbms/docker-compose.yml @@ -1,6 +1,6 @@ services: oai_enb0: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: rfsim4g-oai-enb networks: @@ -18,7 +18,7 @@ services: retries: 5 oai_ue0: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: rfsim4g-oai-lte-ue0 networks: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml index 789caffb99..a3ce6f4de6 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml @@ -178,7 +178,7 @@ services: retries: 5 oai_enb0: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: rfsim4g-oai-enb networks: @@ -196,7 +196,7 @@ services: retries: 5 oai_ue0: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: rfsim4g-oai-lte-ue0 networks: diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml index 7eb3998fdd..16d78139b1 100644 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml @@ -83,7 +83,7 @@ services: retries: 5 oai-cu: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-cu cap_drop: - ALL @@ -104,7 +104,7 @@ services: retries: 5 oai-du: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-du cap_drop: - ALL @@ -129,7 +129,7 @@ services: retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml index 11e1fc4534..d284312482 100644 --- a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml @@ -81,7 +81,7 @@ services: timeout: 5s retries: 5 oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -101,7 +101,7 @@ services: timeout: 5s retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml b/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml index d56239d0b4..67f64983d2 100644 --- a/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml @@ -81,7 +81,7 @@ services: timeout: 5s retries: 5 oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: "l2sim-oai-gnb" cap_drop: - ALL @@ -119,7 +119,7 @@ services: retries: 5 oai-nr-ue0: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: "l2sim-oai-nr-ue0" cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml index edee7895ca..4e7001638f 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml @@ -81,7 +81,7 @@ services: timeout: 5s retries: 5 oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -101,7 +101,7 @@ services: timeout: 5s retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL @@ -125,7 +125,7 @@ services: timeout: 5s retries: 5 oai-nr-ue2: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue2 cap_drop: - ALL @@ -149,7 +149,7 @@ services: timeout: 5s retries: 5 oai-nr-ue3: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue3 cap_drop: - ALL @@ -173,7 +173,7 @@ services: timeout: 5s retries: 5 oai-nr-ue4: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue4 cap_drop: - ALL @@ -197,7 +197,7 @@ services: timeout: 5s retries: 5 oai-nr-ue5: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue5 cap_drop: - ALL @@ -221,7 +221,7 @@ services: timeout: 5s retries: 5 oai-nr-ue6: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue6 cap_drop: - ALL @@ -245,7 +245,7 @@ services: timeout: 5s retries: 5 oai-nr-ue7: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue7 cap_drop: - ALL @@ -269,7 +269,7 @@ services: timeout: 5s retries: 5 oai-nr-ue8: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue8 cap_drop: - ALL @@ -293,7 +293,7 @@ services: timeout: 5s retries: 5 oai-nr-ue9: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue9 cap_drop: - ALL @@ -317,7 +317,7 @@ services: timeout: 5s retries: 5 oai-nr-ue10: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue10 cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml index 86573d0227..29f2618365 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml @@ -81,7 +81,7 @@ services: timeout: 5s retries: 5 oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -101,7 +101,7 @@ services: timeout: 5s retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml index 29600aa655..e611ec3a1a 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml @@ -81,7 +81,7 @@ services: timeout: 5s retries: 5 oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -102,7 +102,7 @@ services: retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_accelleran/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_accelleran/docker-compose.yaml index daaec8e5ee..8ecb2f9c91 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_accelleran/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_accelleran/docker-compose.yaml @@ -1,6 +1,6 @@ services: oai-du: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-du cap_drop: - ALL @@ -15,7 +15,7 @@ services: timeout: 5s retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_e1/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_e1/docker-compose.yaml index 92f04bc074..8c937ed76c 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_e1/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_e1/docker-compose.yaml @@ -65,7 +65,7 @@ services: ipv4_address: 192.168.72.134 oai-cucp: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-cucp cap_drop: - ALL @@ -92,7 +92,7 @@ services: retries: 5 oai-cuup: - image: oaisoftwarealliance/oai-nr-cuup:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRCUUP_IMG:-oai-nr-cuup}:${TAG:-develop} container_name: rfsim5g-oai-cuup cap_drop: - ALL @@ -121,7 +121,7 @@ services: retries: 5 oai-cuup2: - image: oaisoftwarealliance/oai-nr-cuup:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRCUUP_IMG:-oai-nr-cuup}:${TAG:-develop} container_name: rfsim5g-oai-cuup2 cap_drop: - ALL @@ -153,7 +153,7 @@ services: retries: 5 oai-cuup3: - image: oaisoftwarealliance/oai-nr-cuup:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRCUUP_IMG:-oai-nr-cuup}:${TAG:-develop} container_name: rfsim5g-oai-cuup3 cap_drop: - ALL @@ -185,7 +185,7 @@ services: retries: 5 oai-du: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-du cap_drop: - ALL @@ -214,7 +214,7 @@ services: retries: 5 oai-du2: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-du2 cap_drop: - ALL @@ -246,7 +246,7 @@ services: retries: 5 oai-du3: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-du3 cap_drop: - ALL @@ -278,7 +278,7 @@ services: retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL @@ -306,7 +306,7 @@ services: retries: 5 oai-nr-ue2: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue2 cap_drop: - ALL @@ -334,7 +334,7 @@ services: retries: 5 oai-nr-ue3: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue3 cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml index b60c34e945..1dec021ffc 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml @@ -1,6 +1,6 @@ services: oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -25,7 +25,7 @@ services: retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb/docker-compose.yaml index 22900465b6..de43f8742e 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb/docker-compose.yaml @@ -82,7 +82,7 @@ services: retries: 5 oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -101,7 +101,7 @@ services: retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_ntn_geo/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_ntn_geo/docker-compose.yaml index 983969d840..581dd266c0 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_ntn_geo/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_ntn_geo/docker-compose.yaml @@ -81,7 +81,7 @@ services: timeout: 5s retries: 5 oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -102,7 +102,7 @@ services: retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_sidelink/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_sidelink/docker-compose.yaml index 684962b0a6..35e6a4eee9 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_sidelink/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_sidelink/docker-compose.yaml @@ -1,6 +1,6 @@ services: oai-nr-ue-1: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue-1 cap_drop: - ALL @@ -23,7 +23,7 @@ services: retries: 5 oai-nr-ue-2: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue-2 cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml index 2ae4874eee..197c43a476 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml @@ -81,7 +81,7 @@ services: timeout: 5s retries: 5 oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: rfsim5g-oai-gnb cap_drop: - ALL @@ -102,7 +102,7 @@ services: retries: 5 oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} container_name: rfsim5g-oai-nr-ue cap_drop: - ALL diff --git a/ci-scripts/yaml_files/5g_sa_n310_2x2_100MHz/docker-compose.yml b/ci-scripts/yaml_files/5g_sa_n310_2x2_100MHz/docker-compose.yml index decdf813e9..6d597d3a86 100644 --- a/ci-scripts/yaml_files/5g_sa_n310_2x2_100MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/5g_sa_n310_2x2_100MHz/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} network_mode: "host" container_name: oai-gnb cap_drop: diff --git a/ci-scripts/yaml_files/5g_sa_n310_2x2_60MHz/docker-compose.yml b/ci-scripts/yaml_files/5g_sa_n310_2x2_60MHz/docker-compose.yml index f827b83cad..43211d7381 100644 --- a/ci-scripts/yaml_files/5g_sa_n310_2x2_60MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/5g_sa_n310_2x2_60MHz/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} network_mode: "host" container_name: oai-gnb cap_drop: diff --git a/ci-scripts/yaml_files/5g_sa_n310_gnb/docker-compose.yml b/ci-scripts/yaml_files/5g_sa_n310_gnb/docker-compose.yml index cf2ea3742c..330b4b022b 100644 --- a/ci-scripts/yaml_files/5g_sa_n310_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/5g_sa_n310_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-gnb: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} network_mode: "host" container_name: oai-gnb cap_drop: diff --git a/ci-scripts/yaml_files/5g_sa_n310_nrue/docker-compose.yml b/ci-scripts/yaml_files/5g_sa_n310_nrue/docker-compose.yml index 5c4c005fdb..0cf5db7dc4 100644 --- a/ci-scripts/yaml_files/5g_sa_n310_nrue/docker-compose.yml +++ b/ci-scripts/yaml_files/5g_sa_n310_nrue/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-nr-ue: - image: oaisoftwarealliance/oai-nr-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop} network_mode: host container_name: oai-nr-ue cap_drop: diff --git a/ci-scripts/yaml_files/fr1_enb_mono_fdd_tim/docker-compose.yml b/ci-scripts/yaml_files/fr1_enb_mono_fdd_tim/docker-compose.yml index e0ae4d3472..4c40d738a4 100644 --- a/ci-scripts/yaml_files/fr1_enb_mono_fdd_tim/docker-compose.yml +++ b/ci-scripts/yaml_files/fr1_enb_mono_fdd_tim/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: prod-enb-mono-fdd environment: diff --git a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_if4.5/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_if4.5/docker-compose.yml index f611e8b37c..d15a9df172 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_if4.5/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_if4.5/docker-compose.yml @@ -1,6 +1,6 @@ services: rru_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-rru-fdd-05Mhz-tm1 network_mode: "host" @@ -17,7 +17,7 @@ services: timeout: 5s retries: 5 rcc_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-rcc-fdd-05Mhz-tm1 network_mode: "host" diff --git a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1/docker-compose.yml index e411f6403d..2a6e7bb51a 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-fdd-05Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity/docker-compose.yml index 3545c60579..7cdc585d34 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-fdd-05Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_oai_ue_magma/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_oai_ue_magma/docker-compose.yml index 074d331f65..c6d64cc028 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_oai_ue_magma/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_oai_ue_magma/docker-compose.yml @@ -1,6 +1,6 @@ services: lte_ue0: - image: oaisoftwarealliance/oai-lte-ue:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-lte-ue:${TAG:-develop} privileged: true container_name: lte-b200-ue-fdd-10Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1/docker-compose.yml index 2d57d8f089..14d1045de8 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-fdd-10Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx/docker-compose.yml index 8ba616aea3..d1fcd91850 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-fdd-10Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_magma/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_magma/docker-compose.yml index 3c7d511b77..6b1b583863 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_magma/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_magma/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-fdd-10Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1/docker-compose.yml index d98b9670de..a36afb957e 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-fdd-20Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_if4.5/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_if4.5/docker-compose.yml index 67d97f6b80..0311390ab7 100644 --- a/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_if4.5/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_if4.5/docker-compose.yml @@ -1,6 +1,6 @@ services: rru_tdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-rru-tdd-05Mhz-tm1 network_mode: "host" @@ -17,7 +17,7 @@ services: timeout: 5s retries: 5 rcc_tdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-rcc-tdd-05Mhz-tm1 network_mode: "host" diff --git a/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1/docker-compose.yml index edb6f34f70..68f48d7087 100644 --- a/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_tdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-tdd-05Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2/docker-compose.yml index 6a6523969a..b11b268129 100644 --- a/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_tdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-tdd-05Mhz-tm2 environment: diff --git a/ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1/docker-compose.yml index 8144caeea2..7934784cdc 100644 --- a/ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_tdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-tdd-10Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1/docker-compose.yml index 5c8827bfe8..0bca3bc43a 100644 --- a/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_tdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-tdd-20Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler/docker-compose.yml index bae9a753f4..953cce7ffc 100644 --- a/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_tdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: lte-b200-enb-tdd-20Mhz-tm1 environment: diff --git a/ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm1/docker-compose.yml index cd66a7be7a..5ac5b93d14 100644 --- a/ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm1/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm1/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-enb: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: oai-enb environment: diff --git a/ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm2/docker-compose.yml b/ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm2/docker-compose.yml index 07f9e00b5c..929c9633c7 100644 --- a/ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm2/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_n3xx_tdd_2x2_tm2/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-enb: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: oai-enb environment: diff --git a/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml b/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml index fac36481bc..76790c44f9 100644 --- a/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml +++ b/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml @@ -1,6 +1,6 @@ services: enb_mono_fdd: - image: oaisoftwarealliance/oai-enb:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-enb:${TAG:-develop} privileged: true container_name: nsa-b200-enb ulimits: diff --git a/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml index 6945d33cd3..28bf0bc1f3 100644 --- a/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: gnb_mono_tdd: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: nsa-b200-gnb cap_drop: - ALL diff --git a/ci-scripts/yaml_files/sa_aw2s_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_aw2s_gnb/docker-compose.yml index 05499f0678..03b9914404 100644 --- a/ci-scripts/yaml_files/sa_aw2s_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/sa_aw2s_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-gnb: - image: oaisoftwarealliance/oai-gnb-aw2s:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-gnb-aw2s:${TAG:-develop} network_mode: "host" container_name: oai-gnb-aw2s cap_drop: diff --git a/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml index 3f884ff809..b11fc2d7fa 100644 --- a/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: gnb_mono_tdd: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: sa-b200-gnb cap_drop: - ALL diff --git a/ci-scripts/yaml_files/sa_e1_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_e1_b200_gnb/docker-compose.yml index 83bbbdc7c4..83b8360b8f 100644 --- a/ci-scripts/yaml_files/sa_e1_b200_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/sa_e1_b200_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: gnb_cucp: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: sa-cucp-gnb cap_drop: - ALL @@ -25,7 +25,7 @@ services: retries: 5 gnb_cuup: - image: oaisoftwarealliance/oai-nr-cuup:develop + image: ${REGISTRY:-oaisoftwarealliance}/${NRCUUP_IMG:-oai-nr-cuup}:${TAG:-develop} container_name: sa-cuup-gnb cap_drop: - ALL @@ -52,7 +52,7 @@ services: retries: 5 gnb_du_tdd: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: sa-du-b200-gnb cap_drop: - ALL diff --git a/ci-scripts/yaml_files/sa_f1_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_f1_b200_gnb/docker-compose.yml index 0f4b12fbb6..4965111c32 100644 --- a/ci-scripts/yaml_files/sa_f1_b200_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/sa_f1_b200_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: gnb_cu: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: sa-cu-gnb cap_drop: - ALL @@ -26,7 +26,7 @@ services: retries: 5 gnb_du_fdd: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: sa-du-b200-gnb cap_drop: - ALL diff --git a/ci-scripts/yaml_files/sa_fhi_7.2_benetel550_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_fhi_7.2_benetel550_gnb/docker-compose.yml index 5eda4688c3..1228160fbb 100644 --- a/ci-scripts/yaml_files/sa_fhi_7.2_benetel550_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/sa_fhi_7.2_benetel550_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-gnb: - image: oaisoftwarealliance/oai-gnb-fhi72:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-gnb-fhi72:${TAG:-develop} cap_add: - SYS_ADMIN - IPC_LOCK diff --git a/ci-scripts/yaml_files/sa_fhi_7.2_vvdn_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_fhi_7.2_vvdn_gnb/docker-compose.yml index 7adac57359..4ea7498639 100644 --- a/ci-scripts/yaml_files/sa_fhi_7.2_vvdn_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/sa_fhi_7.2_vvdn_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: oai-gnb: - image: oaisoftwarealliance/oai-gnb-fhi72:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-gnb-fhi72:${TAG:-develop} cap_add: - SYS_ADMIN - IPC_LOCK diff --git a/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml b/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml index f8fb0726a4..1bc99ff4ba 100644 --- a/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml +++ b/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml @@ -34,7 +34,7 @@ services: retries: 5 oai-gnb-aerial: cpuset: "13-20" - image: oaisoftwarealliance/oai-gnb-aerial:develop + image: ${REGISTRY:-oaisoftwarealliance}/oai-gnb-aerial:${TAG:-develop} depends_on: nv-cubb: condition: service_healthy diff --git a/ci-scripts/yaml_files/sa_sc_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_sc_b200_gnb/docker-compose.yml index a036a1ad29..70773fd1a9 100644 --- a/ci-scripts/yaml_files/sa_sc_b200_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/sa_sc_b200_gnb/docker-compose.yml @@ -1,6 +1,6 @@ services: gnb_mono_tdd: - image: oaisoftwarealliance/oai-gnb:develop + image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} container_name: sa-b200-gnb cap_drop: - ALL From e541aee49e6156e81db480019e5f4e76a7f8208f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 25 Sep 2024 15:26:00 +0200 Subject: [PATCH 80/87] Implement runScript in cls_cmd for LocalCmd/RemoteCmd, add test A lot of CI code is python mixed with bash, e.g., ssh = getConnection(host) ssh.run('ls') ssh.run('echo') At least some of this CI code would benefit if it was written in a simple bash script, returning error codes and potentially other information either through stdout/stderr or files, to the calling Python code: ssh = runScript(host, script) # script does: ls; echo This commit introduces the possibility to run entire scripts. The idea is that the executor has a script (on localhost), which is either executed locally or on a remote host. For the remote host, the script is not copied but piped into a remotely executed bash. In both cases, output is either returned like the Cmd.run() function with returncode and mixed stdout/stderr, or optionally redirected into a file on the (remote) host, which can be treated further by the Python code in later steps. --- ci-scripts/cls_cmd.py | 65 ++++++++++++++++++++++++++++++++++++++--- ci-scripts/tests/cmd.py | 43 +++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 4 deletions(-) diff --git a/ci-scripts/cls_cmd.py b/ci-scripts/cls_cmd.py index cef99964be..f0fe2950f8 100644 --- a/ci-scripts/cls_cmd.py +++ b/ci-scripts/cls_cmd.py @@ -36,13 +36,22 @@ import time SSHTIMEOUT=7 +def is_local(host): + return host is None or host.lower() in ["", "none", "localhost"] + # helper that returns either LocalCmd or RemoteCmd based on passed host name def getConnection(host, d=None): - if host is None or host.lower() in ["", "none", "localhost"]: + if is_local(host): return LocalCmd(d=d) else: return RemoteCmd(host, d=d) +def runScript(host, path, timeout, parameters=None, redirect=None, silent=False): + if is_local(host): + return LocalCmd.exec_script(path, timeout, parameters, redirect, silent) + else: + return RemoteCmd.exec_script(host, path, timeout, parameters, redirect, silent) + # provides a partial interface for the legacy SSHconnection class (getBefore(), command()) class Cmd(metaclass=abc.ABCMeta): def cd(self, d, silent=False): @@ -58,6 +67,10 @@ class Cmd(metaclass=abc.ABCMeta): if not silent: logging.debug(f'cd {self.cwd}') + @abc.abstractmethod + def exec_script(path, timeout, parameters=None, redirect=None, silent=False): + return + @abc.abstractmethod def run(self, line, timeout=300, silent=False): return @@ -99,6 +112,22 @@ class LocalCmd(Cmd): logging.debug(f'Working dir is {self.cwd}') self.cp = sp.CompletedProcess(args='', returncode=0, stdout='') + def exec_script(path, timeout, parameters=None, redirect=None, silent=False): + if redirect and not redirect.startswith("/"): + raise ValueError(f"redirect must be absolute, but is {redirect}") + c = f"{path} {parameters}" if parameters else path + if not redirect: + ret = sp.run(c, shell=True, timeout=timeout, stdout=sp.PIPE, stderr=sp.STDOUT) + ret.stdout = ret.stdout.decode('utf-8').strip() + else: + with open(redirect, "w") as f: + ret = sp.run(c, shell=True, timeout=timeout, stdout=f, stderr=f) + ret.args += f" &> {redirect}" + ret.stdout = "" + if not silent: + logging.info(f"local> {ret.args}") + return ret + def run(self, line, timeout=300, silent=False, reportNonZero=True): if not silent: logging.info(f"local> {line}") @@ -169,9 +198,7 @@ class RemoteCmd(Cmd): def __init__(self, hostname, d=None): cIdx = 0 self.hostname = hostname - logging.getLogger('paramiko').setLevel(logging.ERROR) # prevent spamming through Paramiko - self.client = paramiko.SSHClient() - self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + self.client = RemoteCmd._ssh_init() cfg = RemoteCmd._lookup_ssh_config(hostname) self.cwd = d self.cp = sp.CompletedProcess(args='', returncode=0, stdout='') @@ -184,6 +211,12 @@ class RemoteCmd(Cmd): cIdx +=1 raise Exception ("Error: max retries, did not connect to host") + def _ssh_init(): + logging.getLogger('paramiko').setLevel(logging.ERROR) # prevent spamming through Paramiko + client = paramiko.SSHClient() + client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + return client + def _lookup_ssh_config(hostname): ssh_config = paramiko.SSHConfig() user_config_file = os.path.expanduser("~/.ssh/config") @@ -204,6 +237,30 @@ class RemoteCmd(Cmd): cfg['sock'] = paramiko.ProxyCommand(ucfg['proxycommand']) return cfg + def exec_script(host, path, timeout, parameters=None, redirect=None, silent=False): + if redirect and not redirect.startswith("/"): + raise ValueError(f"redirect must be absolute, but is {redirect}") + p = parameters if parameters else "" + r = f"> {redirect}" if redirect else "" + if not silent: + logging.info(f"local> ssh {host} bash -s {p} < {path} {r} # {path} from localhost") + client = RemoteCmd._ssh_init() + cfg = RemoteCmd._lookup_ssh_config(host) + client.connect(**cfg) + bash_opt = 'BASH_XTRACEFD=1' # write bash set -x output to stdout, see bash(1) + stdin, stdout, stderr = client.exec_command(f"{bash_opt} bash -s {p} {r}", timeout=timeout) + # open() the file f at path, read() it and write() it into the stdin of the bash -s cmd + with open(path) as f: + stdin.write(f.read()) + stdin.close() + cmd = path + if parameters: cmd += f" {parameters}" + if redirect: cmd += f" &> {redirect}" + ret = sp.CompletedProcess(args=cmd, returncode=stdout.channel.recv_exit_status(), stdout=stdout.read(size=None) + stderr.read(size=None)) + ret.stdout = ret.stdout.decode('utf-8').strip() + client.close() + return ret + def run(self, line, timeout=300, silent=False, reportNonZero=True): if not silent: logging.info(f"ssh[{self.hostname}]> {line}") diff --git a/ci-scripts/tests/cmd.py b/ci-scripts/tests/cmd.py index 09503a9ff1..4d7aedfa0e 100644 --- a/ci-scripts/tests/cmd.py +++ b/ci-scripts/tests/cmd.py @@ -35,6 +35,27 @@ class TestCmd(unittest.TestCase): self.assertEqual(ret.returncode, 0) self.assertEqual(ret.stdout, "test") + def test_local_script(self): + ret = cls_cmd.runScript("localhost", "tests/scripts/hello-world.sh", 1) + self.assertEqual(ret.args, "tests/scripts/hello-world.sh") + self.assertEqual(ret.returncode, 0) + self.assertEqual(ret.stdout, "+ echo hello, world\nhello, world") + + ret = cls_cmd.runScript("localhost", "tests/scripts/hello-fail.sh", 1, "TESTFAIL") + self.assertEqual(ret.args, "tests/scripts/hello-fail.sh TESTFAIL") + self.assertEqual(ret.returncode, 1) + self.assertEqual(ret.stdout, "TESTFAIL") + + ret = cls_cmd.runScript("localhost", "tests/scripts/hello-fail.sh", 1, "TESTFAIL2", "/tmp/result") + self.assertEqual(ret.args, "tests/scripts/hello-fail.sh TESTFAIL2 &> /tmp/result") + self.assertEqual(ret.returncode, 1) + self.assertEqual(ret.stdout, "") + with cls_cmd.getConnection("localhost") as ssh: + ret = ssh.run("cat /tmp/result") + self.assertEqual(ret.args, "cat /tmp/result") + self.assertEqual(ret.returncode, 0) + self.assertEqual(ret.stdout, "TESTFAIL2") + @unittest.skip("need to be able to passwordlessly SSH to localhost, also disable stty -ixon") def test_remote_cmd(self): with cls_cmd.getConnection("127.0.0.1") as cmd: @@ -52,5 +73,27 @@ class TestCmd(unittest.TestCase): self.assertEqual(ret.returncode, 0) self.assertEqual(ret.stdout, "test") + @unittest.skip("need to be able to passwordlessly SSH to localhost, also disable stty -ixon") + def test_remote_script(self): + ret = cls_cmd.runScript("127.0.0.1", "tests/scripts/hello-world.sh", 1) + self.assertEqual(ret.args, "tests/scripts/hello-world.sh") + self.assertEqual(ret.returncode, 0) + self.assertEqual(ret.stdout, "+ echo hello, world\nhello, world") + + ret = cls_cmd.runScript("127.0.0.1", "tests/scripts/hello-fail.sh", 1, "TESTFAIL") + self.assertEqual(ret.args, "tests/scripts/hello-fail.sh TESTFAIL") + self.assertEqual(ret.returncode, 1) + self.assertEqual(ret.stdout, "TESTFAIL") + + ret = cls_cmd.runScript("127.0.0.1", "tests/scripts/hello-fail.sh", 1, "TESTFAIL2", "/tmp/result") + self.assertEqual(ret.args, "tests/scripts/hello-fail.sh TESTFAIL2 &> /tmp/result") + self.assertEqual(ret.returncode, 1) + self.assertEqual(ret.stdout, "") + with cls_cmd.getConnection("localhost") as ssh: + ret = ssh.run("cat /tmp/result") + self.assertEqual(ret.args, "cat /tmp/result") + self.assertEqual(ret.returncode, 0) + self.assertEqual(ret.stdout, "TESTFAIL2") + if __name__ == '__main__': unittest.main() From 60b9649e0017630a659c2d59c273becdbb9d9922 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 26 Sep 2024 19:22:47 +0200 Subject: [PATCH 81/87] Implement CreateWorkspace() through script, print dir in HTML Use a script, which can be tested independently of CI code (by running it on the host on which it will be used), and print the directory that has been prepared in the HTML. Also, in the description, use the infinitive/imperative(?) of the verb to harmonize with other steps. --- ci-scripts/cls_containerize.py | 45 +++++-------------- ci-scripts/cls_static_code_analysis.py | 1 - ci-scripts/scripts/create_workspace.sh | 25 +++++++++++ ci-scripts/xml_files/cluster_image_build.xml | 2 +- .../xml_files/container_4g_l2sim_proxy.xml | 2 +- .../xml_files/container_4g_l2sim_tdd.xml | 2 +- .../container_4g_rfsim_fdd_05MHz.xml | 2 +- .../container_4g_rfsim_fdd_05MHz_noS1.xml | 2 +- .../container_4g_rfsim_fdd_10MHz.xml | 2 +- .../container_4g_rfsim_fdd_20MHz.xml | 2 +- .../xml_files/container_4g_rfsim_fembms.xml | 2 +- .../xml_files/container_4g_rfsim_mbms.xml | 2 +- .../container_4g_rfsim_tdd_05MHz.xml | 2 +- .../xml_files/container_5g_e1_rfsim.xml | 2 +- .../xml_files/container_5g_f1_rfsim.xml | 2 +- .../xml_files/container_5g_fdd_rfsim.xml | 2 +- .../xml_files/container_5g_l2sim_tdd.xml | 2 +- ci-scripts/xml_files/container_5g_rfsim.xml | 2 +- .../xml_files/container_5g_rfsim_24prb.xml | 2 +- .../xml_files/container_5g_rfsim_2x2.xml | 2 +- .../container_5g_rfsim_f1_accelleran.xml | 2 +- .../container_5g_rfsim_fdd_phytest.xml | 2 +- .../container_5g_rfsim_fr2_32prb.xml | 2 +- .../xml_files/container_5g_rfsim_ntn_geo.xml | 2 +- .../xml_files/container_5g_rfsim_sidelink.xml | 2 +- .../xml_files/container_5g_rfsim_tdd_dora.xml | 2 +- .../xml_files/container_5g_rfsim_u0_25prb.xml | 2 +- .../xml_files/container_image_build.xml | 2 +- .../xml_files/container_image_build_cross.xml | 2 +- .../xml_files/container_l2sim_proxy.xml | 2 +- .../container_lte_b200_fdd_05Mhz_tm1.xml | 2 +- ...container_lte_b200_fdd_05Mhz_tm1_if4_5.xml | 2 +- ...lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml | 2 +- .../container_lte_b200_fdd_10Mhz_tm1.xml | 2 +- .../container_lte_b200_fdd_10Mhz_tm1_cdrx.xml | 2 +- ...container_lte_b200_fdd_10Mhz_tm1_oaiue.xml | 4 +- .../container_lte_b200_fdd_20Mhz_tm1.xml | 2 +- .../container_lte_b200_tdd_05Mhz_tm1.xml | 2 +- ...container_lte_b200_tdd_05Mhz_tm1_if4_5.xml | 2 +- .../container_lte_b200_tdd_05Mhz_tm2.xml | 2 +- .../container_lte_b200_tdd_10Mhz_tm1.xml | 2 +- .../container_lte_b200_tdd_20Mhz_tm1.xml | 2 +- ...e_b200_tdd_20Mhz_tm1_default_scheduler.xml | 2 +- .../container_lte_n3xx_tdd_2x2_tm1.xml | 2 +- .../container_lte_n3xx_tdd_2x2_tm2.xml | 2 +- .../xml_files/container_nsa_b200_quectel.xml | 4 +- .../xml_files/container_sa_aerial_quectel.xml | 2 +- .../xml_files/container_sa_aw2s_asue.xml | 2 +- .../xml_files/container_sa_b200_quectel.xml | 2 +- .../container_sa_e1_b200_quectel.xml | 2 +- .../container_sa_f1_b200_quectel.xml | 2 +- .../xml_files/container_sa_fhi72_vvdn_up2.xml | 2 +- .../container_sa_n310_2X2_100MHz_quectel.xml | 2 +- .../container_sa_n310_2X2_60MHz_quectel.xml | 2 +- .../xml_files/container_sa_n310_nrue.xml | 4 +- .../container_sa_sc_b200_quectel.xml | 2 +- ci-scripts/xml_files/cppcheck.xml | 2 +- ci-scripts/xml_files/gnb_usrp_build.xml | 2 +- 58 files changed, 94 insertions(+), 93 deletions(-) create mode 100755 ci-scripts/scripts/create_workspace.sh diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index f1694c9855..42bd62f835 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -60,41 +60,21 @@ import cls_oaicitest #----------------------------------------------------------- IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue', 'oai-gnb-asan', 'oai-nr-ue-asan', 'oai-nr-cuup-asan', 'oai-gnb-aerial', 'oai-gnb-fhi72'] -def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTargetBranch, ranAllowMerge): +def CreateWorkspace(host, sourcePath, ranRepository, ranCommitID, ranTargetBranch, ranAllowMerge): if ranCommitID == '': logging.error('need ranCommitID in CreateWorkspace()') - sys.exit('Insufficient Parameter in CreateWorkspace()') + raise ValueError('Insufficient Parameter in CreateWorkspace(): need ranCommitID') - sshSession.command(f'rm -rf {sourcePath}', '\$', 10) - sshSession.command('mkdir -p ' + sourcePath, '\$', 5) - (sshSession.cd(sourcePath) if isinstance(sshSession, cls_cmd.Cmd) else sshSession.command('cd ' + sourcePath, '\$', 5)) - # Recent version of git (>2.20?) should handle missing .git extension # without problems - if ranTargetBranch == 'null': - ranTargetBranch = 'develop' - baseBranch = re.sub('origin/', '', ranTargetBranch) - sshSession.command(f'git clone --filter=blob:none -n -b {baseBranch} {ranRepository} .', '\$', 60) - if sshSession.getBefore().count('error') > 0 or sshSession.getBefore().count('error') > 0: - sys.exit('error during clone') - sshSession.command('git config user.email "jenkins@openairinterface.org"', '\$', 5) - sshSession.command('git config user.name "OAI Jenkins"', '\$', 5) - - sshSession.command('mkdir -p cmake_targets/log', '\$', 5) - # if the commit ID is provided use it to point to it - sshSession.command(f'git checkout -f {ranCommitID}', '\$', 30) - if sshSession.getBefore().count(f'HEAD is now at {ranCommitID[:6]}') != 1: - sshSession.command('git log --oneline | head -n5', '\$', 5) - logging.error(f'problems during checkout, is at: {sshSession.getBefore()}') - return False - else: - logging.debug('successful checkout') - # if the branch is not develop, then it is a merge request and we need to do - # the potential merge. Note that merge conflicts should already been checked earlier + script = "scripts/create_workspace.sh" + options = f"{sourcePath} {ranRepository} {ranCommitID}" if ranAllowMerge: if ranTargetBranch == '': ranTargetBranch = 'develop' - logging.debug(f'Merging with the target branch: {ranTargetBranch}') - sshSession.command(f'git merge --ff origin/{ranTargetBranch} -m "Temporary merge for CI"', '\$', 30) - return True + options += f" {ranTargetBranch}" + logging.info(f'execute "{script}" with options "{options}" on node {host}') + ret = cls_cmd.runScript(host, script, 90, options) + logging.debug(f'"{script}" finished with code {ret.returncode}, output:\n{ret.stdout}') + return ret.returncode == 0 def CreateTag(ranCommitID, ranBranch, ranAllowMerge): shortCommit = ranCommitID[0:8] @@ -1000,12 +980,9 @@ class Containerize(): HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') - logging.info(f"Running on server {lIpAddr}") - sshSession = cls_cmd.getConnection(lIpAddr) - - success = CreateWorkspace(sshSession, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) + success = CreateWorkspace(lIpAddr, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) if success: - HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRowQueue('N/A', 'OK', [f"created workspace {lSourcePath}"]) else: HTML.CreateHtmlTestRowQueue('N/A', 'KO', ["cannot create workspace"]) return success diff --git a/ci-scripts/cls_static_code_analysis.py b/ci-scripts/cls_static_code_analysis.py index ab4283d534..ed5867c4cb 100644 --- a/ci-scripts/cls_static_code_analysis.py +++ b/ci-scripts/cls_static_code_analysis.py @@ -45,7 +45,6 @@ from multiprocessing import Process, Lock, SimpleQueue import helpreadme as HELP import constants as CONST import cls_cmd -from cls_containerize import CreateWorkspace #----------------------------------------------------------- # Class Declaration diff --git a/ci-scripts/scripts/create_workspace.sh b/ci-scripts/scripts/create_workspace.sh new file mode 100755 index 0000000000..0dd1f3aca7 --- /dev/null +++ b/ci-scripts/scripts/create_workspace.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +function die() { + echo $@ + exit 1 +} + +[ $# -ge 3 -a $# -le 4 ] || die "usage: $0 []" + +set -ex + +dir=$1 +repo=$2 +ref=$3 +merge=$4 + +rm -rf ${dir} +git clone --filter=blob:none -n -b develop ${repo} ${dir} +cd ${dir} +git config user.email "jenkins@openairinterface.org" +git config user.name "OAI Jenkins" +git config advice.detachedHead false +mkdir -p cmake_targets/log +git checkout -f ${ref} +[ -n "${merge}" ] && git merge --ff ${merge} -m "Temporary merge for CI" diff --git a/ci-scripts/xml_files/cluster_image_build.xml b/ci-scripts/xml_files/cluster_image_build.xml index b389fa7e21..6810873b1c 100644 --- a/ci-scripts/xml_files/cluster_image_build.xml +++ b/ci-scripts/xml_files/cluster_image_build.xml @@ -31,7 +31,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace Build_Cluster_Image diff --git a/ci-scripts/xml_files/container_4g_l2sim_proxy.xml b/ci-scripts/xml_files/container_4g_l2sim_proxy.xml index 792f9939fb..cd57a24b6a 100644 --- a/ci-scripts/xml_files/container_4g_l2sim_proxy.xml +++ b/ci-scripts/xml_files/container_4g_l2sim_proxy.xml @@ -31,7 +31,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 1 1 diff --git a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml index 28f55c6d68..97a0610efa 100644 --- a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml +++ b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml @@ -49,7 +49,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index c717ba87b9..a60a8e2d4d 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -45,7 +45,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml index 67f66d2e6c..d5c67c9835 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml @@ -48,7 +48,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml index f04057d8bf..50e53c8624 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -52,7 +52,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml index 449341e13e..12bf5533ba 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -52,7 +52,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fembms.xml b/ci-scripts/xml_files/container_4g_rfsim_fembms.xml index 7ef304e648..48f740b873 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fembms.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fembms.xml @@ -45,7 +45,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_mbms.xml b/ci-scripts/xml_files/container_4g_rfsim_mbms.xml index 8236192138..4abf69fb3e 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_mbms.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_mbms.xml @@ -45,7 +45,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml index eb84827141..fa3c6862b7 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -52,7 +52,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_e1_rfsim.xml b/ci-scripts/xml_files/container_5g_e1_rfsim.xml index fa8f47a558..bf4cf6ec04 100644 --- a/ci-scripts/xml_files/container_5g_e1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_e1_rfsim.xml @@ -45,7 +45,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml index a246727da1..16c02050d2 100644 --- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml @@ -47,7 +47,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index a1454ed8bd..d3640da596 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -47,7 +47,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_l2sim_tdd.xml b/ci-scripts/xml_files/container_5g_l2sim_tdd.xml index aa9fd2ece9..c3e4662294 100644 --- a/ci-scripts/xml_files/container_5g_l2sim_tdd.xml +++ b/ci-scripts/xml_files/container_5g_l2sim_tdd.xml @@ -47,7 +47,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index edc9f1f30f..16eacb02c5 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -62,7 +62,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml index 92f853fa99..2e3bbf1d3a 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml @@ -47,7 +47,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml index 67b2273a68..a18928cc80 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml @@ -47,7 +47,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran.xml b/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran.xml index 07df4a751e..c8dc1cf9b2 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_f1_accelleran.xml @@ -44,7 +44,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml index 8d43480c8e..10081b9606 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml @@ -54,7 +54,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml index ee88b9de87..b29be08d21 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml @@ -45,7 +45,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml index 2a8147140d..04bf430f03 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml @@ -47,7 +47,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml b/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml index f3be815e30..d42f8851bb 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_sidelink.xml @@ -45,7 +45,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml index 3b48f7b901..35834493cc 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml @@ -53,7 +53,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml index cb4a9cd9f7..38d88b7e5e 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml @@ -47,7 +47,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_image_build.xml b/ci-scripts/xml_files/container_image_build.xml index cde7c7ce60..58b3c00d5e 100644 --- a/ci-scripts/xml_files/container_image_build.xml +++ b/ci-scripts/xml_files/container_image_build.xml @@ -33,7 +33,7 @@ Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_image_build_cross.xml b/ci-scripts/xml_files/container_image_build_cross.xml index c8bc67e51f..046ceb5413 100644 --- a/ci-scripts/xml_files/container_image_build_cross.xml +++ b/ci-scripts/xml_files/container_image_build_cross.xml @@ -31,7 +31,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_l2sim_proxy.xml b/ci-scripts/xml_files/container_l2sim_proxy.xml index 59b09d3ef5..ead040de82 100644 --- a/ci-scripts/xml_files/container_l2sim_proxy.xml +++ b/ci-scripts/xml_files/container_l2sim_proxy.xml @@ -32,7 +32,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 1 1 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml index 607c1ebcdd..00516269a6 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml @@ -68,7 +68,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml index 53eec11f20..4ede8e072b 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml @@ -67,7 +67,7 @@ Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml index 669f46f2ec..b9bc7f7a42 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml @@ -60,7 +60,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml index 2aa378b223..958e0a895a 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml @@ -62,7 +62,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml index 55653d6e4a..60a9bd0c16 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml @@ -61,7 +61,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml index cefa6cd5c1..10cd2e89c1 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml @@ -86,7 +86,7 @@ Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 @@ -99,7 +99,7 @@ Create_Workspace - Creating new Workspace for server 1 + Create new Workspace for server 1 1 1 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml index 61fa2dea11..510d0d3f2e 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml @@ -61,7 +61,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml index 76bd380f4f..c8bcde980f 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml @@ -69,7 +69,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml index ec280240e0..22a86d1f57 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml @@ -67,7 +67,7 @@ Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml index 9111f00365..068d4521b2 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml @@ -59,7 +59,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm2.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml index 7218dcc576..570fffef71 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml @@ -60,7 +60,7 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml index 4ed3e89e59..49826d782c 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml @@ -60,7 +60,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml index 9ae77ccec3..8e47a61a48 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml @@ -61,7 +61,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml index cfae0e6188..d144448301 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml @@ -67,7 +67,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml index 1df5ea169c..50494d7778 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml @@ -67,7 +67,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 7e831b2454..c745cb90aa 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -126,7 +126,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 @@ -139,7 +139,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 1 1 diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel.xml b/ci-scripts/xml_files/container_sa_aerial_quectel.xml index 43fdf4b65b..3f49e5fa8d 100644 --- a/ci-scripts/xml_files/container_sa_aerial_quectel.xml +++ b/ci-scripts/xml_files/container_sa_aerial_quectel.xml @@ -49,7 +49,7 @@ Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue.xml b/ci-scripts/xml_files/container_sa_aw2s_asue.xml index 3929687f1b..0e4e967c52 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue.xml @@ -68,7 +68,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml index 4776bd784e..a683c07a03 100644 --- a/ci-scripts/xml_files/container_sa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml @@ -100,7 +100,7 @@ Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml index 4e4eab92c1..563167a2dd 100644 --- a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml @@ -84,7 +84,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml index 4cce964633..36adc62777 100644 --- a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml @@ -83,7 +83,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml index b81ef51d5b..527bc70082 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml @@ -60,7 +60,7 @@ Create_Workspace - Creating new Workspace for server 0 + Create new Workspace for server 0 0 0 diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml index c713e5a431..6b7c8a92ec 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml @@ -79,7 +79,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml index fc0baadaca..c94c30a7b2 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml @@ -79,7 +79,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/container_sa_n310_nrue.xml b/ci-scripts/xml_files/container_sa_n310_nrue.xml index f00a452403..a358bbf5f8 100644 --- a/ci-scripts/xml_files/container_sa_n310_nrue.xml +++ b/ci-scripts/xml_files/container_sa_n310_nrue.xml @@ -70,7 +70,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 @@ -83,7 +83,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 1 1 diff --git a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml index d0dc59f3cc..6831be6949 100644 --- a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml @@ -94,7 +94,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace 0 0 diff --git a/ci-scripts/xml_files/cppcheck.xml b/ci-scripts/xml_files/cppcheck.xml index 6ec7a58e55..18d8760b0d 100644 --- a/ci-scripts/xml_files/cppcheck.xml +++ b/ci-scripts/xml_files/cppcheck.xml @@ -31,7 +31,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace Cppcheck_Analysis diff --git a/ci-scripts/xml_files/gnb_usrp_build.xml b/ci-scripts/xml_files/gnb_usrp_build.xml index da0c321956..81c49e87d9 100644 --- a/ci-scripts/xml_files/gnb_usrp_build.xml +++ b/ci-scripts/xml_files/gnb_usrp_build.xml @@ -33,7 +33,7 @@ Create_Workspace - Creating new Workspace + Create new Workspace From 904534f0da97370ae3eecead041395f47e5abbc9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 27 Sep 2024 09:39:44 +0200 Subject: [PATCH 82/87] Reboot USRP: use infinitive to harmonize with other steps --- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- ci-scripts/xml_files/gnb_usrp_build.xml | 2 +- ci-scripts/xml_files/sa_cn5g_asue_start.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index caea61f3b4..3efff2f0c7 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -126,7 +126,7 @@ Custom_Command - To reboot USRP + Reboot USRP asterix ssh root@172.21.19.14 reboot ; sleep 45 diff --git a/ci-scripts/xml_files/gnb_usrp_build.xml b/ci-scripts/xml_files/gnb_usrp_build.xml index 81c49e87d9..f67098116b 100644 --- a/ci-scripts/xml_files/gnb_usrp_build.xml +++ b/ci-scripts/xml_files/gnb_usrp_build.xml @@ -46,7 +46,7 @@ Custom_Command - To reboot USRP + Reboot USRP caracal ssh root@192.168.20.2 reboot diff --git a/ci-scripts/xml_files/sa_cn5g_asue_start.xml b/ci-scripts/xml_files/sa_cn5g_asue_start.xml index 3ae4aff9fc..a9d3a88d5d 100644 --- a/ci-scripts/xml_files/sa_cn5g_asue_start.xml +++ b/ci-scripts/xml_files/sa_cn5g_asue_start.xml @@ -39,7 +39,7 @@ Custom_Command - To reboot USRP + Reboot USRP asterix ssh root@172.21.19.14 reboot ; sleep 45 From 2b67b0e1deab63e48f8ccdc9ed9669a81b9e6313 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 27 Sep 2024 08:48:31 +0200 Subject: [PATCH 83/87] CI PullImage(): HTML: indicate pulled images --- ci-scripts/cls_containerize.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 42bd62f835..4833d105af 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -897,6 +897,7 @@ class Containerize(): myCmd.close() HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK) return False + pulled_images = [] for image in self.imageToPull: tagToUse = CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge) imageTag = f"{image}:{tagToUse}" @@ -911,6 +912,7 @@ class Containerize(): return False myCmd.run(f'docker tag {imagePrefix}/{imageTag} oai-ci/{imageTag}') myCmd.run(f'docker rmi {imagePrefix}/{imageTag}') + pulled_images += [f"oai-ci/{imageTag}"] response = myCmd.run(f'docker logout {imagePrefix}') if response.returncode != 0: msg = 'Could not log off from local registry' @@ -919,7 +921,8 @@ class Containerize(): HTML.CreateHtmlTestRow(msg, 'KO', CONST.ALL_PROCESSES_OK) return False myCmd.close() - HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + msg = "Pulled Images:\n" + '\n'.join(pulled_images) + HTML.CreateHtmlTestRowQueue('N/A', 'OK', [msg]) return True def Clean_Test_Server_Images(self, HTML): From 163d058d4a3bc79e72c2da5585c1c1828dc9f6b3 Mon Sep 17 00:00:00 2001 From: Xin Zhe Khooi Date: Sun, 29 Sep 2024 14:51:31 +0000 Subject: [PATCH 84/87] introduce dedicated nr pdcp tick thread for F1 split MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, NR PDCP ticks are active only with monolithic gNB, triggered by the MAC scheduler in gNB_scheduler.c. In F1 split mode, as there is no MAC, there’s no source to advance the NR PDCP timer via "nr_pdcp_wakeup_timer_thread()". This commit introduces a dedicated thread for NR PDCP ticks in gNB-CU and CU-UP mode. Without it, packet losses at the F1 uplink would cause indefinite buffering, as t-Reordering won't expire due to the lack of NR PDCP timer ticks. --- executables/nr-cuup.c | 2 +- executables/nr-softmodem.c | 2 +- executables/nr-uesoftmodem.c | 2 +- openair2/LAYER2/NR_MAC_gNB/main.c | 2 +- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 8 +++++--- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h | 2 +- .../LAYER2/nr_pdcp/nr_pdcp_timer_thread.c | 20 +++++++++++++++++++ .../LAYER2/nr_pdcp/nr_pdcp_timer_thread.h | 1 + 8 files changed, 31 insertions(+), 8 deletions(-) diff --git a/executables/nr-cuup.c b/executables/nr-cuup.c index f2ea48d3c6..9d6fc20ac3 100644 --- a/executables/nr-cuup.c +++ b/executables/nr-cuup.c @@ -168,7 +168,7 @@ int main(int argc, char **argv) AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); rc = itti_create_task(TASK_CUUP_E1, E1AP_CUUP_task, NULL); AssertFatal(rc >= 0, "Create task for CUUP E1 failed\n"); - nr_pdcp_layer_init(true); + nr_pdcp_layer_init(); cu_init_f1_ue_data(); // for CU-UP/CP mapping: we use the same E1_t e1type = UPtype; MessageDef *msg = RCconfig_NR_CU_E1(&e1type); diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index c28b741406..e480206c25 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -532,7 +532,7 @@ void init_pdcp(void) { uint32_t pdcp_initmask = IS_SOFTMODEM_NOS1 ? ENB_NAS_USE_TUN_BIT : LINK_ENB_PDCP_TO_GTPV1U_BIT; if (!NODE_IS_DU(get_node_type())) { - nr_pdcp_layer_init(get_node_type() == ngran_gNB_CUCP); + nr_pdcp_layer_init(); nr_pdcp_module_init(pdcp_initmask, 0); } } diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 99ce9040d4..f665dd2673 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -317,7 +317,7 @@ static void init_pdcp(int ue_id) if (get_softmodem_params()->nsa && rlc_module_init(0) != 0) { LOG_I(RLC, "Problem at RLC initiation \n"); } - nr_pdcp_layer_init(false); + nr_pdcp_layer_init(); nr_pdcp_module_init(pdcp_initmask, ue_id); } diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 44fc988700..e8519a151a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -277,7 +277,7 @@ void mac_top_init_gNB(ngran_node_t node_type, AssertFatal(rlc_module_init(1) == 0,"Could not initialize RLC layer\n"); // These should be out of here later - if (get_softmodem_params()->usim_test == 0 ) nr_pdcp_layer_init(false); + if (get_softmodem_params()->usim_test == 0 ) nr_pdcp_layer_init(); if(IS_SOFTMODEM_NOS1 && get_softmodem_params()->phy_test) { // get default noS1 configuration diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index d9efb52776..a416ddd617 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -566,7 +566,7 @@ void pdcp_layer_init(void) abort(); } -void nr_pdcp_layer_init(bool uses_e1) +void nr_pdcp_layer_init(void) { /* hack: be sure to initialize only once */ static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; @@ -586,10 +586,12 @@ void nr_pdcp_layer_init(bool uses_e1) if ((RC.nrrrc == NULL) || (!NODE_IS_CU(node_type))) { init_nr_rlc_data_req_queue(); } - - nr_pdcp_e1_if_init(uses_e1); + nr_pdcp_e1_if_init(node_type == ngran_gNB_CUUP || node_type == ngran_gNB_CUCP); init_nr_pdcp_data_ind_queue(); nr_pdcp_init_timer_thread(nr_pdcp_ue_manager); + if (NODE_IS_CU(node_type)) { + nr_pdcp_init_tick_thread(); + } } #include "nfapi/oai_integration/vendor_ext.h" diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h index 101200615e..967a2719ee 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h @@ -25,7 +25,7 @@ #include "pdcp.h" #include "nr_pdcp_ue_manager.h" -void nr_pdcp_layer_init(bool uses_e1); +void nr_pdcp_layer_init(void); uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id); void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP, diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.c index 5f6939e165..1c5e926fea 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.c @@ -70,6 +70,26 @@ static void *nr_pdcp_timer_thread(void *_nr_pdcp_ue_manager) return NULL; } +static void *nr_pdcp_tick_thread() { + pthread_setname_np(pthread_self(),"nr_pdcp_tick_thread"); + uint64_t curr_time = 0; + while (1) { + usleep(1000); + curr_time++; + nr_pdcp_wakeup_timer_thread(curr_time); + } + return NULL; +} + +void nr_pdcp_init_tick_thread() +{ + pthread_t t; + if (pthread_create(&t, NULL, nr_pdcp_tick_thread, NULL) != 0) { + LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); + exit(1); + } +} + void nr_pdcp_init_timer_thread(nr_pdcp_ue_manager_t *nr_pdcp_ue_manager) { pthread_t t; diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.h index db8282f940..552d5da279 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.h +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.h @@ -26,6 +26,7 @@ #include +void nr_pdcp_init_tick_thread(); void nr_pdcp_init_timer_thread(nr_pdcp_ue_manager_t *nr_pdcp_ue_manager); void nr_pdcp_wakeup_timer_thread(uint64_t time); From d3b4a6b788e930b25f5a3ca03c9f0d18bbfbd891 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 30 Sep 2024 15:25:10 +0200 Subject: [PATCH 85/87] Fix: clear HTML global's internal state --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 4833d105af..7b9956174e 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -291,7 +291,7 @@ def CheckLogs(self, yaml, service_name, HTML, RAN): success = False else: HTML.CreateHtmlTestRowQueue(opt, 'OK', [HTML.htmleNBFailureMsg]) - HTML.htmlUEFailureMsg = "" + HTML.htmleNBFailureMsg = "" else: logging.info(f'Skipping to analyze log for service name {service_name}') HTML.CreateHtmlTestRowQueue(f"service {service_name}", 'OK', ["no analysis function"]) From 5ee9e20f7d96911ffb8e3330de55f86c8160aaa7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 30 Sep 2024 15:31:29 +0200 Subject: [PATCH 86/87] SAbox: consistently pull/clean test images in each step --- .../xml_files/container_sa_b200_quectel.xml | 8 ++++++++ .../xml_files/container_sa_f1_b200_quectel.xml | 16 ++++++++++++++++ .../xml_files/container_sa_sc_b200_quectel.xml | 8 ++++++++ 3 files changed, 32 insertions(+) diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml index a683c07a03..4a4c8309a5 100644 --- a/ci-scripts/xml_files/container_sa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml @@ -52,6 +52,7 @@ 010002 030201 200000 + 222222 @@ -215,5 +216,12 @@ 10,100,100,100 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml index 36adc62777..e03180e236 100644 --- a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml @@ -25,6 +25,7 @@ 10 MHz FDD F1 SA tasks + 111111 100000 110002 800813 @@ -56,9 +57,17 @@ 100001 130201 200000 + 222222 + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-gnb + + Initialize_UE Initialize Quectel @@ -238,5 +247,12 @@ 10,100,100,100 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + diff --git a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml index 6831be6949..54df2fa1a4 100644 --- a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml @@ -46,6 +46,7 @@ 210002 230201 400000 + 222222 @@ -209,5 +210,12 @@ 10,100,100,100 + + Clean_Test_Server_Images + true + Clean Test Images on Test Server + 0 + + From 0e23b795b78d2a02c6d33c5ae747f3aa0e7e10d8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 30 Sep 2024 16:08:58 +0200 Subject: [PATCH 87/87] CI: use Custom_Script to execute SR-IOV/setup scripts for FHI72 pipeline --- ci-scripts/cls_oaicitest.py | 13 +++++++++++++ ci-scripts/main.py | 6 ++++++ ci-scripts/xml_class_list.yml | 1 + .../xml_files/container_sa_fhi72_vvdn_up2.xml | 8 ++++---- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 78c20fb172..1729a45620 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -239,6 +239,19 @@ def Custom_Command(HTML, node, command, command_fail): HTML.CreateHtmlTestRowQueue(command, status, message) return status == 'OK' or status == 'Warning' +def Custom_Script(HTML, node, script, command_fail): + logging.info(f"Executing custom script on {node}") + ret = cls_cmd.runScript(node, script, 90) + logging.debug(f"Custom_Script: {script} on node: {node} - return code {ret.returncode}, output:\n{ret.stdout}") + status = 'OK' + message = [ret.stdout] + if ret.returncode != 0 and not command_fail: + status = 'Warning' + if ret.returncode != 0 and command_fail: + status = 'KO' + HTML.CreateHtmlTestRowQueue(script, status, message) + return status == 'OK' or status == 'Warning' + def IdleSleep(HTML, idle_sleep_time): time.sleep(idle_sleep_time) HTML.CreateHtmlTestRow(f"{idle_sleep_time} sec", 'OK', CONST.ALL_PROCESSES_OK) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 415ea76c27..0886f4f9fa 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -428,6 +428,12 @@ def ExecuteActionWithParam(action): command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes'] success = cls_oaicitest.Custom_Command(HTML, node, command, command_fail) + elif action == 'Custom_Script': + node = test.findtext('node') + script = test.findtext('script') + command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes'] + success = cls_oaicitest.Custom_Script(HTML, node, script, command_fail) + elif action == 'Pull_Cluster_Image': string_field = test.findtext('images_to_pull') if (string_field is not None): diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index deba963bc6..325797c29e 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -42,4 +42,5 @@ - Pull_Local_Registry - Clean_Test_Server_Images - Custom_Command + - Custom_Script - Create_Workspace diff --git a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml index 527bc70082..215fe3ea26 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml @@ -45,10 +45,10 @@ - Custom_Command + Custom_Script Setup sriov and network interfaces VVDN cacofonix - /opt/FHI7.2/setup_sriov_vvdn.sh + yes @@ -157,11 +157,11 @@ - Custom_Command + Custom_Script true Set CPU to idle state, set kernel parameters to default values cacofonix - /opt/FHI7.2/setup_cleanup.sh + yes