From 818b27c1f802d106ddbbe0e6c514f10adce4f2bb Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Wed, 31 Oct 2018 18:18:51 +0100 Subject: [PATCH 01/21] renaming for gNB --- openair1/PHY/NR_TRANSPORT/nr_dci.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dci_tools.c | 2 +- openair1/PHY/defs_gNB.h | 31 ++-- openair1/SCHED_NR/fapi_nr_l1.c | 8 +- openair1/SCHED_NR/fapi_nr_l1.h | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair1/SCHED_NR/sched_nr.h | 2 +- targets/RT/USER/nr-gnb.c | 170 ++++++++++++---------- targets/RT/USER/nr-ru.c | 2 +- 9 files changed, 123 insertions(+), 98 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 62236eff32..8d79311f35 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -49,7 +49,7 @@ void nr_pdcch_scrambling(uint32_t *in, void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB, int frame, int subframe, - gNB_rxtx_proc_t *proc, + gNB_L1_rxtx_proc_t *proc, NR_gNB_DCI_ALLOC_t *dci_alloc, nfapi_nr_dl_config_request_pdu_t *pdu); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c index aafafb6d7d..c1a17e6da7 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c @@ -108,7 +108,7 @@ void nr_fill_cce_list(NR_gNB_DCI_ALLOC_t* dci_alloc, uint16_t n_shift, uint8_t m void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB, int frame, int subframe, - gNB_rxtx_proc_t *proc, + gNB_L1_rxtx_proc_t *proc, NR_gNB_DCI_ALLOC_t *dci_alloc, nfapi_nr_dl_config_request_pdu_t *pdu) { diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 18c2ba5cce..6afed9518d 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -99,22 +99,29 @@ typedef struct { int frame_rx; /// \brief Instance count for RXn-TXnp4 processing thread. /// \internal This variable is protected by \ref mutex_rxtx. - int instance_cnt_rxtx; + int instance_cnt; /// pthread structure for RXn-TXnp4 processing thread - pthread_t pthread_rxtx; + pthread_t pthread; /// pthread attributes for RXn-TXnp4 processing thread - pthread_attr_t attr_rxtx; + pthread_attr_t attr; /// condition variable for tx processing thread - pthread_cond_t cond_rxtx; + pthread_cond_t cond; /// mutex for RXn-TXnp4 processing thread - pthread_mutex_t mutex_rxtx; + pthread_mutex_t mutex; /// scheduling parameters for RXn-TXnp4 thread struct sched_param sched_param_rxtx; -} gNB_rxtx_proc_t; + + /// \internal This variable is protected by \ref mutex_RUs. + int instance_cnt_RUs; + /// condition variable for tx processing thread + pthread_cond_t cond_RUs; + /// mutex for RXn-TXnp4 processing thread + pthread_mutex_t mutex_RUs; +} gNB_L1_rxtx_proc_t; /// Context data structure for eNB subframe processing -typedef struct gNB_proc_t_s { +typedef struct gNB_L1_proc_t_s { /// Component Carrier index uint8_t CC_id; /// thread index @@ -181,17 +188,19 @@ typedef struct gNB_proc_t_s { pthread_mutex_t mutex_asynch_rxtx; /// mutex for RU access to eNB processing (PDSCH/PUSCH) pthread_mutex_t mutex_RU; + /// mutex for RU_tx access to eNB_tx processing (PDSCH/PUSCH) + pthread_mutex_t mutex_RU_tx; /// mutex for RU access to eNB processing (PRACH) pthread_mutex_t mutex_RU_PRACH; /// mutex for RU access to eNB processing (PRACH BR) pthread_mutex_t mutex_RU_PRACH_br; /// mask for RUs serving eNB (PDSCH/PUSCH) - int RU_mask; + int RU_mask, RU_mask_tx; /// mask for RUs serving eNB (PRACH) int RU_mask_prach; /// set of scheduling variables RXn-TXnp4 threads - gNB_rxtx_proc_t proc_rxtx[2]; -} gNB_proc_t; + gNB_L1_rxtx_proc_t L1_proc, L1_proc_tx; +} gNB_L1_proc_t; @@ -251,7 +260,7 @@ typedef struct PHY_VARS_gNB_s { module_id_t Mod_id; uint8_t CC_id; uint8_t configured; - gNB_proc_t proc; + gNB_L1_proc_t proc; int single_thread_flag; int abstraction_flag; int num_RU; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index e6fda71d39..99c8ab3037 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -37,7 +37,7 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req); extern uint8_t nfapi_mode; void handle_nr_nfapi_bch_pdu(PHY_VARS_gNB *gNB, - gNB_rxtx_proc_t *proc, + gNB_L1_rxtx_proc_t *proc, nfapi_nr_dl_config_request_pdu_t *dl_config_pdu, uint8_t *sdu) { @@ -56,7 +56,7 @@ void handle_nr_nfapi_bch_pdu(PHY_VARS_gNB *gNB, void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB, int frame, int subframe, - gNB_rxtx_proc_t *proc, + gNB_L1_rxtx_proc_t *proc, nfapi_nr_dl_config_request_pdu_t *dl_config_pdu) { int idx = subframe&1; @@ -73,7 +73,7 @@ void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB, void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ PHY_VARS_gNB *gNB; - gNB_rxtx_proc_t *proc; + gNB_L1_rxtx_proc_t *proc; // copy data from L2 interface into L1 structures module_id_t Mod_id = Sched_INFO->module_id; uint8_t CC_id = Sched_INFO->CC_id; @@ -87,7 +87,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ AssertFatal(RC.gNB[Mod_id][CC_id]!=NULL,"RC.gNB[%d][%d] is null\n",Mod_id,CC_id); gNB = RC.gNB[Mod_id][CC_id]; - proc = &gNB->proc.proc_rxtx[0]; + proc = &gNB->proc.L1_proc; uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu; diff --git a/openair1/SCHED_NR/fapi_nr_l1.h b/openair1/SCHED_NR/fapi_nr_l1.h index 2dd47ad806..4c6b25e969 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.h +++ b/openair1/SCHED_NR/fapi_nr_l1.h @@ -41,5 +41,5 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO); void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB, int frame, int subframe, - gNB_rxtx_proc_t *proc, + gNB_L1_rxtx_proc_t *proc, nfapi_nr_dl_config_request_pdu_t *dl_config_pdu); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 36c441db26..86c49cd6d9 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -152,7 +152,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) { } void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, - gNB_rxtx_proc_t *proc, + gNB_L1_rxtx_proc_t *proc, int do_meas) { int aa; diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index f962575a2a..17354d4fb3 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -36,7 +36,7 @@ lte_subframe_t nr_subframe_select (nfapi_nr_config_request_t *cfg, unsigned char subframe); void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp); -void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_rxtx_proc_t *proc, int do_meas); +void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, int do_meas); void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe); void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx); void nr_feptx_ofdm(RU_t *ru); diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index 41e14aaaa5..0f2866cdca 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -154,7 +154,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); #define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials) -static inline int rxtx(PHY_VARS_gNB *gNB,gNB_rxtx_proc_t *proc, char *thread_name) { +static inline int rxtx(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc, char *thread_name) { start_meas(&softmodem_stats_rxtx_sf); // ******************************************************************* @@ -281,7 +281,7 @@ static inline int rxtx(PHY_VARS_gNB *gNB,gNB_rxtx_proc_t *proc, char *thread_nam /*! * \brief The RX UE-specific and TX thread of gNB. - * \param param is a \ref gNB_proc_t structure which contains the info what to process. + * \param param is a \ref gNB_L1_proc_t structure which contains the info what to process. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ @@ -289,7 +289,7 @@ static void* gNB_thread_rxtx( void* param ) { static int gNB_thread_rxtx_status; - gNB_rxtx_proc_t *proc = (gNB_rxtx_proc_t*)param; + gNB_L1_rxtx_proc_t *proc = (gNB_L1_rxtx_proc_t*)param; PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; char thread_name[100]; @@ -299,13 +299,13 @@ static void* gNB_thread_rxtx( void* param ) { gNB_thread_rxtx_status = 0; - sprintf(thread_name,"RXn_TXnp4_%d",&gNB->proc.proc_rxtx[0] == proc ? 0 : 1); + sprintf(thread_name,"RXn_TXnp4_%d",&gNB->proc.L1_proc == proc ? 0 : 1); thread_top_init(thread_name,1,850000L,1000000L,2000000L); while (!oai_exit) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); - if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; + if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 ); @@ -317,7 +317,7 @@ static void* gNB_thread_rxtx( void* param ) { } - if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; + if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; } // while !oai_exit @@ -355,8 +355,8 @@ static void wait_system_ready (char *message, volatile int *start_flag) { void gNB_top(PHY_VARS_gNB *gNB, int frame_rx, int subframe_rx, char *string, struct RU_t_s *ru) { - gNB_proc_t *proc = &gNB->proc; - gNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0]; + gNB_L1_proc_t *proc = &gNB->proc; + gNB_L1_rxtx_proc_t *L1_proc = &proc->L1_proc; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; RU_proc_t *ru_proc=&ru->proc; @@ -366,25 +366,25 @@ void gNB_top(PHY_VARS_gNB *gNB, int frame_rx, int subframe_rx, char *string, str if (!oai_exit) { T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); - proc_rxtx->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); - proc_rxtx->frame_rx = ru_proc->frame_rx; - proc_rxtx->subframe_rx = ru_proc->subframe_rx; - proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx; - proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10; + L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); + L1_proc->frame_rx = ru_proc->frame_rx; + L1_proc->subframe_rx = ru_proc->subframe_rx; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; - if (rxtx(gNB,proc_rxtx,string) < 0) LOG_E(PHY,"gNB %d CC_id %d failed during execution\n",gNB->Mod_id,gNB->CC_id); - ru_proc->timestamp_tx = proc_rxtx->timestamp_tx; - ru_proc->subframe_tx = proc_rxtx->subframe_tx; - ru_proc->frame_tx = proc_rxtx->frame_tx; + if (rxtx(gNB,L1_proc,string) < 0) LOG_E(PHY,"gNB %d CC_id %d failed during execution\n",gNB->Mod_id,gNB->CC_id); + ru_proc->timestamp_tx = L1_proc->timestamp_tx; + ru_proc->subframe_tx = L1_proc->subframe_tx; + ru_proc->frame_tx = L1_proc->frame_tx; } } int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { - gNB_proc_t *proc=&gNB->proc; + gNB_L1_proc_t *proc=&gNB->proc; - gNB_rxtx_proc_t *proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1]; + gNB_L1_rxtx_proc_t *L1_proc=&proc->L1_proc; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; @@ -415,24 +415,24 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { wait.tv_nsec=5000000L; /* accept some delay in processing - up to 5ms */ - for (i = 0; i < 10 && proc_rxtx->instance_cnt_rxtx == 0; i++) { - LOG_W( PHY,"[gNB] Frame %d Subframe %d, gNB RXn-TXnp4 thread busy!! (cnt_rxtx %i)\n", proc_rxtx->frame_tx, proc_rxtx->subframe_tx, proc_rxtx->instance_cnt_rxtx); + for (i = 0; i < 10 && L1_proc->instance_cnt == 0; i++) { + LOG_W( PHY,"[gNB] Frame %d Subframe %d, gNB RXn-TXnp4 thread busy!! (cnt %i)\n", L1_proc->frame_tx, L1_proc->subframe_tx, L1_proc->instance_cnt); usleep(500); } - if (proc_rxtx->instance_cnt_rxtx == 0) { + if (L1_proc->instance_cnt == 0) { exit_fun( "TX thread busy" ); return(-1); } // wake up TX for subframe n+sf_ahead // lock the TX mutex and make sure the thread is ready - if (pthread_mutex_timedlock(&proc_rxtx->mutex_rxtx,&wait) != 0) { - LOG_E( PHY, "[gNB] ERROR pthread_mutex_lock for gNB RXTX thread %d (IC %d)\n", proc_rxtx->subframe_rx&1,proc_rxtx->instance_cnt_rxtx ); - exit_fun( "error locking mutex_rxtx" ); + if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) { + LOG_E( PHY, "[gNB] ERROR pthread_mutex_lock for gNB RXTX thread %d (IC %d)\n", L1_proc->subframe_rx&1,L1_proc->instance_cnt ); + exit_fun( "error locking mutex" ); return(-1); } - ++proc_rxtx->instance_cnt_rxtx; + ++L1_proc->instance_cnt; // We have just received and processed the common part of a subframe, say n. // TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired @@ -440,27 +440,27 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - proc_rxtx->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); - proc_rxtx->frame_rx = proc->frame_rx; - proc_rxtx->subframe_rx = proc->subframe_rx; - proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx; - proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10; + L1_proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); + L1_proc->frame_rx = proc->frame_rx; + L1_proc->subframe_rx = proc->subframe_rx; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; // the thread can now be woken up - if (pthread_cond_signal(&proc_rxtx->cond_rxtx) != 0) { + if (pthread_cond_signal(&L1_proc->cond) != 0) { LOG_E( PHY, "[gNB] ERROR pthread_cond_signal for gNB RXn-TXnp4 thread\n"); exit_fun( "ERROR pthread_cond_signal" ); return(-1); } - pthread_mutex_unlock( &proc_rxtx->mutex_rxtx ); + pthread_mutex_unlock( &L1_proc->mutex ); return(0); } /* void wakeup_prach_gNB(PHY_VARS_gNB *gNB,RU_t *ru,int frame,int subframe) { - gNB_proc_t *proc = &gNB->proc; + gNB_L1_proc_t *proc = &gNB->proc; LTE_DL_FRAME_PARMS *fp=&gNB->frame_parms; int i; @@ -519,7 +519,7 @@ void wakeup_prach_gNB(PHY_VARS_gNB *gNB,RU_t *ru,int frame,int subframe) { /*! * \brief The prach receive thread of gNB. - * \param param is a \ref gNB_proc_t structure which contains the info what to process. + * \param param is a \ref gNB_L1_proc_t structure which contains the info what to process. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ /* @@ -528,7 +528,7 @@ static void* gNB_thread_prach( void* param ) { PHY_VARS_gNB *gNB= (PHY_VARS_gNB *)param; - gNB_proc_t *proc = &gNB->proc; + gNB_L1_proc_t *proc = &gNB->proc; // set default return value gNB_thread_prach_status = 0; @@ -568,8 +568,8 @@ void init_gNB_proc(int inst) { int i=0; int CC_id; PHY_VARS_gNB *gNB; - gNB_proc_t *proc; - gNB_rxtx_proc_t *proc_rxtx; + gNB_L1_proc_t *proc; + gNB_L1_rxtx_proc_t *L1_proc,*L1_proc_tx; pthread_attr_t *attr0=NULL,*attr1=NULL; //*attr_prach=NULL; @@ -582,27 +582,32 @@ void init_gNB_proc(int inst) { #endif proc = &gNB->proc; - proc_rxtx = proc->proc_rxtx; - proc_rxtx[0].instance_cnt_rxtx = -1; - proc_rxtx[1].instance_cnt_rxtx = -1; + L1_proc = &proc->L1_proc; + L1_proc_tx = &proc->L1_proc_tx; + L1_proc->instance_cnt = -1; + L1_proc_tx->instance_cnt = -1; + L1_proc->instance_cnt_RUs = 0; + L1_proc_tx->instance_cnt_RUs = 0; proc->instance_cnt_prach = -1; proc->instance_cnt_asynch_rxtx = -1; proc->CC_id = CC_id; - proc->first_rx=1; - proc->first_tx=1; - proc->RU_mask=0; - proc->RU_mask_prach=0; + proc->first_rx =1; + proc->first_tx =1; + proc->RU_mask =0; + proc->RU_mask_tx = (1<num_RU)-1; + proc->RU_mask_prach =0; pthread_mutex_init( &gNB->UL_INFO_mutex, NULL); - pthread_mutex_init( &proc_rxtx[0].mutex_rxtx, NULL); - pthread_mutex_init( &proc_rxtx[1].mutex_rxtx, NULL); - pthread_cond_init( &proc_rxtx[0].cond_rxtx, NULL); - pthread_cond_init( &proc_rxtx[1].cond_rxtx, NULL); + pthread_mutex_init( &L1_proc->mutex, NULL); + pthread_mutex_init( &L1_proc_tx->mutex, NULL); + pthread_cond_init( &L1_proc->cond, NULL); + pthread_cond_init( &L1_proc_tx->cond, NULL); pthread_mutex_init( &proc->mutex_prach, NULL); pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL); pthread_mutex_init( &proc->mutex_RU,NULL); + pthread_mutex_init( &proc->mutex_RU_tx,NULL); pthread_mutex_init( &proc->mutex_RU_PRACH,NULL); pthread_cond_init( &proc->cond_prach, NULL); @@ -612,23 +617,23 @@ void init_gNB_proc(int inst) { pthread_attr_init( &proc->attr_asynch_rxtx); // pthread_attr_init( &proc->attr_td); // pthread_attr_init( &proc->attr_te); - pthread_attr_init( &proc_rxtx[0].attr_rxtx); - pthread_attr_init( &proc_rxtx[1].attr_rxtx); + pthread_attr_init( &L1_proc->attr); + pthread_attr_init( &L1_proc_tx->attr); LOG_I(PHY,"gNB->single_thread_flag:%d\n", gNB->single_thread_flag); - if (gNB->single_thread_flag==0) { - pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, gNB_thread_rxtx, &proc_rxtx[0] ); - pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, gNB_thread_rxtx, &proc_rxtx[1] ); - } + /*if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) { + pthread_create( &L1_proc->pthread, attr0, L1_thread, proc ); + pthread_create( &L1_proc_tx->pthread, attr1, L1_thread_tx, proc); + }*/ //pthread_create( &proc->pthread_prach, attr_prach, gNB_thread_prach, gNB ); char name[16]; if (gNB->single_thread_flag==0) { - snprintf( name, sizeof(name), "RXTX0 %d", i ); - pthread_setname_np( proc_rxtx[0].pthread_rxtx, name ); - snprintf( name, sizeof(name), "RXTX1 %d", i ); - pthread_setname_np( proc_rxtx[1].pthread_rxtx, name ); + snprintf( name, sizeof(name), "L1 %d", i ); + pthread_setname_np( L1_proc->pthread, name ); + snprintf( name, sizeof(name), "L1TX %d", i ); + pthread_setname_np( L1_proc_tx->pthread, name ); } AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach); @@ -651,23 +656,27 @@ void kill_gNB_proc(int inst) { int *status; PHY_VARS_gNB *gNB; - gNB_proc_t *proc; - gNB_rxtx_proc_t *proc_rxtx; + gNB_L1_proc_t *proc; + gNB_L1_rxtx_proc_t *L1_proc, *L1_proc_tx; for (int CC_id=0; CC_idproc; - proc_rxtx = &proc->proc_rxtx[0]; + L1_proc = &proc->L1_proc; + L1_proc_tx = &proc->L1_proc_tx; LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst ); - if (gNB->single_thread_flag==0) { - pthread_mutex_lock(&proc_rxtx[0].mutex_rxtx); - proc_rxtx[0].instance_cnt_rxtx = 0; - pthread_mutex_unlock(&proc_rxtx[0].mutex_rxtx); - pthread_mutex_lock(&proc_rxtx[1].mutex_rxtx); - proc_rxtx[1].instance_cnt_rxtx = 0; - pthread_mutex_unlock(&proc_rxtx[1].mutex_rxtx); + if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) { + pthread_mutex_lock(&L1_proc->mutex); + L1_proc->instance_cnt = 0; + pthread_cond_signal(&L1_proc->cond); + pthread_mutex_unlock(&L1_proc->mutex); + + pthread_mutex_lock(&L1_proc_tx->mutex); + L1_proc_tx->instance_cnt = 0; + pthread_cond_signal(&L1_proc_tx->cond); + pthread_mutex_unlock(&L1_proc_tx->mutex); } proc->instance_cnt_prach = 0; pthread_cond_signal( &proc->cond_prach ); @@ -685,15 +694,22 @@ void kill_gNB_proc(int inst) { LOG_I(PHY, "Destroying UL_INFO mutex\n"); pthread_mutex_destroy(&gNB->UL_INFO_mutex); int i; - if (gNB->single_thread_flag==0) { - for (i=0;i<2;i++) { - LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n",i); - pthread_join( proc_rxtx[i].pthread_rxtx, (void**)&status ); - LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n",i); - pthread_mutex_destroy( &proc_rxtx[i].mutex_rxtx ); - pthread_cond_destroy( &proc_rxtx[i].cond_rxtx ); - } + if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) { + LOG_I(PHY, "Joining L1_proc mutex/cond\n"); + pthread_join( L1_proc->pthread, (void**)&status ); + LOG_I(PHY, "Joining L1_proc_tx mutex/cond\n"); + pthread_join( L1_proc_tx->pthread, (void**)&status ); } + LOG_I(PHY, "Destroying L1_proc mutex/cond\n"); + pthread_mutex_destroy( &L1_proc->mutex ); + pthread_cond_destroy( &L1_proc->cond ); + LOG_I(PHY, "Destroying L1_proc_tx mutex/cond\n"); + pthread_mutex_destroy( &L1_proc_tx->mutex ); + pthread_cond_destroy( &L1_proc_tx->cond ); + + + pthread_mutex_destroy( &proc->mutex_RU ); + pthread_mutex_destroy( &proc->mutex_RU_tx ); } } diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index 04f2f3cdd4..e11b8ee781 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -874,7 +874,7 @@ void tx_rf(RU_t *ru) { /*! * \brief The Asynchronous RX/TX FH thread of RAU/RCC/gNB/RRU. * This handles the RX FH for an asynchronous RRU/UE - * \param param is a \ref gNB_proc_t structure which contains the info what to process. + * \param param is a \ref gNB_L1_proc_t structure which contains the info what to process. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ static void* ru_thread_asynch_rxtx( void* param ) { From b1a4d4ead4ad82abb0d157ff913f29261c888bba Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Mon, 5 Nov 2018 15:04:32 +0100 Subject: [PATCH 02/21] adding parallel structure --- openair1/PHY/defs_RU.h | 2 - openair2/GNB_APP/gnb_config.c | 36 ++++- openair2/GNB_APP/gnb_paramdef.h | 26 ++++ targets/RT/USER/nr-gnb.c | 174 ++++++++++++++++++++++-- targets/RT/USER/nr-ru.c | 234 +++++++++++++++++++++++++------- 5 files changed, 408 insertions(+), 64 deletions(-) diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 3ad007813e..6f68ee0fb4 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -304,8 +304,6 @@ typedef struct RU_proc_t_s { int instance_pre_scd; #endif /// pipeline ready state - int ru_rx_ready; - int ru_tx_ready; int emulate_rf_busy; } RU_proc_t; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index ac5c8e8b5a..db1bc52090 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -77,6 +77,10 @@ #include "NR_EUTRA-MBSFN-SubframeConfig.h" extern uint16_t sf_ahead; +extern void set_parallel_conf(char *parallel_conf); +extern void set_worker_conf(char *worker_conf); +extern PARALLEL_CONF_t get_thread_parallel_conf(void); +extern WORKER_CONF_t get_thread_worker_conf(void); void RCconfig_nr_flexran() { @@ -2976,6 +2980,36 @@ int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i) { return 0; } +int RCconfig_nr_parallel(void) { + char *parallel_conf = NULL; + char *worker_conf = NULL; + extern char *parallel_config; + extern char *worker_config; + paramdef_t ThreadParams[] = THREAD_CONF_DESC; + paramlist_def_t THREADParamList = {THREAD_CONFIG_STRING_THREAD_STRUCT,NULL,0}; + config_getlist( &THREADParamList,NULL,0,NULL); + + if(THREADParamList.numelt>0) { + config_getlist( &THREADParamList,ThreadParams,sizeof(ThreadParams)/sizeof(paramdef_t),NULL); + parallel_conf = strdup(*(THREADParamList.paramarray[0][THREAD_PARALLEL_IDX].strptr)); + } else { + parallel_conf = strdup("PARALLEL_RU_L1_TRX_SPLIT"); + } + + if(THREADParamList.numelt>0) { + config_getlist( &THREADParamList,ThreadParams,sizeof(ThreadParams)/sizeof(paramdef_t),NULL); + worker_conf = strdup(*(THREADParamList.paramarray[0][THREAD_WORKER_IDX].strptr)); + } else { + worker_conf = strdup("WORKER_ENABLE"); + } + + if(parallel_config == NULL) set_parallel_conf(parallel_conf); + + if(worker_config == NULL) set_worker_conf(worker_conf); + + return 0; +} + void NRRCConfig(void) { paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; @@ -3016,7 +3050,7 @@ void NRRCConfig(void) { config_getlist( &RUParamList,NULL,0, NULL); RC.nb_RU = RUParamList.numelt; - RCconfig_parallel(); + RCconfig_nr_parallel(); } diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index fd59f83097..a457a3b1a4 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -1099,3 +1099,29 @@ typedef enum { #define MACRLC_REMOTE_S_PORTD_IDX 16 #define MACRLC_SCHED_MODE_IDX 17 #define MACRLC_PHY_TEST_IDX 18 + + +/* thread configuration parameters section name */ +#define THREAD_CONFIG_STRING_THREAD_STRUCT "THREAD_STRUCT" + +/* thread configuration parameters names */ +#define THREAD_CONFIG_STRING_PARALLEL "parallel_config" +#define THREAD_CONFIG_STRING_WORKER "worker_config" + + +#define THREAD_PARALLEL_IDX 0 +#define THREAD_WORKER_IDX 1 + +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* thread configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define THREAD_CONF_DESC { \ +{THREAD_CONFIG_STRING_PARALLEL, CONFIG_HLP_PARALLEL, 0, strptr:NULL, defstrval:"PARALLEL_RU_L1_TRX_SPLIT", TYPE_STRING, 0}, \ +{THREAD_CONFIG_STRING_WORKER, CONFIG_HLP_WORKER, 0, strptr:NULL, defstrval:"WORKER_ENABLE", TYPE_STRING, 0} \ +} + + +#define CONFIG_HLP_WORKER "coding and FEP worker thread WORKER_DISABLE or WORKER_ENABLE\n" +#define CONFIG_HLP_PARALLEL "PARALLEL_SINGLE_THREAD, PARALLEL_RU_L1_SPLIT, or PARALLEL_RU_L1_TRX_SPLIT(RU_L1_TRX_SPLIT by defult)\n" +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index 0f2866cdca..34e9f295fd 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -143,6 +143,11 @@ extern double cpuf; void init_gNB(int,int); void stop_gNB(int nb_inst); +int wakeup_txfh(gNB_L1_rxtx_proc_t *proc,PHY_VARS_gNB *gNB); +int wakeup_tx(PHY_VARS_gNB *gNB); +extern PARALLEL_CONF_t get_thread_parallel_conf(void); +extern WORKER_CONF_t get_thread_worker_conf(void); + void wakeup_prach_gNB(PHY_VARS_gNB *gNB,RU_t *ru,int frame,int subframe); @@ -227,7 +232,9 @@ static inline int rxtx(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc, char *thread_ //if (wait_CCs(proc)<0) return(-1); if (oai_exit) return(-1); - phy_procedures_gNB_TX(gNB, proc, 1); + if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD){ + phy_procedures_gNB_TX(gNB, proc, 1); + } stop_meas( &softmodem_stats_rxtx_sf ); @@ -278,6 +285,44 @@ static inline int rxtx(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc, char *thread_ return(0); } +static void* gNB_L1_thread_tx(void* param) { + + gNB_L1_proc_t *gNB_proc = (gNB_L1_proc_t*)param; + gNB_L1_rxtx_proc_t *proc = &gNB_proc->L1_proc_tx; + PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; + + char thread_name[100]; + sprintf(thread_name,"TXnp4_%d\n",&gNB->proc.L1_proc == proc ? 0 : 1); + thread_top_init(thread_name,1,470000,500000,500000); + + //wait_sync("tx_thread"); + + while (!oai_exit) { + + + if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break; + if (oai_exit) break; + // ***************************************** + // TX processing for subframe n+4 + // run PHY TX procedures the one after the other for all CCs to avoid race conditions + // (may be relaxed in the future for performance reasons) + // ***************************************** + + phy_procedures_gNB_TX(gNB, proc, 1); + + pthread_mutex_lock( &proc->mutex ); + proc->instance_cnt = -1; + // the thread can now be woken up + if (pthread_cond_signal(&proc->cond) != 0) { + LOG_E( PHY, "[gNB] ERROR pthread_cond_signal for gNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + } + pthread_mutex_unlock( &proc->mutex ); + wakeup_txfh(proc,gNB); + } + + return 0; +} /*! * \brief The RX UE-specific and TX thread of gNB. @@ -285,11 +330,11 @@ static inline int rxtx(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc, char *thread_ * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ -static void* gNB_thread_rxtx( void* param ) { +static void* gNB_L1_thread( void* param ) { static int gNB_thread_rxtx_status; - - gNB_L1_rxtx_proc_t *proc = (gNB_L1_rxtx_proc_t*)param; + gNB_L1_proc_t *gNB_proc = (gNB_L1_proc_t*)param; + gNB_L1_rxtx_proc_t *proc = &gNB_proc->L1_proc; PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; char thread_name[100]; @@ -303,11 +348,9 @@ static void* gNB_thread_rxtx( void* param ) { thread_top_init(thread_name,1,850000L,1000000L,2000000L); while (!oai_exit) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 ); if (oai_exit) break; @@ -316,12 +359,19 @@ static void* gNB_thread_rxtx( void* param ) { if (rxtx(gNB,proc,thread_name) < 0) break; } - + if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT){ + phy_procedures_gNB_TX(gNB, proc, 1); + } if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; + if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT){ + wakeup_tx(gNB); + } + else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT){ + wakeup_txfh(proc,gNB); + } } // while !oai_exit - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); LOG_D(PHY, " *** Exiting gNB thread RXn_TXnp4\n"); @@ -379,6 +429,101 @@ void gNB_top(PHY_VARS_gNB *gNB, int frame_rx, int subframe_rx, char *string, str } } +int wakeup_txfh(gNB_L1_rxtx_proc_t *proc,PHY_VARS_gNB *gNB) { + + RU_t *ru; + RU_proc_t *ru_proc; + + + struct timespec wait; + wait.tv_sec=0; + wait.tv_nsec=5000000L; +//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); + + if(wait_on_condition(&proc->mutex_RUs,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) { + LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx); + return(-1); + } + pthread_mutex_lock(&gNB->proc.mutex_RU_tx); + gNB->proc.RU_mask_tx = 0; + pthread_mutex_unlock(&gNB->proc.mutex_RU_tx); + if (release_thread(&proc->mutex_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) return(-1); + + for(int i=0; inum_RU; i++) + { + ru = gNB->RU_list[i]; + ru_proc = &ru->proc; + if (ru_proc->instance_cnt_gNBs == 0) { + LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx); + return(-1); + } + if (pthread_mutex_timedlock(&ru_proc->mutex_gNBs,&wait) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_gNBs ); + exit_fun( "error locking mutex_gNB" ); + return(-1); + } + + ru_proc->instance_cnt_gNBs = 0; + ru_proc->timestamp_tx = proc->timestamp_tx; + ru_proc->subframe_tx = proc->subframe_tx; + ru_proc->frame_tx = proc->frame_tx; + + + // the thread can now be woken up + if (pthread_cond_signal(&ru_proc->cond_gNBs) != 0) { + LOG_E( PHY, "[gNB] ERROR pthread_cond_signal for gNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + return(-1); + } + + pthread_mutex_unlock( &ru_proc->mutex_gNBs ); + } + + return(0); +} + +int wakeup_tx(PHY_VARS_gNB *gNB) { + + gNB_L1_proc_t *proc=&gNB->proc; + + gNB_L1_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx; + gNB_L1_rxtx_proc_t *L1_proc = &proc->L1_proc; + + + struct timespec wait; + wait.tv_sec=0; + wait.tv_nsec=5000000L; + + + if (pthread_mutex_timedlock(&L1_proc_tx->mutex,&wait) != 0) { + LOG_E(PHY, "[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx\n"); + exit_fun("ERROR pthread_lock"); + return(-1); + } + while(L1_proc_tx->instance_cnt == 0){ + pthread_cond_wait(&L1_proc_tx->cond,&L1_proc_tx->mutex); + } + + L1_proc_tx->instance_cnt = 0; + + + L1_proc_tx->subframe_rx = L1_proc->subframe_rx; + L1_proc_tx->frame_rx = L1_proc->frame_rx; + L1_proc_tx->subframe_tx = L1_proc->subframe_tx; + L1_proc_tx->frame_tx = L1_proc->frame_tx; + L1_proc_tx->timestamp_tx = L1_proc->timestamp_tx; + + // the thread can now be woken up + if (pthread_cond_signal(&L1_proc_tx->cond) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + return(-1); + } + + pthread_mutex_unlock( &L1_proc_tx->mutex); + + return(0); +} int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { @@ -619,13 +764,15 @@ void init_gNB_proc(int inst) { // pthread_attr_init( &proc->attr_te); pthread_attr_init( &L1_proc->attr); pthread_attr_init( &L1_proc_tx->attr); + attr0 = &L1_proc->attr; + attr1 = &L1_proc_tx->attr; LOG_I(PHY,"gNB->single_thread_flag:%d\n", gNB->single_thread_flag); - /*if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) { - pthread_create( &L1_proc->pthread, attr0, L1_thread, proc ); - pthread_create( &L1_proc_tx->pthread, attr1, L1_thread_tx, proc); - }*/ + if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) { + pthread_create( &L1_proc->pthread, attr0, gNB_L1_thread, proc ); + pthread_create( &L1_proc_tx->pthread, attr1, gNB_L1_thread_tx, proc); + } //pthread_create( &proc->pthread_prach, attr_prach, gNB_thread_prach, gNB ); char name[16]; @@ -693,8 +840,7 @@ void kill_gNB_proc(int inst) { LOG_I(PHY, "Destroying UL_INFO mutex\n"); pthread_mutex_destroy(&gNB->UL_INFO_mutex); - int i; - if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) { + if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) { LOG_I(PHY, "Joining L1_proc mutex/cond\n"); pthread_join( L1_proc->pthread, (void**)&status ); LOG_I(PHY, "Joining L1_proc_tx mutex/cond\n"); diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index e11b8ee781..83410608e6 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -118,6 +118,9 @@ extern void nr_phy_init_RU(RU_t*); extern void nr_phy_free_RU(RU_t*); extern void nr_phy_config_request(NR_PHY_Config_t *gNB); +extern PARALLEL_CONF_t get_thread_parallel_conf(void); +extern WORKER_CONF_t get_thread_worker_conf(void); + void init_RU(char*); void stop_RU(int nb_ru); void do_ru_sync(RU_t *ru); @@ -1131,12 +1134,12 @@ void do_ru_synch(RU_t *ru) { -void wakeup_gNBs(RU_t *ru) { +void wakeup_gNB_L1s(RU_t *ru) { int i; PHY_VARS_gNB **gNB_list = ru->gNB_list; - LOG_D(PHY,"wakeup_gNBs (num %d) for RU %d ru->gNB_top:%p\n",ru->num_gNB,ru->idx, ru->gNB_top); + LOG_D(PHY,"wakeup_gNB_L1s (num %d) for RU %d ru->gNB_top:%p\n",ru->num_gNB,ru->idx, ru->gNB_top); if (ru->num_gNB==1 && ru->gNB_top!=0) { // call gNB function directly @@ -1378,6 +1381,118 @@ static void* ru_stats_thread(void* param) { return(NULL); } +static void* ru_thread_tx( void* param ) { + RU_t *ru = (RU_t*)param; + RU_proc_t *proc = &ru->proc; + PHY_VARS_gNB *gNB; + gNB_L1_proc_t *gNB_proc; + gNB_L1_rxtx_proc_t *L1_proc; + NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; + char filename[40]; + int print_frame = 2; + int i = 0; + + cpu_set_t cpuset; + CPU_ZERO(&cpuset); + + + thread_top_init("ru_thread_tx",1,400000,500000,500000); + + //CPU_SET(5, &cpuset); + //pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + //wait_sync("ru_thread_tx"); + + wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx"); + + + printf( "ru_thread_tx ready\n"); + while (!oai_exit) { + + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD_TX,sched_getcpu()); + if (oai_exit) break; + + + LOG_I(PHY,"ru_thread_tx: Waiting for TX processing\n"); + // wait until eNBs are finished subframe RX n and TX n+4 + wait_on_condition(&proc->mutex_gNBs,&proc->cond_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx"); + if (oai_exit) break; + + // do TX front-end processing if needed (precoding and/or IDFTs) + if (ru->feptx_prec) ru->feptx_prec(ru); + + // do OFDM if needed + if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru); + if(!emulate_rf){ + // do outgoing fronthaul (south) if needed + if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru); + + if (ru->fh_north_out) ru->fh_north_out(ru); + } + else + { + if(proc->frame_tx == print_frame) + { + for (i=0; inb_tx; i++) + { + sprintf(filename,"tx%ddataF_frame%d_sf%d.m", i, print_frame, proc->subframe_tx); + LOG_M(filename,"txdataF_frame",&ru->common.txdataF_BF[i][0],fp->samples_per_subframe_wCP, 1, 1); + if(proc->subframe_tx == 9) + { + sprintf(filename,"tx%ddata_frame%d.m", i, print_frame); + LOG_M(filename,"txdata_frame",&ru->common.txdata[i][0],fp->samples_per_frame, 1, 1); + sprintf(filename,"tx%ddata_frame%d.dat", i, print_frame); + FILE *output_fd = fopen(filename,"w"); + if (output_fd) { + fwrite(&ru->common.txdata[i][0], + sizeof(int32_t), + fp->samples_per_frame, + output_fd); + fclose(output_fd); + } + else { + LOG_E(PHY,"Cannot write to file %s\n",filename); + } + }//if(proc->subframe_tx == 9) + }//for (i=0; inb_tx; i++) + }//if(proc->frame_tx == print_frame) + }//else emulate_rf + release_thread(&proc->mutex_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx"); + for(i = 0; inum_gNB; i++) + { + gNB = ru->gNB_list[i]; + gNB_proc = &gNB->proc; + L1_proc = (get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)? &gNB_proc->L1_proc_tx : &gNB_proc->L1_proc; + pthread_mutex_lock(&gNB_proc->mutex_RU_tx); + for (int j=0;jnum_RU;j++) { + if (ru == gNB->RU_list[j]) { + if ((gNB_proc->RU_mask_tx&(1< 0) + LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU tx %d (num_RU %d,mask %x) has not been served yet!\n", + gNB->Mod_id,gNB_proc->frame_rx,gNB_proc->subframe_rx,ru->idx,gNB->num_RU,gNB_proc->RU_mask_tx); + gNB_proc->RU_mask_tx |= (1<RU_mask_tx != (1<num_RU)-1) { // not all RUs have provided their information so return + pthread_mutex_unlock(&gNB_proc->mutex_RU_tx); + } + else { // all RUs TX are finished so send the ready signal to eNB processing + gNB_proc->RU_mask_tx = 0; + pthread_mutex_unlock(&gNB_proc->mutex_RU_tx); + + pthread_mutex_lock( &L1_proc->mutex_RUs); + L1_proc->instance_cnt_RUs = 0; + // the thread can now be woken up + if (pthread_cond_signal(&L1_proc->cond_RUs) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + } + pthread_mutex_unlock( &L1_proc->mutex_RUs ); + } + } + } + release_thread(&proc->mutex_FH1,&proc->instance_cnt_FH1,"ru_thread_tx"); + return 0; +} + static void* ru_thread( void* param ) { static int ru_thread_status; @@ -1440,6 +1555,11 @@ static void* ru_thread( void* param ) { RC.ru_mask &= ~(1<idx); pthread_cond_signal(&RC.ru_cond); pthread_mutex_unlock(&RC.ru_mutex); + + pthread_mutex_lock(&proc->mutex_FH1); + proc->instance_cnt_FH1 = 0; + pthread_mutex_unlock(&proc->mutex_FH1); + pthread_cond_signal(&proc->cond_FH1); wait_sync("ru_thread"); @@ -1514,53 +1634,66 @@ static void* ru_thread( void* param ) { wakeup_slaves(proc); // wakeup all gNB processes waiting for this RU - if (ru->num_gNB>0) wakeup_gNBs(ru); + if (ru->num_gNB>0) wakeup_gNB_L1s(ru); - // wait until gNBs are finished subframe RX n and TX n+sf_ahead - wait_on_condition(&proc->mutex_gNBs,&proc->cond_gNBs,&proc->instance_cnt_gNBs,"ru_thread"); - - - // do TX front-end processing if needed (precoding and/or IDFTs) - if (ru->feptx_prec) ru->feptx_prec(ru); - - // do OFDM if needed - if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru); - if(!emulate_rf) - { - // do outgoing fronthaul (south) if needed - if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru); - - if (ru->fh_north_out) ru->fh_north_out(ru); - } - else - { - if(proc->frame_tx == print_frame) - { - for (i=0; inb_tx; i++) - { - sprintf(filename,"tx%ddataF_frame%d_sf%d.m", i, print_frame, proc->subframe_tx); - LOG_M(filename,"txdataF_frame",&ru->common.txdataF_BF[i][0],fp->samples_per_subframe_wCP, 1, 1); - if(proc->subframe_tx == 9) - { - sprintf(filename,"tx%ddata_frame%d.m", i, print_frame); - LOG_M(filename,"txdata_frame",&ru->common.txdata[i][0],fp->samples_per_frame, 1, 1); - sprintf(filename,"tx%ddata_frame%d.dat", i, print_frame); - FILE *output_fd = fopen(filename,"w"); - if (output_fd) { - fwrite(&ru->common.txdata[i][0], - sizeof(int32_t), - fp->samples_per_frame, - output_fd); - fclose(output_fd); - } - else { - LOG_E(PHY,"Cannot write to file %s\n",filename); - } - } - } + if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0){ + // do TX front-end processing if needed (precoding and/or IDFTs) + if (ru->feptx_prec) ru->feptx_prec(ru); + + // do OFDM if needed + if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru); + if(!emulate_rf){ + // do outgoing fronthaul (south) if needed + if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru); + + if (ru->fh_north_out) ru->fh_north_out(ru); } - //else if (proc->frame_tx > print_frame) oai_exit = 1; + proc->emulate_rf_busy = 0; } + + if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) + { + // do TX front-end processing if needed (precoding and/or IDFTs) + if (ru->feptx_prec) ru->feptx_prec(ru); + + // do OFDM if needed + if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru); + if(!emulate_rf) + { + // do outgoing fronthaul (south) if needed + if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru); + + if (ru->fh_north_out) ru->fh_north_out(ru); + } + else + { + if(proc->frame_tx == print_frame) + { + for (i=0; inb_tx; i++) + { + sprintf(filename,"tx%ddataF_frame%d_sf%d.m", i, print_frame, proc->subframe_tx); + LOG_M(filename,"txdataF_frame",&ru->common.txdataF_BF[i][0],fp->samples_per_subframe_wCP, 1, 1); + if(proc->subframe_tx == 9) + { + sprintf(filename,"tx%ddata_frame%d.m", i, print_frame); + LOG_M(filename,"txdata_frame",&ru->common.txdata[i][0],fp->samples_per_frame, 1, 1); + sprintf(filename,"tx%ddata_frame%d.dat", i, print_frame); + FILE *output_fd = fopen(filename,"w"); + if (output_fd) { + fwrite(&ru->common.txdata[i][0], + sizeof(int32_t), + fp->samples_per_frame, + output_fd); + fclose(output_fd); + } + else { + LOG_E(PHY,"Cannot write to file %s\n",filename); + } + }//if(proc->subframe_tx == 9) + }//for (i=0; inb_tx; i++) + }//if(proc->frame_tx == print_frame) + }//else emulate_rf + }//if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) } @@ -1680,7 +1813,7 @@ void init_RU_proc(RU_t *ru) { int i=0; RU_proc_t *proc; - pthread_attr_t *attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL, *attr_emulateRF=NULL;// *attr_synch=NULL; + pthread_attr_t *attr_FH=NULL, *attr_FH1=NULL,*attr_prach=NULL,*attr_asynch=NULL, *attr_emulateRF=NULL;// *attr_synch=NULL; //pthread_attr_t *attr_fep=NULL; #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) //pthread_attr_t *attr_prach_br=NULL; @@ -1697,6 +1830,7 @@ void init_RU_proc(RU_t *ru) { proc->instance_cnt_prach = -1; proc->instance_cnt_synch = -1; ; proc->instance_cnt_FH = -1; + proc->instance_cnt_FH1 = -1; proc->instance_cnt_asynch_rxtx = -1; proc->instance_cnt_emulateRF = -1; proc->first_rx = 1; @@ -1711,17 +1845,20 @@ void init_RU_proc(RU_t *ru) { pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL); pthread_mutex_init( &proc->mutex_synch,NULL); pthread_mutex_init( &proc->mutex_FH,NULL); + pthread_mutex_init( &proc->mutex_FH1,NULL); pthread_mutex_init( &proc->mutex_emulateRF,NULL); pthread_mutex_init( &proc->mutex_gNBs, NULL); pthread_cond_init( &proc->cond_prach, NULL); pthread_cond_init( &proc->cond_FH, NULL); + pthread_cond_init( &proc->cond_FH1, NULL); pthread_cond_init( &proc->cond_emulateRF, NULL); pthread_cond_init( &proc->cond_asynch_rxtx, NULL); pthread_cond_init( &proc->cond_synch,NULL); pthread_cond_init( &proc->cond_gNBs, NULL); pthread_attr_init( &proc->attr_FH); + pthread_attr_init( &proc->attr_FH1); pthread_attr_init( &proc->attr_emulateRF); pthread_attr_init( &proc->attr_prach); pthread_attr_init( &proc->attr_synch); @@ -1731,6 +1868,7 @@ void init_RU_proc(RU_t *ru) { #ifndef DEADLINE_SCHEDULER attr_FH = &proc->attr_FH; + attr_FH1 = &proc->attr_FH1; attr_emulateRF = &proc->attr_emulateRF; attr_prach = &proc->attr_prach; //attr_synch = &proc->attr_synch; @@ -1738,6 +1876,8 @@ void init_RU_proc(RU_t *ru) { #endif pthread_create( &proc->pthread_FH, attr_FH, ru_thread, (void*)ru ); + if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) + pthread_create( &proc->pthread_FH1, attr_FH1, ru_thread_tx, (void*)ru ); if(emulate_rf) pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void*)proc ); if (ru->function == NGFI_RRU_IF4p5) { From aa232879a32243ab1ccee10ac13f796161eb2a49 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Tue, 6 Nov 2018 15:15:56 +0100 Subject: [PATCH 03/21] adding VCD log in file --- common/utils/LOG/vcd_signal_dumper.c | 16 +++++- common/utils/LOG/vcd_signal_dumper.h | 15 ++++++ common/utils/T/T_defs.h | 4 +- common/utils/T/T_messages.txt | 54 +++++++++++++++++++ openair2/GNB_APP/gnb_config.c | 2 + .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 9 ++++ targets/RT/USER/nr-gnb.c | 21 +++++++- targets/RT/USER/nr-ru.c | 7 ++- targets/RT/USER/nr-uesoftmodem.h | 4 +- 9 files changed, 122 insertions(+), 10 deletions(-) diff --git a/common/utils/LOG/vcd_signal_dumper.c b/common/utils/LOG/vcd_signal_dumper.c index 666bf46d44..cb28be8550 100644 --- a/common/utils/LOG/vcd_signal_dumper.c +++ b/common/utils/LOG/vcd_signal_dumper.c @@ -189,7 +189,17 @@ const char* eurecomVariablesNames[] = { "ue0_trx_write_ns_missing", "enb_thread_rxtx_CPUID", "ru_thread_CPUID", - "ru_thread_tx_CPUID" + "ru_thread_tx_CPUID", + + /*signal for NR*/ + "frame_number_TX0_gNB", + "frame_number_TX1_gNB", + "frame_number_RX0_gNB", + "frame_number_RX1_gNB", + "subframe_number_TX0_gNB", + "subframe_number_TX1_gNB", + "subframe_number_RX0_gNB", + "subframe_number_RX1_gNB" }; const char* eurecomFunctionsNames[] = { @@ -408,6 +418,10 @@ const char* eurecomFunctionsNames[] = { "pdcch_interleaving", "pdcch_tx", + /*NR softmodem signal*/ + "gNB_thread_rxtx0", + "gNB_thread_rxtx1" + }; struct vcd_module_s vcd_modules[] = { diff --git a/common/utils/LOG/vcd_signal_dumper.h b/common/utils/LOG/vcd_signal_dumper.h index 749978bb48..5c1ba9e7fe 100644 --- a/common/utils/LOG/vcd_signal_dumper.h +++ b/common/utils/LOG/vcd_signal_dumper.h @@ -167,6 +167,17 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX, VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD, VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD_TX, + + /*signal for NR*/ + VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_GNB, + VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB, + VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_GNB, + VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_GNB, + VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_GNB, + VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_GNB, + VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_GNB, + VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_GNB, + VCD_SIGNAL_DUMPER_VARIABLES_END } vcd_signal_dump_variables; @@ -389,6 +400,10 @@ typedef enum { VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING, VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX, + /*NR softmodem signal*/ + VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, + VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, + VCD_SIGNAL_DUMPER_FUNCTIONS_END } vcd_signal_dump_functions; diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h index 83a380662d..5300237178 100644 --- a/common/utils/T/T_defs.h +++ b/common/utils/T/T_defs.h @@ -41,10 +41,10 @@ typedef struct { } T_cache_t; /* number of VCD functions (to be kept up to date! see in T_messages.txt) */ -#define VCD_NUM_FUNCTIONS 190 +#define VCD_NUM_FUNCTIONS 192//190 /* number of VCD variables (to be kept up to date! see in T_messages.txt) */ -#define VCD_NUM_VARIABLES 128 +#define VCD_NUM_VARIABLES 136//128 /* first VCD function (to be kept up to date! see in T_messages.txt) */ #define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index ec0585c799..6057c09f1c 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -1680,6 +1680,48 @@ ID = VCD_VARIABLE_CPUID_RU_THREAD_TX FORMAT = ulong,value VCD_NAME = ru_thread_tx_CPUID + #variable for gNB +ID = VCD_VARIABLE_FRAME_NUMBER_TX0_GNB + DESC = VCD variable FRAME_NUMBER_TX0_GNB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = frame_number_TX0_gNB +ID = VCD_VARIABLE_FRAME_NUMBER_TX1_GNB + DESC = VCD variable FRAME_NUMBER_TX1_GNB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = frame_number_TX1_gNB +ID = VCD_VARIABLE_FRAME_NUMBER_RX0_GNB + DESC = VCD variable FRAME_NUMBER_RX0_GNB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = frame_number_RX0_gNB +ID = VCD_VARIABLE_FRAME_NUMBER_RX1_GNB + DESC = VCD variable FRAME_NUMBER_RX1_GNB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = frame_number_RX1_gNB +ID = VCD_VARIABLE_SUBFRAME_NUMBER_TX0_GNB + DESC = VCD variable SUBFRAME_NUMBER_TX0_GNB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = subframe_number_TX0_gNB +ID = VCD_VARIABLE_SUBFRAME_NUMBER_TX1_GNB + DESC = VCD variable SUBFRAME_NUMBER_TX1_GNB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = subframe_number_TX1_gNB +ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX0_GNB + DESC = VCD variable SUBFRAME_NUMBER_RX0_GNB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = subframe_number_RX0_gNB +ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_GNB + DESC = VCD variable SUBFRAME_NUMBER_RX1_GNB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = subframe_number_RX1_gNB + #functions ID = VCD_FUNCTION_RT_SLEEP @@ -2637,3 +2679,15 @@ ID = VCD_FUNCTION_PDCCH_TX GROUP = ALL:VCD:ENB:VCD_FUNCTION FORMAT = int,value VCD_NAME = pdcch_tx + + #function for gNB +ID = VCD_FUNCTION_gNB_PROC_RXTX0 + DESC = VCD function gNB_PROC_RXTX0 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value + VCD_NAME = gNB_thread_rxtx0 +ID = VCD_FUNCTION_gNB_PROC_RXTX1 + DESC = VCD function gNB_PROC_RXTX1 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value + VCD_NAME = gNB_thread_rxtx1 diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index db1bc52090..7270ce9258 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -3004,8 +3004,10 @@ int RCconfig_nr_parallel(void) { } if(parallel_config == NULL) set_parallel_conf(parallel_conf); +if(parallel_config == NULL)printf("~~~~~~~~~~~~~~~~~~~~parallel_conf = %s\n",parallel_conf); if(worker_config == NULL) set_worker_conf(worker_conf); +if(worker_config == NULL)printf("~~~~~~~~~~~~~~~~~~~~worker_conf = %s\n",worker_conf); return 0; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index cd85fe7a33..721c307f71 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -259,6 +259,15 @@ RUs = ( } ); +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_DISABLE"; + } +); + NETWORK_CONTROLLER : { FLEXRAN_ENABLED = "no"; diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index 34e9f295fd..58e9be4a9e 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -290,6 +290,8 @@ static void* gNB_L1_thread_tx(void* param) { gNB_L1_proc_t *gNB_proc = (gNB_L1_proc_t*)param; gNB_L1_rxtx_proc_t *proc = &gNB_proc->L1_proc_tx; PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; + +printf("~~~~~~~~~~~~~~~~~~~~gNB_L1_thread_tx is created\n"); char thread_name[100]; sprintf(thread_name,"TXnp4_%d\n",&gNB->proc.L1_proc == proc ? 0 : 1); @@ -299,8 +301,9 @@ static void* gNB_L1_thread_tx(void* param) { while (!oai_exit) { - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 0 ); if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 1 ); if (oai_exit) break; // ***************************************** // TX processing for subframe n+4 @@ -308,6 +311,11 @@ static void* gNB_L1_thread_tx(void* param) { // (may be relaxed in the future for performance reasons) // ***************************************** + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_GNB,proc->subframe_tx); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_GNB,proc->subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB,proc->frame_tx); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_GNB,proc->frame_rx); + phy_procedures_gNB_TX(gNB, proc, 1); pthread_mutex_lock( &proc->mutex ); @@ -337,6 +345,8 @@ static void* gNB_L1_thread( void* param ) { gNB_L1_rxtx_proc_t *proc = &gNB_proc->L1_proc; PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; +printf("~~~~~~~~~~~~~~~~~~~~gNB_L1_thread_tx is created\n"); + char thread_name[100]; @@ -349,8 +359,14 @@ static void* gNB_L1_thread( void* param ) { while (!oai_exit) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, 0 ); if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, 1 ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_GNB,proc->subframe_tx); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_GNB,proc->subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_GNB,proc->frame_tx); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_GNB,proc->frame_rx); if (oai_exit) break; @@ -769,7 +785,9 @@ void init_gNB_proc(int inst) { LOG_I(PHY,"gNB->single_thread_flag:%d\n", gNB->single_thread_flag); +printf("~~~~~~~~~~~~~~~~~~~thread_parallel = %d",get_thread_parallel_conf()); if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) { +printf("~~~~~~~~~~~~~~~~~~~~~~~creating gNB_L1_thread and gNB_L1_thread_tx \n"); pthread_create( &L1_proc->pthread, attr0, gNB_L1_thread, proc ); pthread_create( &L1_proc_tx->pthread, attr1, gNB_L1_thread_tx, proc); } @@ -1046,6 +1064,7 @@ void init_eNB_afterRU(void) { //init_transport(gNB); //init_precoding_weights(RC.gNB[inst][CC_id]); } +printf("~~~~~~~~~~~~~~~~~~~~~~~start init gNB proc\n"); init_gNB_proc(inst); } diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index 83410608e6..f4481dcbf6 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -1407,8 +1407,7 @@ static void* ru_thread_tx( void* param ) { printf( "ru_thread_tx ready\n"); while (!oai_exit) { - - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD_TX,sched_getcpu()); + if (oai_exit) break; @@ -1430,7 +1429,7 @@ static void* ru_thread_tx( void* param ) { } else { - if(proc->frame_tx == print_frame) + /*if(proc->frame_tx == print_frame) { for (i=0; inb_tx; i++) { @@ -1454,7 +1453,7 @@ static void* ru_thread_tx( void* param ) { } }//if(proc->subframe_tx == 9) }//for (i=0; inb_tx; i++) - }//if(proc->frame_tx == print_frame) + }//if(proc->frame_tx == print_frame)*/ }//else emulate_rf release_thread(&proc->mutex_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx"); for(i = 0; inum_gNB; i++) diff --git a/targets/RT/USER/nr-uesoftmodem.h b/targets/RT/USER/nr-uesoftmodem.h index 90887fe128..dd74adc014 100644 --- a/targets/RT/USER/nr-uesoftmodem.h +++ b/targets/RT/USER/nr-uesoftmodem.h @@ -179,8 +179,8 @@ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \ {"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \ -{"codingw" , CONFIG_HLP_CODINGW, PARAMFLAG_BOOL, iptr:&codingw, defintval:0, TYPE_INT, 0}, \ -{"fepw" , CONFIG_HLP_FEPW, PARAMFLAG_BOOL, iptr:&fepw, defintval:0, TYPE_INT, 0}, \ +{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \ +{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \ } From e9a5ac204d6786d7d188322a20b772b39d6a6655 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 7 Nov 2018 09:40:17 +0100 Subject: [PATCH 04/21] initializing log properly for ulsim --- openair1/SIMULATION/LTE_PHY/ulsim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 8c09da1daf..6bdec77b76 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -497,6 +497,8 @@ int main(int argc, char **argv) { AssertFatal(load_configmodule(argc,argv) != NULL, "cannot load configuration module, exiting\n"); logInit(); + set_glog(OAILOG_WARNING); + T_stdout = 1; // enable these lines if you need debug info // however itti will catch all signals, so ctrl-c won't work anymore // alternatively you can disable ITTI completely in CMakeLists.txt From 3d845a370801f2fce93a543fad4ed3186cd41235 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 7 Nov 2018 11:06:19 +0100 Subject: [PATCH 05/21] CI: increasing the phy-sim time-out to 45 minutes Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index cbcd491a1b..e02f071c2f 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -313,7 +313,7 @@ pipeline { stage ("Test physical simulators") { steps { gitlabCommitStatus(name: "Test phy-sim") { - timeout (time: 30, unit: 'MINUTES') { + timeout (time: 45, unit: 'MINUTES') { sh "./ci-scripts/runTestOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } From c8b9ca55b799e183724b90cd4b625ef1c8231580 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 7 Nov 2018 12:00:52 +0100 Subject: [PATCH 06/21] nr-uesoftmodem: moving phy_procedures_nrUE into main thread when --loop-memory is used. --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 +-- targets/RT/USER/nr-ue.c | 57 ++++++++++++++++----- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index eee5cbae95..32beb92009 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -5913,8 +5913,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN #endif //nr_gold_pdcch(ue,0, 2); -/* - for (l=0; l<2; l++) { + + for (int l=0; l<2; l++) { if (abstraction_flag == 0) { #if UE_TIMING_TRACE start_meas(&ue->ofdm_demod_stats); @@ -5933,7 +5933,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN stop_meas(&ue->ofdm_demod_stats); #endif } - }*/ + } //ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode); //if (do_pdcch_flag) { diff --git a/targets/RT/USER/nr-ue.c b/targets/RT/USER/nr-ue.c index adefa661b2..41b20710e9 100644 --- a/targets/RT/USER/nr-ue.c +++ b/targets/RT/USER/nr-ue.c @@ -956,7 +956,7 @@ void *UE_thread(void *arg) { #if BASIC_SIMULATOR { int t; - for (t = 0; t < 2; t++) { + for (t = 0; t < RX_NB_TH; t++) { UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[t]; pthread_mutex_lock(&proc->mutex_rxtx); while (proc->instance_cnt_rxtx >= 0) pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx ); @@ -964,13 +964,13 @@ void *UE_thread(void *arg) { } } #endif + LOG_D(PHY,"Process subframe %d thread Idx %d \n", subframe_nr, UE->current_thread_id[subframe_nr]); thread_idx++; if(thread_idx>=RX_NB_TH) thread_idx = 0; - if (UE->mode != loop_through_memory) { for (i=0; iframe_parms.nb_antennas_rx; i++) rxp[i] = (void*)&UE->common_vars.rxdata[i][UE->frame_parms.ofdm_symbol_size+ @@ -1033,9 +1033,6 @@ void *UE_thread(void *arg) { if ( first_symbols <0 ) LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols); } - } //UE->mode != loop_through_memory - else - rt_sleep_ns(1000*1000); pickTime(gotIQs); // operate on thread sf mod 2 @@ -1047,13 +1044,13 @@ void *UE_thread(void *arg) { UE->proc.proc_rxtx[th_id].frame_rx++; } #ifdef SAIF_ENABLED - if (!(proc->frame_rx%4000)) - { - printf("frame_rx=%d rx_thread_busy=%ld - rate %8.3f\n", - proc->frame_rx, g_ue_rx_thread_busy, - (float)g_ue_rx_thread_busy/(proc->frame_rx*10+1)*100.0); - fflush(stdout); - } + if (!(proc->frame_rx%4000)) + { + printf("frame_rx=%d rx_thread_busy=%ld - rate %8.3f\n", + proc->frame_rx, g_ue_rx_thread_busy, + (float)g_ue_rx_thread_busy/(proc->frame_rx*10+1)*100.0); + fflush(stdout); + } #endif } //UE->proc.proc_rxtx[0].gotIQs=readTime(gotIQs); @@ -1071,7 +1068,7 @@ void *UE_thread(void *arg) { proc->frame_tx = (proc->frame_tx + 1)%MAX_FRAME_NUMBER; proc->nr_tti_tx %= NR_NUMBER_OF_SUBFRAMES_PER_FRAME; } - proc->subframe_tx=subframe_nr + DURATION_RX_TO_TX; + proc->subframe_tx=proc->nr_tti_rx; proc->timestamp_tx = timestamp+ (DURATION_RX_TO_TX*UE->frame_parms.samples_per_subframe)- UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0; @@ -1107,7 +1104,41 @@ void *UE_thread(void *arg) { // initStaticTime(lastTime); // updateTimes(lastTime, &t1, 20000, "Delay between two IQ acquisitions (case 1)"); // pickStaticTime(lastTime); + } //UE->mode != loop_through_memory + else { + proc->nr_tti_rx=subframe_nr; + proc->subframe_rx=subframe_nr; + if(subframe_nr == 0) { + for (th_id=0; th_id < RX_NB_TH; th_id++) { + UE->proc.proc_rxtx[th_id].frame_rx++; + } + } + proc->frame_tx = proc->frame_rx; + proc->nr_tti_tx= subframe_nr + DURATION_RX_TO_TX; + if (proc->nr_tti_tx > NR_NUMBER_OF_SUBFRAMES_PER_FRAME) { + proc->frame_tx = (proc->frame_tx + 1)%MAX_FRAME_NUMBER; + proc->nr_tti_tx %= NR_NUMBER_OF_SUBFRAMES_PER_FRAME; + } + proc->subframe_tx=proc->nr_tti_tx; + printf("Processing subframe %d\n",proc->subframe_rx); + + if(UE->if_inst != NULL && UE->if_inst->ul_indication != NULL){ + UE->ul_indication.module_id = 0; + UE->ul_indication.gNB_index = 0; + UE->ul_indication.cc_id = 0; + UE->ul_indication.slot = 0; // to be fill + UE->ul_indication.frame = 0; // to be fill + // [TODO] mapping right after NR initial sync + UE->ul_indication.frame = proc->frame_rx; + UE->ul_indication.slot = proc->nr_tti_rx; + + UE->if_inst->ul_indication(&UE->ul_indication); + } + + phy_procedures_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay); + getchar(); + } // else loop_through_memory } // start_rx_stream==1 } // UE->is_synchronized==1 From bf85f18008e512192842ca05a6cdf463cda4651d Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 7 Nov 2018 13:28:52 +0100 Subject: [PATCH 07/21] nr_pbchsim will exit when error rate <0.01 --- openair1/SIMULATION/NR_PHY/pbchsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 8de8a585c6..5652c5712a 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -571,7 +571,7 @@ int main(int argc, char **argv) printf("SNR %f : n_errors (negative CRC) = %d/%d\n", SNR,n_errors,n_trials); - if (n_trials==1) + if (n_trials==1 || ((float)n_errors/(float)n_trials < 0.01)) break; } // NSR From eb484b8039138de1b0048ab5b07674d50a6a26a7 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 7 Nov 2018 15:16:01 +0100 Subject: [PATCH 08/21] changing n_ssb_crb to n_rb_dl-20 re-centers the SSB and PDCCH and UE can decode PDCCH again --- openair1/PHY/INIT/nr_init.c | 4 +- openair1/PHY/INIT/nr_init_ue.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 2 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 8 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 87 ++++++++++--------- openair1/SIMULATION/NR_PHY/pbchsim.c | 3 +- 6 files changed, 54 insertions(+), 52 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index bce14e4f56..135d6099e0 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -384,7 +384,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu) gNB_config->rf_config.ul_carrier_bandwidth.value = N_RB_UL; gNB_config->sch_config.half_frame_index.value = 0; gNB_config->sch_config.ssb_subcarrier_offset.value = 0; - gNB_config->sch_config.n_ssb_crb.value = (N_RB_DL-20)>>1; + gNB_config->sch_config.n_ssb_crb.value = (N_RB_DL-20); gNB_config->sch_config.ssb_subcarrier_offset.value = 0; @@ -419,7 +419,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) gNB_config->rf_config.ul_carrier_bandwidth.value = phy_config->cfg->rf_config.ul_carrier_bandwidth.value;//106; gNB_config->sch_config.half_frame_index.value = 0; gNB_config->sch_config.ssb_subcarrier_offset.value = phy_config->cfg->sch_config.ssb_subcarrier_offset.value;//0; - gNB_config->sch_config.n_ssb_crb.value = (phy_config->cfg->rf_config.dl_carrier_bandwidth.value-20)>>1; + gNB_config->sch_config.n_ssb_crb.value = (phy_config->cfg->rf_config.dl_carrier_bandwidth.value-20); gNB_config->sch_config.physical_cell_id.value = phy_config->cfg->sch_config.physical_cell_id.value; if (phy_config->cfg->subframe_config.duplex_mode.value == 0) { diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 77faeaa0c2..a2385b998c 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -655,7 +655,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int i,j,k,l; int eNB_id; int th_id; - int n_ssb_crb=(fp->N_RB_DL-20)>>1; + int n_ssb_crb=(fp->N_RB_DL-20); abstraction_flag = 0; fp->nb_antennas_tx = 1; fp->nb_antennas_rx=1; diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 78f793ec17..b1a384d4a0 100755 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -49,7 +49,7 @@ //#define NR_LTE_PDCCH_DCI_SWITCH #define NR_PDCCH_DCI_RUN // activates new nr functions -//#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs +#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs #define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0) #define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0) #define PDCCH_TEST_POLAR_TEMP_FIX diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 1b31575615..80c71bd665 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -149,7 +149,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode) int rx_power=0; //aarx, //nfapi_nr_config_request_t* config; - int n_ssb_crb=(fp->N_RB_DL-20)>>1; + int n_ssb_crb=(fp->N_RB_DL-20); // First try TDD normal prefix, mu 1 fp->Ncp=NORMAL; fp->frame_type=TDD; @@ -213,12 +213,12 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode) nr_gold_pdcch(ue,0, 2); /* - int nb_prefix_samples0 = frame_parms->nb_prefix_samples0; - frame_parms->nb_prefix_samples0 = frame_parms->nb_prefix_samples. + int nb_prefix_samples0 = fp->nb_prefix_samples0; + fp->nb_prefix_samples0 = fp->nb_prefix_samples; nr_slot_fep(ue,0, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST); nr_slot_fep(ue,1, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST); - frame_parms->nb_prefix_samples0 = nb_prefix_samples0; + fp->nb_prefix_samples0 = nb_prefix_samples0; LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n", ue->Mod_id, diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 32beb92009..f3fa4ed55b 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -5922,11 +5922,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); nr_slot_fep(ue, - l, - nr_tti_rx, - 0, - 1, - 1, + l, + nr_tti_rx, + 0, + 0, + 1, NR_PDCCH_EST); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); #if UE_TIMING_TRACE @@ -5934,48 +5934,51 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN #endif } } - //ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode); - //if (do_pdcch_flag) { -// if ((l==pilot1) || ((pmch_flag==1)&(l==l2))) { -// LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id); + write_output("rxdataF.m","rxF",ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx>>1]].rxdataF[0],ue->frame_parms.ofdm_symbol_size*2,1,1); - //start_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]); + //ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode); + + //if (do_pdcch_flag) { + // if ((l==pilot1) || ((pmch_flag==1)&(l==l2))) { + // LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id); + + //start_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]); -//printf(">>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures init, dlsch->active=%d\n", -// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active); - if (nr_ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { - LOG_E(PHY,"[UE %d] Frame %d, nr_tti_rx %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,nr_tti_rx); - return(-1); - } -//for (int m=0;m<1000;m++) printf("%d",m); -//printf("\n>>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures end, dlsch->active=%d\n", -// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active); - + //printf(">>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures init, dlsch->active=%d\n", + // ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active); + if (nr_ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { + LOG_E(PHY,"[UE %d] Frame %d, nr_tti_rx %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,nr_tti_rx); + return(-1); + } + //for (int m=0;m<1000;m++) printf("%d",m); + //printf("\n>>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures end, dlsch->active=%d\n", + // ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active); + // preparing for PDSCH procedures -// if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) { -// ue_pdsch_procedures(ue, -// proc, -// eNB_id, -// PDSCH, -// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0], -// NULL, -// ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols, -// ue->frame_parms.symbols_per_tti>>1, -// abstraction_flag); -// } + // if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) { + // ue_pdsch_procedures(ue, + // proc, + // eNB_id, + // PDSCH, + // ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0], + // NULL, + // ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols, + // ue->frame_parms.symbols_per_tti>>1, + // abstraction_flag); + // } #if 0 - //stop_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]); - //printf("nr_tti_rx %d n_pdcch_sym %d pdcch procedures %5.3f \n", - // nr_tti_rx, ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols, - // (ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]].p_time)/(cpuf*1000.0)); - LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols); -// } - //} - -// } // for l=1..l2 - - + //stop_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]); + //printf("nr_tti_rx %d n_pdcch_sym %d pdcch procedures %5.3f \n", + // nr_tti_rx, ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols, + // (ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]].p_time)/(cpuf*1000.0)); + LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols); + // } + //} + + // } // for l=1..l2 + + ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode); LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx); diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 8de8a585c6..f1ec263284 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -442,11 +442,10 @@ int main(int argc, char **argv) for (int i=0;i<4;i++) gNB->pbch_pdu[i]=i+1; nr_common_signal_procedures (gNB,frame,subframe); - /* LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1); if (gNB->frame_parms.nb_antennas_tx>1) LOG_M("txsigF1.m","txsF1", gNB->common_vars.txdataF[1],frame_length_complex_samples_no_prefix,1,1); - */ + //TODO: loop over slots for (aa=0; aaframe_parms.nb_antennas_tx; aa++) { if (gNB_config->subframe_config.dl_cyclic_prefix_type.value == 1) { From 8273680d7dcf424d785a00211d776b1efb493432 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Wed, 7 Nov 2018 17:40:08 +0100 Subject: [PATCH 09/21] bug fix for initialization --- openair2/GNB_APP/gnb_config.c | 3 --- targets/RT/USER/nr-gnb.c | 28 ++++++++++++++-------------- targets/RT/USER/nr-ru.c | 17 ++++++++--------- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 7270ce9258..e9cc6df079 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -3004,10 +3004,7 @@ int RCconfig_nr_parallel(void) { } if(parallel_config == NULL) set_parallel_conf(parallel_conf); -if(parallel_config == NULL)printf("~~~~~~~~~~~~~~~~~~~~parallel_conf = %s\n",parallel_conf); - if(worker_config == NULL) set_worker_conf(worker_conf); -if(worker_config == NULL)printf("~~~~~~~~~~~~~~~~~~~~worker_conf = %s\n",worker_conf); return 0; } diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index 58e9be4a9e..d5ea712ad9 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -287,15 +287,15 @@ static inline int rxtx(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc, char *thread_ static void* gNB_L1_thread_tx(void* param) { - gNB_L1_proc_t *gNB_proc = (gNB_L1_proc_t*)param; + PHY_VARS_gNB *gNB = (PHY_VARS_gNB*)param; + gNB_L1_proc_t *gNB_proc = &gNB->proc; gNB_L1_rxtx_proc_t *proc = &gNB_proc->L1_proc_tx; - PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; + //PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; -printf("~~~~~~~~~~~~~~~~~~~~gNB_L1_thread_tx is created\n"); char thread_name[100]; sprintf(thread_name,"TXnp4_%d\n",&gNB->proc.L1_proc == proc ? 0 : 1); - thread_top_init(thread_name,1,470000,500000,500000); + //thread_top_init(thread_name,1,470000,500000,500000); //wait_sync("tx_thread"); @@ -341,21 +341,22 @@ printf("~~~~~~~~~~~~~~~~~~~~gNB_L1_thread_tx is created\n"); static void* gNB_L1_thread( void* param ) { static int gNB_thread_rxtx_status; - gNB_L1_proc_t *gNB_proc = (gNB_L1_proc_t*)param; + PHY_VARS_gNB *gNB = (PHY_VARS_gNB*)param; + gNB_L1_proc_t *gNB_proc = &gNB->proc; gNB_L1_rxtx_proc_t *proc = &gNB_proc->L1_proc; - PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; + //PHY_VARS_gNB *gNB = RC.gNB[0][proc->CC_id]; -printf("~~~~~~~~~~~~~~~~~~~~gNB_L1_thread_tx is created\n"); char thread_name[100]; + // set default return value gNB_thread_rxtx_status = 0; sprintf(thread_name,"RXn_TXnp4_%d",&gNB->proc.L1_proc == proc ? 0 : 1); - thread_top_init(thread_name,1,850000L,1000000L,2000000L); + //thread_top_init(thread_name,1,850000L,1000000L,2000000L); while (!oai_exit) { @@ -454,7 +455,7 @@ int wakeup_txfh(gNB_L1_rxtx_proc_t *proc,PHY_VARS_gNB *gNB) { struct timespec wait; wait.tv_sec=0; wait.tv_nsec=5000000L; -//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); +printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); if(wait_on_condition(&proc->mutex_RUs,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) { LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx); @@ -607,6 +608,8 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; +printf("~~~~~~~~~~~~~~~~~~~~~~passing parameter IC = %d, RX: %d.%d, TX: %d.%d to L1 sf_ahead = %d\n", L1_proc->instance_cnt, L1_proc->frame_rx, L1_proc->subframe_rx, L1_proc->frame_tx, L1_proc->subframe_tx, sf_ahead); + // the thread can now be woken up if (pthread_cond_signal(&L1_proc->cond) != 0) { LOG_E( PHY, "[gNB] ERROR pthread_cond_signal for gNB RXn-TXnp4 thread\n"); @@ -785,11 +788,9 @@ void init_gNB_proc(int inst) { LOG_I(PHY,"gNB->single_thread_flag:%d\n", gNB->single_thread_flag); -printf("~~~~~~~~~~~~~~~~~~~thread_parallel = %d",get_thread_parallel_conf()); if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) { -printf("~~~~~~~~~~~~~~~~~~~~~~~creating gNB_L1_thread and gNB_L1_thread_tx \n"); - pthread_create( &L1_proc->pthread, attr0, gNB_L1_thread, proc ); - pthread_create( &L1_proc_tx->pthread, attr1, gNB_L1_thread_tx, proc); + pthread_create( &L1_proc->pthread, attr0, gNB_L1_thread, gNB ); + pthread_create( &L1_proc_tx->pthread, attr1, gNB_L1_thread_tx, gNB); } //pthread_create( &proc->pthread_prach, attr_prach, gNB_thread_prach, gNB ); @@ -1064,7 +1065,6 @@ void init_eNB_afterRU(void) { //init_transport(gNB); //init_precoding_weights(RC.gNB[inst][CC_id]); } -printf("~~~~~~~~~~~~~~~~~~~~~~~start init gNB proc\n"); init_gNB_proc(inst); } diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index f4481dcbf6..83843a03c6 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -1141,7 +1141,7 @@ void wakeup_gNB_L1s(RU_t *ru) { LOG_D(PHY,"wakeup_gNB_L1s (num %d) for RU %d ru->gNB_top:%p\n",ru->num_gNB,ru->idx, ru->gNB_top); - if (ru->num_gNB==1 && ru->gNB_top!=0) { + if (ru->num_gNB==1 && ru->gNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) { // call gNB function directly char string[20]; @@ -1156,7 +1156,6 @@ void wakeup_gNB_L1s(RU_t *ru) { for (i=0;inum_gNB;i++) { LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->nr_wakeup_rxtx); - if (ru->nr_wakeup_rxtx!=0 && ru->nr_wakeup_rxtx(gNB_list[i],ru) < 0) { LOG_E(PHY,"could not wakeup gNB rxtx process for subframe %d\n", ru->proc.subframe_rx); @@ -1429,7 +1428,7 @@ static void* ru_thread_tx( void* param ) { } else { - /*if(proc->frame_tx == print_frame) + if(proc->frame_tx == print_frame) { for (i=0; inb_tx; i++) { @@ -1453,7 +1452,7 @@ static void* ru_thread_tx( void* param ) { } }//if(proc->subframe_tx == 9) }//for (i=0; inb_tx; i++) - }//if(proc->frame_tx == print_frame)*/ + }//if(proc->frame_tx == print_frame) }//else emulate_rf release_thread(&proc->mutex_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx"); for(i = 0; inum_gNB; i++) @@ -1554,11 +1553,6 @@ static void* ru_thread( void* param ) { RC.ru_mask &= ~(1<idx); pthread_cond_signal(&RC.ru_cond); pthread_mutex_unlock(&RC.ru_mutex); - - pthread_mutex_lock(&proc->mutex_FH1); - proc->instance_cnt_FH1 = 0; - pthread_mutex_unlock(&proc->mutex_FH1); - pthread_cond_signal(&proc->cond_FH1); wait_sync("ru_thread"); @@ -1587,6 +1581,10 @@ static void* ru_thread( void* param ) { if ((ru->is_slave) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru); } + pthread_mutex_lock(&proc->mutex_FH1); + proc->instance_cnt_FH1 = 0; + pthread_mutex_unlock(&proc->mutex_FH1); + pthread_cond_signal(&proc->cond_FH1); // This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices while (!oai_exit) { @@ -1830,6 +1828,7 @@ void init_RU_proc(RU_t *ru) { proc->instance_cnt_synch = -1; ; proc->instance_cnt_FH = -1; proc->instance_cnt_FH1 = -1; + proc->instance_cnt_gNBs = -1; proc->instance_cnt_asynch_rxtx = -1; proc->instance_cnt_emulateRF = -1; proc->first_rx = 1; From 44fe00d018386ec681367ee6d08f993606ae7df4 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 7 Nov 2018 17:57:01 +0100 Subject: [PATCH 10/21] CI: unified VM scripting for option management Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 48 +- ci-scripts/buildOnVM.sh | 517 +++--------- ci-scripts/createVM.sh | 188 +---- ci-scripts/destroyAllRunningVM.sh | 82 +- ci-scripts/oai-ci-vm-tool | 573 ++++++++++++++ ci-scripts/reportBuildLocally.sh | 591 ++++++-------- ci-scripts/reportTestLocally.sh | 820 ++++++++----------- ci-scripts/runTestOnVM.sh | 1220 +++++++++++++---------------- ci-scripts/waitBuildOnVM.sh | 456 +++-------- 9 files changed, 1972 insertions(+), 2523 deletions(-) create mode 100755 ci-scripts/oai-ci-vm-tool diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index e02f071c2f..f170aa081f 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -118,7 +118,7 @@ pipeline { stage ("Start VM -- basic-sim") { steps { timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" + sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } } } @@ -126,7 +126,7 @@ pipeline { stage ("Start VM -- gnb-usrp") { steps { timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" + sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } } } @@ -134,7 +134,7 @@ pipeline { stage ("Start VM -- nu-ue-usrp") { steps { timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" + sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } } } @@ -142,7 +142,7 @@ pipeline { stage ("Start VM -- enb-usrp") { steps { timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" + sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } } } @@ -150,7 +150,7 @@ pipeline { stage ("Start VM -- enb-ethernet") { steps { timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" + sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } } } @@ -158,7 +158,7 @@ pipeline { stage ("Start VM -- ue-ethernet") { steps { timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" + sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } } } @@ -166,7 +166,7 @@ pipeline { stage ("Start VM -- phy-sim") { steps { timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" + sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } } } @@ -174,7 +174,7 @@ pipeline { stage ("Start VM -- cppcheck") { steps { timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" + sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" } } } @@ -185,7 +185,7 @@ pipeline { steps { gitlabCommitStatus(name: "Analysis with cppcheck") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/waitBuildOnVM.sh --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } } @@ -194,7 +194,7 @@ pipeline { steps { gitlabCommitStatus(name: "Build eNb-USRP") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/waitBuildOnVM.sh --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } } @@ -203,7 +203,7 @@ pipeline { steps { gitlabCommitStatus(name: "Build basic-sim") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/waitBuildOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" } } } @@ -212,7 +212,7 @@ pipeline { steps { gitlabCommitStatus(name: "Build eNb-ethernet") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/waitBuildOnVM.sh --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" } } } @@ -221,7 +221,7 @@ pipeline { steps { gitlabCommitStatus(name: "Build UE-ethernet") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/waitBuildOnVM.sh --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" } } } @@ -230,7 +230,7 @@ pipeline { steps { gitlabCommitStatus(name: "Build gNb-usrp") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/waitBuildOnVM.sh --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } } @@ -239,7 +239,7 @@ pipeline { steps { gitlabCommitStatus(name: "Build nr-UE-usrp") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/waitBuildOnVM.sh --workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } } @@ -248,7 +248,7 @@ pipeline { steps { gitlabCommitStatus(name: "Build phy-sim") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/waitBuildOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" } } } @@ -286,7 +286,7 @@ pipeline { archiveArtifacts artifacts: 'archives/vm_build_logs.zip' } if ("MERGE".equals(env.gitlabActionType)) { - sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" + sh "./ci-scripts/oai-ci-vm-tool report-build --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" sh "./ci-scripts/checkAddedWarnings.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}" def res=readFile('./oai_warning_files.txt').trim(); if ("0".equals(res)) { @@ -297,7 +297,7 @@ pipeline { addGitLabMRComment comment: message } } else { - sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}" + sh "./ci-scripts/oai-ci-vm-tool report-build --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}" } if(fileExists('build_results.html')) { sh "sed -i -e 's#Build-ID: ${BUILD_ID}#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' build_results.html" @@ -314,7 +314,7 @@ pipeline { steps { gitlabCommitStatus(name: "Test phy-sim") { timeout (time: 45, unit: 'MINUTES') { - sh "./ci-scripts/runTestOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } } @@ -323,7 +323,7 @@ pipeline { steps { gitlabCommitStatus(name: "Test basic-sim") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/runTestOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" + sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } } @@ -518,9 +518,9 @@ pipeline { if(fileExists('archives/vm_tests_logs.zip')) { archiveArtifacts artifacts: 'archives/vm_tests_logs.zip' if ("MERGE".equals(env.gitlabActionType)) { - sh "./ci-scripts/reportTestLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" + sh "./ci-scripts/oai-ci-vm-tool report-test --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" } else { - sh "./ci-scripts/reportTestLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}" + sh "./ci-scripts/oai-ci-vm-tool report-test --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}" } if(fileExists('test_simulator_results.html')) { sh "sed -i -e 's#Build-ID: ${BUILD_ID}#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_simulator_results.html" @@ -533,7 +533,7 @@ pipeline { } stage ("Destroy all Virtual Machines") { steps { - sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } } } @@ -541,7 +541,7 @@ pipeline { always { script { // Stage destroy may not be run if error in previous stage - sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" emailext attachmentsPattern: '*results*.html', body: '''Hi, Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS! diff --git a/ci-scripts/buildOnVM.sh b/ci-scripts/buildOnVM.sh index 456d874154..aed449f180 100755 --- a/ci-scripts/buildOnVM.sh +++ b/ci-scripts/buildOnVM.sh @@ -20,8 +20,8 @@ # * contact@openairinterface.org # */ -function usage { - echo "OAI VM Build Check script" +function build_usage { + echo "OAI CI VM script" echo " Original Author: Raphael Defosseux" echo " Requirements:" echo " -- uvtool uvtool-libvirt apt-cacher" @@ -31,9 +31,9 @@ function usage { echo "" echo "Usage:" echo "------" - echo " buildOnVM.sh [OPTIONS]" + echo " oai-ci-vm-tool build [OPTIONS]" echo "" - echo "Options:" + echo "Mandatory Options:" echo "--------" echo " --job-name #### OR -jn ####" echo " Specify the name of the Jenkins job." @@ -44,14 +44,9 @@ function usage { echo " --workspace #### OR -ws ####" echo " Specify the workspace." echo "" - echo " --variant enb-usrp OR -v1" - echo " --variant basic-sim OR -v2" - echo " --variant phy-sim OR -v3" - echo " --variant cppcheck OR -v4" - echo " --variant gnb-usrp OR -v5" - echo " --variant nu-ue-usrp OR -v6" - echo " --variant enb-ethernet OR -v7" - echo " --variant ue-ethernet OR -v8" + echo "Options:" + echo "--------" + variant_usage echo " Specify the variant to build." echo "" echo " --keep-vm-alive OR -k" @@ -65,414 +60,120 @@ function usage { echo "" } -function variant_usage { - echo "OAI VM Build Check script" - echo " Original Author: Raphael Defosseux" - echo "" - echo " --variant enb-usrp OR -v1" - echo " --variant basic-sim OR -v2" - echo " --variant phy-sim OR -v3" - echo " --variant cppcheck OR -v4" - echo " --variant gnb-usrp OR -v5" - echo " --variant nu-ue-usrp OR -v6" - echo " --variant enb-ethernet OR -v7" - echo " --variant ue-ethernet OR -v8" - echo "" -} - -if [ $# -lt 1 ] || [ $# -gt 9 ] -then - echo "Syntax Error: not the correct number of arguments" - echo "" - usage - exit 1 -fi - -VM_TEMPLATE=ci- -JOB_NAME=XX -BUILD_ID=XX -VM_NAME=ci-enb-usrp -VM_MEMORY=2048 -VM_CPU=4 -ARCHIVES_LOC=enb_usrp -LOG_PATTERN=.Rel15.txt -NB_PATTERN_FILES=4 -BUILD_OPTIONS="--eNB -w USRP" -KEEP_VM_ALIVE=0 -DAEMON=0 - -while [[ $# -gt 0 ]] -do -key="$1" - -case $key in - -h|--help) - shift - usage - exit 0 - ;; - -jn|--job-name) - JOB_NAME="$2" - shift - shift - ;; - -id|--build-id) - BUILD_ID="$2" - shift - shift - ;; - -ws|--workspace) - JENKINS_WKSP="$2" - shift - shift - ;; - -k|--keep-vm-alive) - KEEP_VM_ALIVE=1 - shift - ;; - -D|--daemon) - DAEMON=1 - shift - ;; - -v1) - VM_NAME=ci-enb-usrp - ARCHIVES_LOC=enb_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--eNB -w USRP --mu" - shift - ;; - -v2) - VM_NAME=ci-basic-sim - ARCHIVES_LOC=basic_sim - LOG_PATTERN=basic_simulator - NB_PATTERN_FILES=2 - BUILD_OPTIONS="--basic-simulator" - VM_MEMORY=8192 - VM_CPU=4 - shift - ;; - -v3) - VM_NAME=ci-phy-sim - ARCHIVES_LOC=phy_sim - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--phy_simulators" - shift - ;; - -v4) - VM_NAME=ci-cppcheck - VM_MEMORY=8192 - ARCHIVES_LOC=cppcheck - LOG_PATTERN=cppcheck.xml - NB_PATTERN_FILES=1 - BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c" - shift - ;; - -v5) - VM_NAME=ci-gnb-usrp - ARCHIVES_LOC=gnb_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--gNB -w USRP" - shift - ;; - -v6) - VM_NAME=ci-ue-nr-usrp - ARCHIVES_LOC=nrue_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--nrUE -w USRP" - shift - ;; - -v7) - VM_NAME=ci-enb-ethernet - ARCHIVES_LOC=enb_eth - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET --noS1" - shift - ;; - -v8) - VM_NAME=ci-ue-ethernet - ARCHIVES_LOC=ue_eth - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--UE -t ETHERNET --noS1" - shift - ;; - --variant) - variant="$2" - case $variant in - enb-usrp) - VM_NAME=ci-enb-usrp - ARCHIVES_LOC=enb_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--eNB -w USRP --mu" - ;; - basic-sim) - VM_NAME=ci-basic-sim - ARCHIVES_LOC=basic_sim - LOG_PATTERN=basic_simulator - NB_PATTERN_FILES=2 - BUILD_OPTIONS="--basic-simulator" - VM_MEMORY=8192 - VM_CPU=4 - ;; - phy-sim) - VM_NAME=ci-phy-sim - ARCHIVES_LOC=phy_sim - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--phy_simulators" - ;; - cppcheck) - VM_NAME=ci-cppcheck - VM_MEMORY=8192 - ARCHIVES_LOC=cppcheck - LOG_PATTERN=cppcheck.xml - NB_PATTERN_FILES=1 - BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c" - ;; - gnb-usrp) - VM_NAME=ci-gnb-usrp - ARCHIVES_LOC=gnb_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--gNB -w USRP" - ;; - nu-ue-usrp) - VM_NAME=ci-ue-nr-usrp - ARCHIVES_LOC=nrue_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--nrUE -w USRP" - ;; - enb-ethernet) - VM_NAME=ci-enb-ethernet - ARCHIVES_LOC=enb_eth - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET --noS1" - ;; - ue-ethernet) - VM_NAME=ci-ue-ethernet - ARCHIVES_LOC=ue_eth - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--UE -t ETHERNET --noS1" - ;; - *) - echo "" - echo "Syntax Error: Invalid Variant option -> $variant" - echo "" - variant_usage - exit 1 - esac - shift - shift - ;; - *) - echo "Syntax Error: unknown option: $key" - echo "" - usage - exit 1 -esac -done - -if [ ! -f $JENKINS_WKSP/localZip.zip ] -then - echo "Missing localZip.zip file!" - exit 1 -fi -if [ ! -f /etc/apt/apt.conf.d/01proxy ] -then - echo "Missing /etc/apt/apt.conf.d/01proxy file!" - echo "Is apt-cacher installed and configured?" - exit 1 -fi - -if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] -then - VM_TEMPLATE=ci- -else - VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}- -fi - -VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"` -VM_CMDS=${VM_NAME}_cmds.txt -ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC} - -echo "VM_NAME = $VM_NAME" -echo "VM_CMD_FILE = $VM_CMDS" -echo "JENKINS_WKSP = $JENKINS_WKSP" -echo "ARCHIVES_LOC = $ARCHIVES_LOC" -echo "BUILD_OPTIONS = $BUILD_OPTIONS" - -IS_VM_ALIVE=`uvt-kvm list | grep -c $VM_NAME` - -if [ $IS_VM_ALIVE -eq 0 ] -then - echo "############################################################" - echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" - echo "############################################################" - uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml -fi - -echo "Waiting for VM to be started" -uvt-kvm wait $VM_NAME --insecure - -VM_IP_ADDR=`uvt-kvm ip $VM_NAME` -echo "$VM_NAME has for IP addr = $VM_IP_ADDR" - -echo "############################################################" -echo "Copying GIT repo into VM ($VM_NAME)" -echo "############################################################" -scp -o StrictHostKeyChecking=no localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu -scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu - -echo "############################################################" -echo "Running install and build script on VM ($VM_NAME)" -echo "############################################################" -echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS -echo "touch /home/ubuntu/.hushlogin" >> $VM_CMDS -if [[ "$VM_NAME" == *"-cppcheck"* ]] -then - if [ $DAEMON -eq 0 ] +function build_on_vm { + if [ ! -f $JENKINS_WKSP/localZip.zip ] then - echo "echo \"sudo apt-get --yes --quiet install zip cppcheck \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS - else - echo "echo \"sudo apt-get --yes --quiet install zip daemon cppcheck \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install zip daemon cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS + echo "Missing localZip.zip file!" + STATUS=1 + return fi -else - if [ $DAEMON -eq 0 ] + if [ ! -f /etc/apt/apt.conf.d/01proxy ] then - echo "echo \"sudo apt-get --yes --quiet install zip subversion libboost-dev \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install zip subversion libboost-dev >> zip-install.txt 2>&1" >> $VM_CMDS - else - echo "echo \"sudo apt-get --yes --quiet install zip daemon subversion libboost-dev \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install zip daemon subversion libboost-dev >> zip-install.txt 2>&1" >> $VM_CMDS + echo "Missing /etc/apt/apt.conf.d/01proxy file!" + echo "Is apt-cacher installed and configured?" + STATUS=1 + return fi -fi -echo "mkdir tmp" >> $VM_CMDS -echo "cd tmp" >> $VM_CMDS -echo "echo \"unzip -qq -DD ../localZip.zip\"" >> $VM_CMDS -echo "unzip -qq -DD ../localZip.zip" >> $VM_CMDS -if [[ "$VM_NAME" == *"-cppcheck"* ]] -then - echo "mkdir cmake_targets/log" >> $VM_CMDS - echo "chmod 777 cmake_targets/log" >> $VM_CMDS - echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS - echo "echo \"cppcheck $BUILD_OPTIONS . \"" >> $VM_CMDS - if [ $DAEMON -eq 0 ] - then - echo "cppcheck $BUILD_OPTIONS . 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt" >> $VM_CMDS - else - echo "echo \"cppcheck $BUILD_OPTIONS .\" > ./my-vm-build.sh" >> $VM_CMDS - echo "chmod 775 ./my-vm-build.sh " >> $VM_CMDS - echo "sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp -O /home/ubuntu/tmp/cmake_targets/log/cppcheck_build.txt -E /home/ubuntu/tmp/cmake_targets/log/cppcheck.xml ./my-vm-build.sh" >> $VM_CMDS - fi -else - echo "echo \"source oaienv\"" >> $VM_CMDS - echo "source oaienv" >> $VM_CMDS - echo "cd cmake_targets/" >> $VM_CMDS - echo "mkdir log" >> $VM_CMDS - echo "chmod 777 log" >> $VM_CMDS - echo "cp /home/ubuntu/zip-install.txt log" >> $VM_CMDS - if [ $DAEMON -eq 0 ] - then - echo "echo \"./build_oai -I $BUILD_OPTIONS \"" >> $VM_CMDS - echo "./build_oai -I $BUILD_OPTIONS > log/install-build.txt 2>&1" >> $VM_CMDS - else - echo "echo \"./build_oai -I $BUILD_OPTIONS\" > ./my-vm-build.sh" >> $VM_CMDS - echo "chmod 775 ./my-vm-build.sh " >> $VM_CMDS - echo "echo \"sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh\"" >> $VM_CMDS - echo "sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh" >> $VM_CMDS - fi -fi -ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS -if [ $DAEMON -eq 1 ] -then - rm -f $VM_CMDS - echo "STATUS is OK" - exit 0 -fi -echo "############################################################" -echo "Creating a tmp folder to store results and artifacts" -echo "############################################################" -if [ ! -d $JENKINS_WKSP/archives ] -then - mkdir $JENKINS_WKSP/archives -fi - -if [ ! -d $ARCHIVES_LOC ] -then - mkdir $ARCHIVES_LOC -fi - -scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.txt $ARCHIVES_LOC -if [[ "$VM_NAME" == *"-cppcheck"* ]] -then - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.xml $ARCHIVES_LOC -fi - -if [ $KEEP_VM_ALIVE -eq 0 ] -then echo "############################################################" - echo "Destroying VM" + echo "OAI CI VM script" echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR -fi -rm -f $VM_CMDS -echo "############################################################" -echo "Checking build status" -echo "############################################################" + echo "VM_NAME = $VM_NAME" + echo "VM_CMD_FILE = $VM_CMDS" + echo "JENKINS_WKSP = $JENKINS_WKSP" + echo "ARCHIVES_LOC = $ARCHIVES_LOC" + echo "BUILD_OPTIONS = $BUILD_OPTIONS" -LOG_FILES=`ls $ARCHIVES_LOC/*.txt $ARCHIVES_LOC/*.xml` -STATUS=0 -NB_FOUND_FILES=0 + IS_VM_ALIVE=`uvt-kvm list | grep -c $VM_NAME` -for FULLFILE in $LOG_FILES -do - if [[ $FULLFILE == *"$LOG_PATTERN"* ]] + if [ $IS_VM_ALIVE -eq 0 ] then - filename=$(basename -- "$FULLFILE") - if [ "$LOG_PATTERN" == ".Rel15.txt" ] + echo "VM_MEMORY = $VM_MEMORY MBytes" + echo "VM_CPU = $VM_CPU" + echo "############################################################" + echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" + echo "############################################################" + uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml + fi + + echo "Waiting for VM to be started" + uvt-kvm wait $VM_NAME --insecure + + VM_IP_ADDR=`uvt-kvm ip $VM_NAME` + echo "$VM_NAME has for IP addr = $VM_IP_ADDR" + + echo "############################################################" + echo "Copying GIT repo into VM ($VM_NAME)" + echo "############################################################" + scp -o StrictHostKeyChecking=no $JENKINS_WKSP/localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu + scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu + + echo "############################################################" + echo "Running install and build script on VM ($VM_NAME)" + echo "############################################################" + echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS + echo "touch /home/ubuntu/.hushlogin" >> $VM_CMDS + if [[ "$VM_NAME" == *"-cppcheck"* ]] + then + if [ $DAEMON -eq 0 ] then - PASS_PATTERN=`echo $filename | sed -e "s#$LOG_PATTERN##"` - fi - if [ "$LOG_PATTERN" == "basic_simulator" ] - then - PASS_PATTERN="lte-" - fi - if [ "$LOG_PATTERN" == "cppcheck.xml" ] - then - PASS_PATTERN="results version" - LOCAL_STAT=`egrep -c "$PASS_PATTERN" $FULLFILE` + echo "echo \"sudo apt-get --yes --quiet install zip cppcheck \"" >> $VM_CMDS + echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS + echo "sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS else - LOCAL_STAT=`egrep -c "Built target $PASS_PATTERN" $FULLFILE` + echo "echo \"sudo apt-get --yes --quiet install zip daemon cppcheck \"" >> $VM_CMDS + echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS + echo "sudo apt-get --yes install zip daemon cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS + fi + else + if [ $DAEMON -eq 0 ] + then + echo "echo \"sudo apt-get --yes --quiet install zip subversion libboost-dev \"" >> $VM_CMDS + echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS + echo "sudo apt-get --yes install zip subversion libboost-dev >> zip-install.txt 2>&1" >> $VM_CMDS + else + echo "echo \"sudo apt-get --yes --quiet install zip daemon subversion libboost-dev \"" >> $VM_CMDS + echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS + echo "sudo apt-get --yes install zip daemon subversion libboost-dev >> zip-install.txt 2>&1" >> $VM_CMDS fi - if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi - NB_FOUND_FILES=$((NB_FOUND_FILES + 1)) fi -done - -if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi - -if [ $STATUS -eq 0 ] -then - echo "STATUS seems OK" -else - echo "STATUS failed?" -fi -exit $STATUS + echo "mkdir tmp" >> $VM_CMDS + echo "cd tmp" >> $VM_CMDS + echo "echo \"unzip -qq -DD ../localZip.zip\"" >> $VM_CMDS + echo "unzip -qq -DD ../localZip.zip" >> $VM_CMDS + if [[ "$VM_NAME" == *"-cppcheck"* ]] + then + echo "mkdir cmake_targets/log" >> $VM_CMDS + echo "chmod 777 cmake_targets/log" >> $VM_CMDS + echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS + echo "echo \"cppcheck $BUILD_OPTIONS . \"" >> $VM_CMDS + if [ $DAEMON -eq 0 ] + then + echo "cppcheck $BUILD_OPTIONS . 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt" >> $VM_CMDS + else + echo "echo \"cppcheck $BUILD_OPTIONS .\" > ./my-vm-build.sh" >> $VM_CMDS + echo "chmod 775 ./my-vm-build.sh " >> $VM_CMDS + echo "sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp -O /home/ubuntu/tmp/cmake_targets/log/cppcheck_build.txt -E /home/ubuntu/tmp/cmake_targets/log/cppcheck.xml ./my-vm-build.sh" >> $VM_CMDS + fi + else + echo "echo \"source oaienv\"" >> $VM_CMDS + echo "source oaienv" >> $VM_CMDS + echo "cd cmake_targets/" >> $VM_CMDS + echo "mkdir log" >> $VM_CMDS + echo "chmod 777 log" >> $VM_CMDS + echo "cp /home/ubuntu/zip-install.txt log" >> $VM_CMDS + if [ $DAEMON -eq 0 ] + then + echo "echo \"./build_oai -I $BUILD_OPTIONS \"" >> $VM_CMDS + echo "./build_oai -I $BUILD_OPTIONS > log/install-build.txt 2>&1" >> $VM_CMDS + else + echo "echo \"./build_oai -I $BUILD_OPTIONS\" > ./my-vm-build.sh" >> $VM_CMDS + echo "chmod 775 ./my-vm-build.sh " >> $VM_CMDS + echo "echo \"sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh\"" >> $VM_CMDS + echo "sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh" >> $VM_CMDS + fi + fi + ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS + rm -f $VM_CMDS +} diff --git a/ci-scripts/createVM.sh b/ci-scripts/createVM.sh index 682d485e21..192008d867 100755 --- a/ci-scripts/createVM.sh +++ b/ci-scripts/createVM.sh @@ -20,8 +20,8 @@ # * contact@openairinterface.org # */ -function usage { - echo "OAI VM Creation script" +function create_usage { + echo "OAI CI VM script" echo " Original Author: Raphael Defosseux" echo " Requirements:" echo " -- uvtool uvtool-libvirt apt-cacher" @@ -31,9 +31,9 @@ function usage { echo "" echo "Usage:" echo "------" - echo " createVM.sh [OPTIONS]" + echo " oai-ci-vm-tool create [OPTIONS]" echo "" - echo "Options:" + echo "Mandatory Options:" echo "--------" echo " --job-name #### OR -jn ####" echo " Specify the name of the Jenkins job." @@ -41,14 +41,7 @@ function usage { echo " --build-id #### OR -id ####" echo " Specify the build ID of the Jenkins job." echo "" - echo " --variant enb-usrp OR -v1" - echo " --variant basic-sim OR -v2" - echo " --variant phy-sim OR -v3" - echo " --variant cppcheck OR -v4" - echo " --variant gnb-usrp OR -v5" - echo " --variant nu-ue-usrp OR -v6" - echo " --variant enb-ethernet OR -v7" - echo " --variant ue-ethernet OR -v8" + variant_usage echo " Specify the variant to build." echo "" echo " --help OR -h" @@ -56,158 +49,21 @@ function usage { echo "" } -function variant_usage { - echo "OAI VM Build Check script" - echo " Original Author: Raphael Defosseux" - echo "" - echo " --variant enb-usrp OR -v1" - echo " --variant basic-sim OR -v2" - echo " --variant phy-sim OR -v3" - echo " --variant cppcheck OR -v4" - echo " --variant gnb-usrp OR -v5" - echo " --variant nu-ue-usrp OR -v6" - echo " --variant enb-ethernet OR -v7" - echo " --variant ue-ethernet OR -v8" - echo "" +function create_vm { + echo "############################################################" + echo "OAI CI VM script" + echo "############################################################" + echo "VM_NAME = $VM_NAME" + echo "VM_MEMORY = $VM_MEMORY MBytes" + echo "VM_CPU = $VM_CPU" + + echo "############################################################" + echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" + echo "############################################################" + uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml + echo "Waiting for VM to be started" + uvt-kvm wait $VM_NAME --insecure + + VM_IP_ADDR=`uvt-kvm ip $VM_NAME` + echo "$VM_NAME has for IP addr = $VM_IP_ADDR" } - -if [ $# -lt 1 ] || [ $# -gt 6 ] -then - echo "Syntax Error: not the correct number of arguments" - echo "" - usage - exit 1 -fi - -VM_TEMPLATE=ci- -JOB_NAME=XX -BUILD_ID=XX -VM_NAME=ci-enb-usrp -VM_MEMORY=2048 -VM_CPU=4 - -while [[ $# -gt 0 ]] -do -key="$1" - -case $key in - -h|--help) - shift - usage - exit 0 - ;; - -jn|--job-name) - JOB_NAME="$2" - shift - shift - ;; - -id|--build-id) - BUILD_ID="$2" - shift - shift - ;; - -v1) - VM_NAME=ci-enb-usrp - shift - ;; - -v2) - VM_NAME=ci-basic-sim - VM_MEMORY=8192 - shift - ;; - -v3) - VM_NAME=ci-phy-sim - shift - ;; - -v4) - VM_NAME=ci-cppcheck - VM_MEMORY=8192 - shift - ;; - -v5) - VM_NAME=ci-gnb-usrp - shift - ;; - -v6) - VM_NAME=ci-ue-nr-usrp - shift - ;; - -v7) - VM_NAME=ci-enb-ethernet - shift - ;; - -v8) - VM_NAME=ci-ue-ethernet - shift - ;; - --variant) - variant="$2" - case $variant in - enb-usrp) - VM_NAME=ci-enb-usrp - ;; - basic-sim) - VM_NAME=ci-basic-sim - VM_MEMORY=8192 - ;; - phy-sim) - VM_NAME=ci-phy-sim - ;; - cppcheck) - VM_NAME=ci-cppcheck - VM_MEMORY=8192 - ;; - gnb-usrp) - VM_NAME=ci-gnb-usrp - ;; - nu-ue-usrp) - VM_NAME=ci-ue-nr-usrp - ;; - enb-ethernet) - VM_NAME=ci-enb-ethernet - ;; - ue-ethernet) - VM_NAME=ci-ue-ethernet - ;; - *) - echo "" - echo "Syntax Error: Invalid Variant option -> $variant" - echo "" - variant_usage - exit 1 - esac - shift - shift - ;; - *) - echo "Syntax Error: unknown option: $key" - echo "" - usage - exit 1 -esac -done - -if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] -then - VM_TEMPLATE=ci- -else - VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}- -fi - -VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"` -VM_CMDS=${VM_NAME}_cmds.txt - -echo "VM_NAME = $VM_NAME" -echo "VM_MEMORY = $VM_MEMORY MBytes" -echo "VM_CPU = $VM_CPU" - -echo "############################################################" -echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" -echo "############################################################" -uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml -echo "Waiting for VM to be started" -uvt-kvm wait $VM_NAME --insecure - -VM_IP_ADDR=`uvt-kvm ip $VM_NAME` -echo "$VM_NAME has for IP addr = $VM_IP_ADDR" -exit 0 diff --git a/ci-scripts/destroyAllRunningVM.sh b/ci-scripts/destroyAllRunningVM.sh index 5e152bc590..76a7fd0b50 100755 --- a/ci-scripts/destroyAllRunningVM.sh +++ b/ci-scripts/destroyAllRunningVM.sh @@ -20,15 +20,17 @@ # * contact@openairinterface.org # */ -function usage { - echo "OAI VM Destroy script" +function destroy_usage { + echo "OAI CI VM script" echo " Original Author: Raphael Defosseux" + echo " Requirements:" + echo " -- uvtool uvtool-libvirt apt-cacher" echo "" echo "Usage:" echo "------" - echo " destroyAllRunningVM.sh [OPTIONS]" + echo " oai-ci-vm-tool destroy [OPTIONS]" echo "" - echo "Options:" + echo "Mandatory Options:" echo "--------" echo " --job-name #### OR -jn ####" echo " Specify the name of the Jenkins job." @@ -36,66 +38,26 @@ function usage { echo " --build-id #### OR -id ####" echo " Specify the build ID of the Jenkins job." echo "" + echo "Options:" + echo "--------" echo " --help OR -h" echo " Print this help message." echo "" } -if [ $# -gt 4 ] -then - echo "Syntax Error: not the correct number of arguments" - echo "" - usage - exit 1 -fi +function destroy_vm { + echo "############################################################" + echo "OAI CI VM script" + echo "############################################################" + echo "VM_TEMPLATE = $VM_TEMPLATE" -VM_TEMPLATE=ci- -JOB_NAME=XX -BUILD_ID=XX - -while [[ $# -gt 0 ]] -do -key="$1" -case $key in - -h|--help) - shift - usage - exit 0 - ;; - -jn|--job-name) - JOB_NAME="$2" - shift - shift - ;; - -id|--build-id) - BUILD_ID="$2" - shift - shift - ;; - *) - echo "Syntax Error: unknown option: $key" - echo "" - usage - exit 1 -esac -done - -if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] -then - VM_TEMPLATE=ci- -else - VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}- -fi - -LIST_CI_VM=`uvt-kvm list | grep $VM_TEMPLATE` - -for CI_VM in $LIST_CI_VM -do - VM_IP_ADDR=`uvt-kvm ip $CI_VM` - echo "VM to destroy: $CI_VM -- IP $VM_IP_ADDR" - uvt-kvm destroy $CI_VM - ssh-keygen -R $VM_IP_ADDR -done - -exit 0 + LIST_CI_VM=`uvt-kvm list | grep $VM_TEMPLATE` + for CI_VM in $LIST_CI_VM + do + VM_IP_ADDR=`uvt-kvm ip $CI_VM` + echo "VM to destroy: $CI_VM -- IP $VM_IP_ADDR" + uvt-kvm destroy $CI_VM + ssh-keygen -R $VM_IP_ADDR + done +} diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool new file mode 100755 index 0000000000..8d3dbb4ddd --- /dev/null +++ b/ci-scripts/oai-ci-vm-tool @@ -0,0 +1,573 @@ +#!/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 +# */ + +function top_usage { + echo "OAI CI VM script" + echo " Original Author: Raphael Defosseux" + echo " Requirements:" + echo " -- uvtool uvtool-libvirt apt-cacher" + echo " -- xenial image already synced" + echo "" + echo "Usage:" + echo "------" + echo " oai-ci-vm-tool (-h|--help) {create,destroy,build,wait,test,report-build,report-test} ..." + echo "" +} + +function variant_usage { + echo " --variant enb-usrp OR -v1" + echo " --variant basic-sim OR -v2" + echo " --variant phy-sim OR -v3" + echo " --variant cppcheck OR -v4" + echo " --variant gnb-usrp OR -v5" + echo " --variant nu-ue-usrp OR -v6" + echo " --variant enb-ethernet OR -v7" + echo " --variant ue-ethernet OR -v8" +} + +MY_DIR=$(dirname $(readlink -f $0)) +. $MY_DIR/createVM.sh +. $MY_DIR/buildOnVM.sh +. $MY_DIR/waitBuildOnVM.sh +. $MY_DIR/destroyAllRunningVM.sh +. $MY_DIR/runTestOnVM.sh +. $MY_DIR/reportBuildLocally.sh +. $MY_DIR/reportTestLocally.sh + +if [ $# -lt 1 ] +then + echo "Syntax Error: too few arguments" + echo "" + top_usage + exit 1 +fi + +VM_TEMPLATE=ci- +JOB_NAME=XX +BUILD_ID=XX +VM_NAME=ci-enb-usrp +VM_MEMORY=2048 +VM_CPU=4 +ARCHIVES_LOC=enb_usrp +LOG_PATTERN=.Rel15.txt +NB_PATTERN_FILES=4 +BUILD_OPTIONS="--eNB -w USRP" +KEEP_VM_ALIVE=0 +RUN_OPTIONS="none" +DAEMON=0 +MR_TRIG=0 +PU_TRIG=0 + +HELP_CMD=0 +CREATE_CMD=0 +BUILD_CMD=0 +WAIT_CMD=0 +DESTROY_CMD=0 +TEST_CMD=0 +REPORT_BUILD_CMD=0 +REPORT_TEST_CMD=0 +NBARGS=0 + +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -h|--help) + HELP_CMD=1 + shift + ;; + create) + CREATE_CMD=1 + # It is implied to keep the VM when creating it + KEEP_VM_ALIVE=1 + shift + ;; + build) + BUILD_CMD=1 + shift + ;; + wait) + WAIT_CMD=1 + shift + ;; + test) + TEST_CMD=1 + shift + ;; + destroy) + DESTROY_CMD=1 + shift + ;; + report-build) + REPORT_BUILD_CMD=1 + shift + ;; + report-test) + REPORT_TEST_CMD=1 + shift + ;; + -jn|--job-name) + JOB_NAME="$2" + NBARGS=$[$NBARGS+1] + shift + shift + ;; + -id|--build-id) + BUILD_ID="$2" + NBARGS=$[$NBARGS+2] + shift + shift + ;; + -ws|--workspace) + JENKINS_WKSP="$2" + NBARGS=$[$NBARGS+4] + shift + shift + ;; + -k|--keep-vm-alive) + KEEP_VM_ALIVE=1 + NBARGS=$[$NBARGS+8] + shift + ;; + -D|--daemon) + DAEMON=1 + NBARGS=$[$NBARGS+16] + shift + ;; + -gu|--git-url) + GIT_URL="$2" + NBARGS=$[$NBARGS+32] + shift + shift + ;; + --trigger) + TRIG="$2" + case $TRIG in + merge-request) + MR_TRIG=1 + ;; + push) + PU_TRIG=1 + ;; + *) + echo "" + echo "Syntax Error: Invalid Trigger option -> $TRIG" + echo "" + trigger_usage + exit + ;; + esac + NBARGS=$[$NBARGS+64] + shift + shift + ;; + -mr) + MR_TRIG=1 + NBARGS=$[$NBARGS+64] + shift + ;; + -pu) + PU_TRIG=1 + NBARGS=$[$NBARGS+64] + shift + ;; + -sb|--src-branch) + SOURCE_BRANCH="$2" + NBARGS=$[$NBARGS+1024] + shift + shift + ;; + -sc|--src-commit) + SOURCE_COMMIT_ID="$2" + NBARGS=$[$NBARGS+2048] + shift + shift + ;; + -tb|--target-branch) + TARGET_BRANCH="$2" + NBARGS=$[$NBARGS+4096] + shift + shift + ;; + -tc|--target-commit) + TARGET_COMMIT_ID="$2" + NBARGS=$[$NBARGS+8192] + shift + shift + ;; + -br|--branch) + SOURCE_BRANCH="$2" + NBARGS=$[$NBARGS+16384] + shift + shift + ;; + -co|--commit) + SOURCE_COMMIT_ID="$2" + NBARGS=$[$NBARGS+32768] + shift + shift + ;; + -v1) + VM_NAME=ci-enb-usrp + ARCHIVES_LOC=enb_usrp + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=4 + BUILD_OPTIONS="--eNB -w USRP --mu" + NBARGS=$[$NBARGS+256] + shift + ;; + -v2) + VM_NAME=ci-basic-sim + ARCHIVES_LOC=basic_sim + LOG_PATTERN=basic_simulator + NB_PATTERN_FILES=2 + BUILD_OPTIONS="--basic-simulator" + VM_MEMORY=8192 + VM_CPU=4 + RUN_OPTIONS="complex" + NBARGS=$[$NBARGS+256] + shift + ;; + -v3) + VM_NAME=ci-phy-sim + ARCHIVES_LOC=phy_sim + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=6 + BUILD_OPTIONS="--phy_simulators" + RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b" + NBARGS=$[$NBARGS+256] + shift + ;; + -v4) + VM_NAME=ci-cppcheck + VM_MEMORY=8192 + ARCHIVES_LOC=cppcheck + LOG_PATTERN=cppcheck.xml + NB_PATTERN_FILES=1 + BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c" + NBARGS=$[$NBARGS+256] + shift + ;; + -v5) + VM_NAME=ci-gnb-usrp + ARCHIVES_LOC=gnb_usrp + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=4 + BUILD_OPTIONS="--gNB -w USRP" + NBARGS=$[$NBARGS+256] + shift + ;; + -v6) + VM_NAME=ci-ue-nr-usrp + ARCHIVES_LOC=nrue_usrp + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=4 + BUILD_OPTIONS="--nrUE -w USRP" + NBARGS=$[$NBARGS+256] + shift + ;; + -v7) + VM_NAME=ci-enb-ethernet + ARCHIVES_LOC=enb_eth + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=6 + BUILD_OPTIONS="--eNB -t ETHERNET --noS1" + NBARGS=$[$NBARGS+256] + shift + ;; + -v8) + VM_NAME=ci-ue-ethernet + ARCHIVES_LOC=ue_eth + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=6 + BUILD_OPTIONS="--UE -t ETHERNET --noS1" + NBARGS=$[$NBARGS+256] + shift + ;; + --variant) + variant="$2" + case $variant in + enb-usrp) + VM_NAME=ci-enb-usrp + ARCHIVES_LOC=enb_usrp + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=4 + BUILD_OPTIONS="--eNB -w USRP --mu" + NBARGS=$[$NBARGS+256] + ;; + basic-sim) + VM_NAME=ci-basic-sim + ARCHIVES_LOC=basic_sim + LOG_PATTERN=basic_simulator + NB_PATTERN_FILES=2 + BUILD_OPTIONS="--basic-simulator" + VM_MEMORY=8192 + VM_CPU=4 + RUN_OPTIONS="complex" + NBARGS=$[$NBARGS+256] + ;; + phy-sim) + VM_NAME=ci-phy-sim + ARCHIVES_LOC=phy_sim + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=6 + BUILD_OPTIONS="--phy_simulators" + RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b" + NBARGS=$[$NBARGS+256] + ;; + cppcheck) + VM_NAME=ci-cppcheck + VM_MEMORY=8192 + ARCHIVES_LOC=cppcheck + LOG_PATTERN=cppcheck.xml + NB_PATTERN_FILES=1 + BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c" + NBARGS=$[$NBARGS+256] + ;; + gnb-usrp) + VM_NAME=ci-gnb-usrp + ARCHIVES_LOC=gnb_usrp + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=4 + BUILD_OPTIONS="--gNB -w USRP" + NBARGS=$[$NBARGS+256] + ;; + nu-ue-usrp) + VM_NAME=ci-ue-nr-usrp + ARCHIVES_LOC=nrue_usrp + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=4 + BUILD_OPTIONS="--nrUE -w USRP" + NBARGS=$[$NBARGS+256] + ;; + enb-ethernet) + VM_NAME=ci-enb-ethernet + ARCHIVES_LOC=enb_eth + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=6 + BUILD_OPTIONS="--eNB -t ETHERNET --noS1" + NBARGS=$[$NBARGS+256] + ;; + ue-ethernet) + VM_NAME=ci-ue-ethernet + ARCHIVES_LOC=ue_eth + LOG_PATTERN=.Rel15.txt + NB_PATTERN_FILES=6 + BUILD_OPTIONS="--UE -t ETHERNET --noS1" + NBARGS=$[$NBARGS+256] + ;; + *) + echo "" + echo "Syntax Error: Invalid Variant option -> $variant" + echo "" + variant_usage + exit 1 + esac + shift + shift + ;; + *) + echo "Syntax Error: unknown option: $key" + echo "" + top_usage + exit 1 +esac +done + +MANY_CMDS=$[$CREATE_CMD+$BUILD_CMD+$WAIT_CMD+$DESTROY_CMD+$TEST_CMD+$REPORT_BUILD_CMD+$REPORT_TEST_CMD] +if [ $MANY_CMDS -gt 1 ] +then + echo "Syntax Error: too many commands" + top_usage + exit 1 +fi + +if [ $HELP_CMD -eq 1 ] +then + if [ $MANY_CMDS -eq 0 ] + then + top_usage + exit 0 + fi + if [ $CREATE_CMD -eq 1 ] + then + create_usage + exit 0 + fi + if [ $BUILD_CMD -eq 1 ] + then + build_usage + exit 0 + fi + if [ $WAIT_CMD -eq 1 ] + then + wait_usage + exit 0 + fi + if [ $TEST_CMD -eq 1 ] + then + run_test_usage + exit 0 + fi + if [ $DESTROY_CMD -eq 1 ] + then + destroy_usage + exit 0 + fi + if [ $REPORT_BUILD_CMD -eq 1 ] + then + report_build_usage + exit 0 + fi + if [ $REPORT_TEST_CMD -eq 1 ] + then + report_test_usage + exit 0 + fi +else + if [ $MANY_CMDS -eq 0 ] + then + echo "Syntax Error: no command" + top_usage + exit 1 + fi + # For create, mandatory options: jn, id. Optional: variant + if [ $CREATE_CMD -eq 1 ] && [ $NBARGS -ne 3 ] && [ $NBARGS -ne 259 ] + then + echo "Syntax Error: unsupported option(s) for create command" + create_usage + exit 1 + fi + # For build, mandatory options: jn, id, ws. Optional: variant, k, D + if [ $BUILD_CMD -eq 1 ] && [ $NBARGS -ne 7 ] && [ $NBARGS -ne 263 ] && [ $NBARGS -ne 15 ] && [ $NBARGS -ne 271 ] && [ $NBARGS -ne 23 ] && [ $NBARGS -ne 279 ] && [ $NBARGS -ne 31 ] && [ $NBARGS -ne 287 ] + then + echo "Syntax Error: unsupported option(s) for build command" + build_usage + exit 1 + fi + # For wait, mandatory options: jn, id, ws. Optional: variant, k + if [ $WAIT_CMD -eq 1 ] && [ $NBARGS -ne 7 ] && [ $NBARGS -ne 263 ] && [ $NBARGS -ne 15 ] && [ $NBARGS -ne 271 ] + then + echo "Syntax Error: unsupported option(s) for wait command" + wait_usage + exit 1 + fi + # For test, mandatory options: jn, id, ws. Optional: variant, k + if [ $TEST_CMD -eq 1 ] && [ $NBARGS -ne 7 ] && [ $NBARGS -ne 263 ] && [ $NBARGS -ne 15 ] && [ $NBARGS -ne 271 ] + then + echo "Syntax Error: unsupported option(s) for test command" + run_test_usage + exit 1 + fi + # For destroy, mandatory options: jn, id. + if [ $DESTROY_CMD -eq 1 ] && [ $NBARGS -ne 3 ] + then + echo "Syntax Error: unsupported option(s) for destroy command" + destroy_usage + exit 1 + fi + # For report-build, mandatory options: jn, id, ws, gu, pu, br,co. + # or: jn, id, ws, gu, mr, sb, sc, tb, tc. + if [ $REPORT_BUILD_CMD -eq 1 ] && [ $NBARGS -ne 15463 ] && [ $NBARGS -ne 49255 ] + then + echo "Syntax Error: unsupported option(s) for report-build command" + report_build_usage + exit 1 + fi + # For report-test, mandatory options: jn, id, ws, gu, pu, br,co. + # or: jn, id, ws, gu, mr, sb, sc, tb, tc. + if [ $REPORT_TEST_CMD -eq 1 ] && [ $NBARGS -ne 15463 ] && [ $NBARGS -ne 49255 ] + then + echo "Syntax Error: unsupported option(s) for report-test command" + report_test_usage + exit 1 + fi +fi + +# Checking uvt-kvm is installed +UVT_KVM_PATH=`which uvt-kvm | grep -c uvt-kvm` +if [ $UVT_KVM_PATH -eq 0 ] +then + echo "Error: uvt-kvm is not installed" + top_usage + exit 1 +fi + +if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] +then + VM_TEMPLATE=ci- +else + VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}- +fi + +VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"` +VM_CMDS=${VM_NAME}_cmds.txt +ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC} + +STATUS=0 +if [ $CREATE_CMD -eq 1 ] +then + create_vm +fi +if [ $BUILD_CMD -eq 1 ] +then + build_on_vm + if [ $DAEMON -eq 0 ] && [ $STATUS -eq 0 ] + then + check_on_vm_build + fi +fi +if [ $WAIT_CMD -eq 1 ] +then + wait_on_vm_build + if [ $STATUS -eq 0 ] + then + check_on_vm_build + fi +fi +if [ $TEST_CMD -eq 1 ] +then + ARCHIVES_LOC=${ARCHIVES_LOC}/test + run_test_on_vm +fi +if [ $DESTROY_CMD -eq 1 ] +then + destroy_vm +fi +if [ $REPORT_BUILD_CMD -eq 1 ] +then + report_build +fi +if [ $REPORT_TEST_CMD -eq 1 ] +then + report_test +fi + +# Did command pass or fail? +if [ $STATUS -eq 0 ] +then + echo "STATUS seems OK" +else + echo "STATUS failed?" +fi +exit $STATUS diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh index e0336c6dab..2e78e6f6cd 100755 --- a/ci-scripts/reportBuildLocally.sh +++ b/ci-scripts/reportBuildLocally.sh @@ -20,14 +20,13 @@ # * contact@openairinterface.org # */ -function usage { - echo "OAI Local Build Report script" +function report_build_usage { + echo "OAI CI VM script" echo " Original Author: Raphael Defosseux" echo "" echo "Usage:" echo "------" - echo "" - echo " reportBuildLocally.sh [OPTIONS]" + echo " oai-ci-vm-tool report-build [OPTIONS]" echo "" echo "Options:" echo "--------" @@ -47,6 +46,9 @@ function usage { echo " --build-id #### OR -id ####" echo " Specify the build ID of the Jenkins job." echo "" + echo " --workspace #### OR -ws ####" + echo " Specify the workspace." + echo "" echo " --trigger merge-request OR -mr" echo " --trigger push OR -pu" echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event." @@ -79,7 +81,7 @@ function usage { } function trigger_usage { - echo "OAI Local Build Report script" + echo "OAI CI VM script" echo " Original Author: Raphael Defosseux" echo "" echo " --trigger merge-request OR -mr" @@ -153,8 +155,8 @@ function summary_table_row { echo " $1" >> ./build_results.html if [ -f $2 ] then - STATUS=`egrep -c "$3" $2` - if [ $STATUS -eq 1 ] + BUILD_STATUS=`egrep -c "$3" $2` + if [ $BUILD_STATUS -eq 1 ] then echo " OK" >> ./build_results.html else @@ -263,384 +265,245 @@ function sca_summary_table_footer { echo "

Graphical Interface tool : cppcheck-gui -l cppcheck/cppcheck.xml

" >> ./build_results.html } -jb_checker=0 -mr_checker=0 -pu_checker=0 -MR_TRIG=0 -PU_TRIG=0 -while [[ $# -gt 0 ]] -do -key="$1" +function report_build { + echo "############################################################" + echo "OAI CI VM script" + echo "############################################################" -case $key in - -h|--help) - shift - usage - exit 0 - ;; - -gu|--git-url) - GIT_URL="$2" - let "jb_checker|=0x1" - shift - shift - ;; - -jn|--job-name) - JOB_NAME="$2" - let "jb_checker|=0x2" - shift - shift - ;; - -id|--build-id) - BUILD_ID="$2" - let "jb_checker|=0x4" - shift - shift - ;; - --trigger) - TRIG="$2" - case $TRIG in - merge-request) - MR_TRIG=1 - ;; - push) - PU_TRIG=1 - ;; - *) - echo "" - echo "Syntax Error: Invalid Trigger option -> $TRIG" - echo "" - trigger_usage - exit - ;; - esac - let "jb_checker|=0x8" - shift - shift - ;; - -mr) - MR_TRIG=1 - let "jb_checker|=0x8" - shift - ;; - -pu) - PU_TRIG=1 - let "jb_checker|=0x8" - shift - ;; - -sb|--src-branch) - SOURCE_BRANCH="$2" - let "mr_checker|=0x1" - shift - shift - ;; - -sc|--src-commit) - SOURCE_COMMIT_ID="$2" - let "mr_checker|=0x2" - shift - shift - ;; - -tb|--target-branch) - TARGET_BRANCH="$2" - let "mr_checker|=0x4" - shift - shift - ;; - -tc|--target-commit) - TARGET_COMMIT_ID="$2" - let "mr_checker|=0x8" - shift - shift - ;; - -br|--branch) - SOURCE_BRANCH="$2" - let "pu_checker|=0x1" - shift - shift - ;; - -co|--commit) - SOURCE_COMMIT_ID="$2" - let "pu_checker|=0x2" - shift - shift - ;; - *) - echo "Syntax Error: unknown option: $key" - echo "" - usage - exit 1 - ;; -esac + echo "JENKINS_WKSP = $JENKINS_WKSP" -done - -if [ $jb_checker -ne 15 ] -then - echo "" - echo "Syntax Error: missing job information." - # TODO : list missing info - echo "" - exit 1 -fi - -if [ $PU_TRIG -eq 1 ] && [ $MR_TRIG -eq 1 ] -then - echo "" - echo "Syntax Error: trigger action incoherent." - echo "" - trigger_usage - exit 1 -fi - -if [ $PU_TRIG -eq 1 ] -then - if [ $pu_checker -ne 3 ] + cd ${JENKINS_WKSP} + echo "" > ./build_results.html + echo "" >> ./build_results.html + echo "" >> ./build_results.html + echo " Build Results for $JOB_NAME job build #$BUILD_ID" >> ./build_results.html + echo " " >> ./build_results.html + echo "" >> ./build_results.html + echo "" >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo "
" >> ./build_results.html + echo " " >> ./build_results.html + echo " \"\"" >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID" >> ./build_results.html + echo "
" >> ./build_results.html + echo "
" >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + if [ $PU_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi + if [ $MR_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi + echo " " >> ./build_results.html + if [ $PU_TRIG -eq 1 ] then - echo "" - echo "Syntax Error: missing push information." - # TODO : list missing info - echo "" - exit 1 + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html fi -fi - -if [ $MR_TRIG -eq 1 ] -then - if [ $mr_checker -ne 15 ] + if [ $MR_TRIG -eq 1 ] then - echo "" - echo "Syntax Error: missing merge-request information." - # TODO : list missing info - echo "" - exit 1 + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html fi -fi + echo "
Build Start Time (UTC)TEMPLATE_BUILD_TIME
GIT Repository$GIT_URL
Job TriggerPush EventMerge-Request
Branch$SOURCE_BRANCH
Commit ID$SOURCE_COMMIT_ID
Source Branch$SOURCE_BRANCH
Source Commit ID$SOURCE_COMMIT_ID
Target Branch$TARGET_BRANCH
Target Commit ID$TARGET_COMMIT_ID
" >> ./build_results.html + echo "

Build Summary

" >> ./build_results.html -echo "" > ./build_results.html -echo "" >> ./build_results.html -echo "" >> ./build_results.html -echo " Build Results for $JOB_NAME job build #$BUILD_ID" >> ./build_results.html -echo " " >> ./build_results.html -echo "" >> ./build_results.html -echo "" >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo "
" >> ./build_results.html -echo " " >> ./build_results.html -echo " \"\"" >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID" >> ./build_results.html -echo "
" >> ./build_results.html -echo "
" >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -echo " " >> ./build_results.html -if [ $PU_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi -if [ $MR_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi -echo " " >> ./build_results.html -if [ $PU_TRIG -eq 1 ] -then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html -fi -if [ $MR_TRIG -eq 1 ] -then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html -fi -echo "
Build Start Time (UTC)TEMPLATE_BUILD_TIME
GIT Repository$GIT_URL
Job TriggerPush EventMerge-Request
Branch$SOURCE_BRANCH
Commit ID$SOURCE_COMMIT_ID
Source Branch$SOURCE_BRANCH
Source Commit ID$SOURCE_COMMIT_ID
Target Branch$TARGET_BRANCH
Target Commit ID$TARGET_COMMIT_ID
" >> ./build_results.html -echo "

Build Summary

" >> ./build_results.html - -if [ -f ./oai_rules_result.txt ] -then - echo "

OAI Coding / Formatting Guidelines Check

" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - NB_FILES=`cat ./oai_rules_result.txt` - if [ $NB_FILES = "0" ] - then - if [ $PU_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi - if [ $MR_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi - echo " " >> ./build_results.html - echo "
Result:All files in repository follow OAI rules. All modified files in Merge-Request follow OAI rules.
" >> ./build_results.html - else - if [ $PU_TRIG -eq 1 ]; then echo " $NB_FILES files in repository DO NOT follow OAI rules. " >> ./build_results.html; fi - if [ $MR_TRIG -eq 1 ]; then echo " $NB_FILES modified files in Merge-Request DO NOT follow OAI rules." >> ./build_results.html; fi - echo " " >> ./build_results.html - if [ -f ./oai_rules_result_list.txt ] - then - awk '{print " "$1""}' ./oai_rules_result_list.txt >> ./build_results.html + if [ -f ./oai_rules_result.txt ] + then + echo "

OAI Coding / Formatting Guidelines Check

" >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./build_results.html + NB_FILES=`cat ./oai_rules_result.txt` + if [ $NB_FILES = "0" ] + then + if [ $PU_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi + if [ $MR_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi + echo " " >> ./build_results.html + echo "
Result:All files in repository follow OAI rules. All modified files in Merge-Request follow OAI rules.
" >> ./build_results.html + else + if [ $PU_TRIG -eq 1 ]; then echo " $NB_FILES files in repository DO NOT follow OAI rules. " >> ./build_results.html; fi + if [ $MR_TRIG -eq 1 ]; then echo " $NB_FILES modified files in Merge-Request DO NOT follow OAI rules." >> ./build_results.html; fi + echo " " >> ./build_results.html + if [ -f ./oai_rules_result_list.txt ] + then + awk '{print " "$1""}' ./oai_rules_result_list.txt >> ./build_results.html + fi + echo " " >> ./build_results.html + echo "

Please apply the following command to this(ese) file(s):

" >> ./build_results.html + echo "

astyle --options=ci-scripts/astyle-options.txt filename(s)

" >> ./build_results.html fi - echo " " >> ./build_results.html - echo "

Please apply the following command to this(ese) file(s):

" >> ./build_results.html - echo "

astyle --options=ci-scripts/astyle-options.txt filename(s)

" >> ./build_results.html fi -fi -echo "

Ubuntu 16.04 LTS -- Summary

" >> ./build_results.html + echo "

Ubuntu 16.04 LTS -- Summary

" >> ./build_results.html -sca_summary_table_header "OAI Static Code Analysis with CPPCHECK" -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized variable" uninitvar -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized struct member" uninitStructMember -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory leak" memleak -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory is freed twice" doubleFree -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Resource leak" resourceLeak -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Possible null pointer dereference" nullPointer -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Array access out of bounds" arrayIndexOutOfBounds -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Buffer is accessed out of bounds" bufferAccessOutOfBounds -sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Expression depends on order of evaluation of side effects" unknownEvaluationOrder -sca_summary_table_footer ./archives/cppcheck/cppcheck.xml + sca_summary_table_header "OAI Static Code Analysis with CPPCHECK" + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized variable" uninitvar + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized struct member" uninitStructMember + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory leak" memleak + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory is freed twice" doubleFree + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Resource leak" resourceLeak + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Possible null pointer dereference" nullPointer + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Array access out of bounds" arrayIndexOutOfBounds + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Buffer is accessed out of bounds" bufferAccessOutOfBounds + sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Expression depends on order of evaluation of side effects" unknownEvaluationOrder + sca_summary_table_footer ./archives/cppcheck/cppcheck.xml -summary_table_header "OAI Build eNB -- USRP option" -summary_table_row "LTE SoftModem - Release 15" ./archives/enb_usrp/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./enb_usrp_row1.html -summary_table_row "Coding - Release 15" ./archives/enb_usrp/coding.Rel15.txt "Built target coding" ./enb_usrp_row2.html -summary_table_row "OAI USRP device if - Release 15" ./archives/enb_usrp/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./enb_usrp_row3.html -summary_table_row "Parameters Lib Config - Release 15" ./archives/enb_usrp/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_usrp_row4.html -summary_table_footer - -summary_table_header "OAI Build basic simulator option" -summary_table_row "Basic Simulator eNb - Release 15" ./archives/basic_sim/basic_simulator_enb.txt "Built target lte-softmodem" ./basic_sim_row1.html -summary_table_row "Basic Simulator UE - Release 15" ./archives/basic_sim/basic_simulator_ue.txt "Built target lte-uesoftmodem" ./basic_sim_row2.html -summary_table_row "Conf 2 UE data - Release 15" ./archives/basic_sim/conf2uedata.Rel15.txt "Built target conf2uedata" ./basic_sim_row3.html -summary_table_footer - -summary_table_header "OAI Build Physical simulators option" -summary_table_row "DL Simulator - Release 15" ./archives/phy_sim/dlsim.Rel15.txt "Built target dlsim" ./phy_sim_row1.html -summary_table_row "UL Simulator - Release 15" ./archives/phy_sim/ulsim.Rel15.txt "Built target ulsim" ./phy_sim_row2.html -summary_table_row "Coding - Release 15" ./archives/phy_sim/coding.Rel15.txt "Built target coding" ./phy_sim_row3.html -if [ -f ./archives/phy_sim/ldpctest.Rel15.txt ] -then - summary_table_row "LDPC Test - Release 15" ./archives/phy_sim/ldpctest.Rel15.txt "Built target ldpctest" ./phy_sim_row4.html -fi -if [ -f ./archives/phy_sim/polartest.Rel15.txt ] -then - summary_table_row "Polar Test - Release 15" ./archives/phy_sim/polartest.Rel15.txt "Built target polartest" ./phy_sim_row5.html -fi -if [ -f ./archives/phy_sim/nr_pbchsim.Rel15.txt ] -then - summary_table_row "PBCH Test - Release 15" ./archives/phy_sim/nr_pbchsim.Rel15.txt "Built target nr_pbchsim" ./phy_sim_row6.html -fi -summary_table_footer - - -if [ -f archives/gnb_usrp/nr-softmodem.Rel15.txt ] -then - summary_table_header "OAI Build gNB -- USRP option" - summary_table_row "LTE SoftModem - Release 15" ./archives/gnb_usrp/nr-softmodem.Rel15.txt "Built target nr-softmodem" ./gnb_usrp_row1.html - summary_table_row "Coding - Release 15" ./archives/gnb_usrp/coding.Rel15.txt "Built target coding" ./gnb_usrp_row2.html - summary_table_row "OAI USRP device if - Release 15" ./archives/gnb_usrp/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./gnb_usrp_row3.html - summary_table_row "Parameters Lib Config - Release 15" ./archives/gnb_usrp/params_libconfig.Rel15.txt "Built target params_libconfig" ./gnb_usrp_row4.html + summary_table_header "OAI Build eNB -- USRP option" + summary_table_row "LTE SoftModem - Release 15" ./archives/enb_usrp/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./enb_usrp_row1.html + summary_table_row "Coding - Release 15" ./archives/enb_usrp/coding.Rel15.txt "Built target coding" ./enb_usrp_row2.html + summary_table_row "OAI USRP device if - Release 15" ./archives/enb_usrp/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./enb_usrp_row3.html + summary_table_row "Parameters Lib Config - Release 15" ./archives/enb_usrp/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_usrp_row4.html summary_table_footer -fi -if [ -f archives/nrue_usrp/nr-uesoftmodem.Rel15.txt ] -then - summary_table_header "OAI Build 5G NR UE -- USRP option" - summary_table_row "UE SoftModem - Release 15" ./archives/nrue_usrp/nr-uesoftmodem.Rel15.txt "Built target nr-uesoftmodem" ./nrue_usrp_row1.html - summary_table_row "Coding - Release 15" ./archives/nrue_usrp/coding.Rel15.txt "Built target coding" ./nrue_usrp_row2.html - summary_table_row "OAI USRP device if - Release 15" ./archives/nrue_usrp/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./nrue_usrp_row3.html - summary_table_row "Parameters Lib Config - Release 15" ./archives/nrue_usrp/params_libconfig.Rel15.txt "Built target params_libconfig" ./nrue_usrp_row4.html + summary_table_header "OAI Build basic simulator option" + summary_table_row "Basic Simulator eNb - Release 15" ./archives/basic_sim/basic_simulator_enb.txt "Built target lte-softmodem" ./basic_sim_row1.html + summary_table_row "Basic Simulator UE - Release 15" ./archives/basic_sim/basic_simulator_ue.txt "Built target lte-uesoftmodem" ./basic_sim_row2.html + summary_table_row "Conf 2 UE data - Release 15" ./archives/basic_sim/conf2uedata.Rel15.txt "Built target conf2uedata" ./basic_sim_row3.html summary_table_footer -fi -summary_table_header "OAI Build eNB -- ETHERNET transport option" -summary_table_row "LTE SoftModem w/o S1 - Release 15" ./archives/enb_eth/lte-softmodem-nos1.Rel15.txt "Built target lte-softmodem" ./enb_eth_row1.html -summary_table_row "Coding - Release 15" ./archives/enb_eth/coding.Rel15.txt "Built target coding" ./enb_eth_row2.html -summary_table_row "OAI ETHERNET transport - Release 15" ./archives/enb_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./enb_eth_row3.html -summary_table_row "Parameters Lib Config - Release 15" ./archives/enb_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_eth_row4.html -summary_table_row "RB Tools - Release 15" ./archives/enb_eth/rb_tool.Rel15.txt "Built target rb_tool" ./enb_eth_row5.html -summary_table_row "NAS Mesh - Release 15" ./archives/enb_eth/nasmesh.Rel15.txt "Built target nasmesh" ./enb_eth_row6.html -summary_table_footer + summary_table_header "OAI Build Physical simulators option" + summary_table_row "DL Simulator - Release 15" ./archives/phy_sim/dlsim.Rel15.txt "Built target dlsim" ./phy_sim_row1.html + summary_table_row "UL Simulator - Release 15" ./archives/phy_sim/ulsim.Rel15.txt "Built target ulsim" ./phy_sim_row2.html + summary_table_row "Coding - Release 15" ./archives/phy_sim/coding.Rel15.txt "Built target coding" ./phy_sim_row3.html + if [ -f ./archives/phy_sim/ldpctest.Rel15.txt ] + then + summary_table_row "LDPC Test - Release 15" ./archives/phy_sim/ldpctest.Rel15.txt "Built target ldpctest" ./phy_sim_row4.html + fi + if [ -f ./archives/phy_sim/polartest.Rel15.txt ] + then + summary_table_row "Polar Test - Release 15" ./archives/phy_sim/polartest.Rel15.txt "Built target polartest" ./phy_sim_row5.html + fi + if [ -f ./archives/phy_sim/nr_pbchsim.Rel15.txt ] + then + summary_table_row "PBCH Test - Release 15" ./archives/phy_sim/nr_pbchsim.Rel15.txt "Built target nr_pbchsim" ./phy_sim_row6.html + fi + summary_table_footer -summary_table_header "OAI Build UE -- ETHERNET transport option" -summary_table_row "LTE UE SoftModem w/o S1 - Release 15" ./archives/ue_eth/lte-uesoftmodem-nos1.Rel15.txt "Built target lte-uesoftmodem" ./ue_eth_row1.html -summary_table_row "Coding - Release 15" ./archives/ue_eth/coding.Rel15.txt "Built target coding" ./ue_eth_row2.html -summary_table_row "OAI ETHERNET transport - Release 15" ./archives/ue_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./ue_eth_row3.html -summary_table_row "Parameters Lib Config - Release 15" ./archives/ue_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./ue_eth_row4.html -summary_table_row "RB Tools - Release 15" ./archives/ue_eth/rb_tool.Rel15.txt "Built target rb_tool" ./ue_eth_row5.html -summary_table_row "NAS Mesh - Release 15" ./archives/ue_eth/nasmesh.Rel15.txt "Built target nasmesh" ./ue_eth_row6.html -summary_table_footer -echo "

Red Hat (CentOS Linux release 7.4.1708) -- Summary

" >> ./build_results.html + if [ -f archives/gnb_usrp/nr-softmodem.Rel15.txt ] + then + summary_table_header "OAI Build gNB -- USRP option" + summary_table_row "LTE SoftModem - Release 15" ./archives/gnb_usrp/nr-softmodem.Rel15.txt "Built target nr-softmodem" ./gnb_usrp_row1.html + summary_table_row "Coding - Release 15" ./archives/gnb_usrp/coding.Rel15.txt "Built target coding" ./gnb_usrp_row2.html + summary_table_row "OAI USRP device if - Release 15" ./archives/gnb_usrp/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./gnb_usrp_row3.html + summary_table_row "Parameters Lib Config - Release 15" ./archives/gnb_usrp/params_libconfig.Rel15.txt "Built target params_libconfig" ./gnb_usrp_row4.html + summary_table_footer + fi -summary_table_header "Red Hat -- OAI Build eNB -- USRP option" -summary_table_row "LTE SoftModem - Release 15" ./archives/red_hat/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./enb_usrp_rh_row1.html -summary_table_row "Coding - Release 15" ./archives/red_hat/coding.Rel15.txt "Built target coding" ./enb_usrp_rh_row2.html -summary_table_row "OAI USRP device if - Release 15" ./archives/red_hat/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./enb_usrp_rh_row3.html -summary_table_row "Parameters Lib Config - Release 15" ./archives/red_hat/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_usrp_rh_row4.html -summary_table_footer + if [ -f archives/nrue_usrp/nr-uesoftmodem.Rel15.txt ] + then + summary_table_header "OAI Build 5G NR UE -- USRP option" + summary_table_row "UE SoftModem - Release 15" ./archives/nrue_usrp/nr-uesoftmodem.Rel15.txt "Built target nr-uesoftmodem" ./nrue_usrp_row1.html + summary_table_row "Coding - Release 15" ./archives/nrue_usrp/coding.Rel15.txt "Built target coding" ./nrue_usrp_row2.html + summary_table_row "OAI USRP device if - Release 15" ./archives/nrue_usrp/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./nrue_usrp_row3.html + summary_table_row "Parameters Lib Config - Release 15" ./archives/nrue_usrp/params_libconfig.Rel15.txt "Built target params_libconfig" ./nrue_usrp_row4.html + summary_table_footer + fi -echo "

Details

" >> ./build_results.html + summary_table_header "OAI Build eNB -- ETHERNET transport option" + summary_table_row "LTE SoftModem w/o S1 - Release 15" ./archives/enb_eth/lte-softmodem-nos1.Rel15.txt "Built target lte-softmodem" ./enb_eth_row1.html + summary_table_row "Coding - Release 15" ./archives/enb_eth/coding.Rel15.txt "Built target coding" ./enb_eth_row2.html + summary_table_row "OAI ETHERNET transport - Release 15" ./archives/enb_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./enb_eth_row3.html + summary_table_row "Parameters Lib Config - Release 15" ./archives/enb_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_eth_row4.html + summary_table_row "RB Tools - Release 15" ./archives/enb_eth/rb_tool.Rel15.txt "Built target rb_tool" ./enb_eth_row5.html + summary_table_row "NAS Mesh - Release 15" ./archives/enb_eth/nasmesh.Rel15.txt "Built target nasmesh" ./enb_eth_row6.html + summary_table_footer -for DETAILS_TABLE in `ls ./enb_usrp_row*.html` -do - cat $DETAILS_TABLE >> ./build_results.html -done -for DETAILS_TABLE in `ls ./basic_sim_row*.html` -do - cat $DETAILS_TABLE >> ./build_results.html -done -for DETAILS_TABLE in `ls ./phy_sim_row*.html` -do - cat $DETAILS_TABLE >> ./build_results.html -done + summary_table_header "OAI Build UE -- ETHERNET transport option" + summary_table_row "LTE UE SoftModem w/o S1 - Release 15" ./archives/ue_eth/lte-uesoftmodem-nos1.Rel15.txt "Built target lte-uesoftmodem" ./ue_eth_row1.html + summary_table_row "Coding - Release 15" ./archives/ue_eth/coding.Rel15.txt "Built target coding" ./ue_eth_row2.html + summary_table_row "OAI ETHERNET transport - Release 15" ./archives/ue_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./ue_eth_row3.html + summary_table_row "Parameters Lib Config - Release 15" ./archives/ue_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./ue_eth_row4.html + summary_table_row "RB Tools - Release 15" ./archives/ue_eth/rb_tool.Rel15.txt "Built target rb_tool" ./ue_eth_row5.html + summary_table_row "NAS Mesh - Release 15" ./archives/ue_eth/nasmesh.Rel15.txt "Built target nasmesh" ./ue_eth_row6.html + summary_table_footer -for DETAILS_TABLE in `ls ./gnb_usrp_row*.html` -do - cat $DETAILS_TABLE >> ./build_results.html -done -for DETAILS_TABLE in `ls ./nrue_usrp_row*.html` -do - cat $DETAILS_TABLE >> ./build_results.html -done -for DETAILS_TABLE in `ls ./enb_eth_row*.html` -do - cat $DETAILS_TABLE >> ./build_results.html -done -for DETAILS_TABLE in `ls ./ue_eth_row*.html` -do - cat $DETAILS_TABLE >> ./build_results.html -done -for DETAILS_TABLE in `ls ./enb_usrp_rh_row*.html` -do - cat $DETAILS_TABLE >> ./build_results.html -done -rm -f ./enb_usrp_row*.html ./basic_sim_row*.html ./phy_sim_row*.html ./enb_eth_row*.html ./ue_eth_row*.html ./enb_usrp_rh_row*.html + if [ -e ./archives/red_hat ] + then + echo "

Red Hat (CentOS Linux release 7.4.1708) -- Summary

" >> ./build_results.html -echo "" >> ./build_results.html -echo "" >> ./build_results.html + summary_table_header "Red Hat -- OAI Build eNB -- USRP option" + summary_table_row "LTE SoftModem - Release 15" ./archives/red_hat/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./enb_usrp_rh_row1.html + summary_table_row "Coding - Release 15" ./archives/red_hat/coding.Rel15.txt "Built target coding" ./enb_usrp_rh_row2.html + summary_table_row "OAI USRP device if - Release 15" ./archives/red_hat/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./enb_usrp_rh_row3.html + summary_table_row "Parameters Lib Config - Release 15" ./archives/red_hat/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_usrp_rh_row4.html + summary_table_footer + fi -exit 0 + echo "

Details

" >> ./build_results.html + + for DETAILS_TABLE in `ls ./enb_usrp_row*.html` + do + cat $DETAILS_TABLE >> ./build_results.html + done + for DETAILS_TABLE in `ls ./basic_sim_row*.html` + do + cat $DETAILS_TABLE >> ./build_results.html + done + for DETAILS_TABLE in `ls ./phy_sim_row*.html` + do + cat $DETAILS_TABLE >> ./build_results.html + done + + for DETAILS_TABLE in `ls ./gnb_usrp_row*.html` + do + cat $DETAILS_TABLE >> ./build_results.html + done + for DETAILS_TABLE in `ls ./nrue_usrp_row*.html` + do + cat $DETAILS_TABLE >> ./build_results.html + done + for DETAILS_TABLE in `ls ./enb_eth_row*.html` + do + cat $DETAILS_TABLE >> ./build_results.html + done + for DETAILS_TABLE in `ls ./ue_eth_row*.html` + do + cat $DETAILS_TABLE >> ./build_results.html + done + if [ -e ./archives/red_hat ] + then + for DETAILS_TABLE in `ls ./enb_usrp_rh_row*.html` + do + cat $DETAILS_TABLE >> ./build_results.html + done + fi + rm -f ./*_row*.html + + echo "" >> ./build_results.html + echo "" >> ./build_results.html +} diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index e00956199c..7bbf52ca2b 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -20,14 +20,13 @@ # * contact@openairinterface.org # */ -function usage { - echo "OAI Test Report script" +function report_test_usage { + echo "OAI CI VM script" echo " Original Author: Raphael Defosseux" echo "" echo "Usage:" echo "------" - echo "" - echo " reportTestLocally.sh [OPTIONS]" + echo " oai-ci-vm-tool report-test [OPTIONS]" echo "" echo "Options:" echo "--------" @@ -47,6 +46,9 @@ function usage { echo " --build-id #### OR -id ####" echo " Specify the build ID of the Jenkins job." echo "" + echo " --workspace #### OR -ws ####" + echo " Specify the workspace." + echo "" echo " --trigger merge-request OR -mr" echo " --trigger push OR -pu" echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event." @@ -78,513 +80,375 @@ function usage { echo "" } -function trigger_usage { - echo "OAI Test Report script" - echo " Original Author: Raphael Defosseux" - echo "" - echo " --trigger merge-request OR -mr" - echo " --trigger push OR -pu" - echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event." - echo "" -} +function report_test { + echo "############################################################" + echo "OAI CI VM script" + echo "############################################################" -jb_checker=0 -mr_checker=0 -pu_checker=0 -MR_TRIG=0 -PU_TRIG=0 -while [[ $# -gt 0 ]] -do -key="$1" + echo "JENKINS_WKSP = $JENKINS_WKSP" -case $key in - -h|--help) - shift - usage - exit 0 - ;; - -gu|--git-url) - GIT_URL="$2" - let "jb_checker|=0x1" - shift - shift - ;; - -jn|--job-name) - JOB_NAME="$2" - let "jb_checker|=0x2" - shift - shift - ;; - -id|--build-id) - BUILD_ID="$2" - let "jb_checker|=0x4" - shift - shift - ;; - --trigger) - TRIG="$2" - case $TRIG in - merge-request) - MR_TRIG=1 - ;; - push) - PU_TRIG=1 - ;; - *) - echo "" - echo "Syntax Error: Invalid Trigger option -> $TRIG" - echo "" - trigger_usage - exit - ;; - esac - let "jb_checker|=0x8" - shift - shift - ;; - -mr) - MR_TRIG=1 - let "jb_checker|=0x8" - shift - ;; - -pu) - PU_TRIG=1 - let "jb_checker|=0x8" - shift - ;; - -sb|--src-branch) - SOURCE_BRANCH="$2" - let "mr_checker|=0x1" - shift - shift - ;; - -sc|--src-commit) - SOURCE_COMMIT_ID="$2" - let "mr_checker|=0x2" - shift - shift - ;; - -tb|--target-branch) - TARGET_BRANCH="$2" - let "mr_checker|=0x4" - shift - shift - ;; - -tc|--target-commit) - TARGET_COMMIT_ID="$2" - let "mr_checker|=0x8" - shift - shift - ;; - -br|--branch) - SOURCE_BRANCH="$2" - let "pu_checker|=0x1" - shift - shift - ;; - -co|--commit) - SOURCE_COMMIT_ID="$2" - let "pu_checker|=0x2" - shift - shift - ;; - *) - echo "Syntax Error: unknown option: $key" - echo "" - usage - exit 1 - ;; -esac - -done - -if [ $jb_checker -ne 15 ] -then - echo "" - echo "Syntax Error: missing job information." - # TODO : list missing info - echo "" - exit 1 -fi - -if [ $PU_TRIG -eq 1 ] && [ $MR_TRIG -eq 1 ] -then - echo "" - echo "Syntax Error: trigger action incoherent." - echo "" - trigger_usage - exit 1 -fi - -if [ $PU_TRIG -eq 1 ] -then - if [ $pu_checker -ne 3 ] - then - echo "" - echo "Syntax Error: missing push information." - # TODO : list missing info - echo "" - exit 1 - fi -fi - -if [ $MR_TRIG -eq 1 ] -then - if [ $mr_checker -ne 15 ] - then - echo "" - echo "Syntax Error: missing merge-request information." - # TODO : list missing info - echo "" - exit 1 - fi -fi - -echo "" > ./test_simulator_results.html -echo "" >> ./test_simulator_results.html -echo "" >> ./test_simulator_results.html -echo " Simulator Results for $JOB_NAME job build #$BUILD_ID" >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo "" >> ./test_simulator_results.html -echo "" >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo "
" >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " \"\"" >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID" >> ./test_simulator_results.html -echo "
" >> ./test_simulator_results.html -echo "
" >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -echo " " >> ./test_simulator_results.html -if [ $PU_TRIG -eq 1 ]; then echo " " >> ./test_simulator_results.html; fi -if [ $MR_TRIG -eq 1 ]; then echo " " >> ./test_simulator_results.html; fi -echo " " >> ./test_simulator_results.html -if [ $PU_TRIG -eq 1 ] -then - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html -fi -if [ $MR_TRIG -eq 1 ] -then - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html -fi -echo "
Build Start Time (UTC)TEMPLATE_BUILD_TIME
GIT Repository$GIT_URL
Job TriggerPush EventMerge-Request
Branch$SOURCE_BRANCH
Commit ID$SOURCE_COMMIT_ID
Source Branch$SOURCE_BRANCH
Source Commit ID$SOURCE_COMMIT_ID
Target Branch$TARGET_BRANCH
Target Commit ID$TARGET_COMMIT_ID
" >> ./test_simulator_results.html -echo "

Test Summary

" >> ./test_simulator_results.html - -ARCHIVES_LOC=archives/basic_sim/test -if [ -d $ARCHIVES_LOC ] -then - echo "

Basic Simulator Check

" >> ./test_simulator_results.html + cd ${JENKINS_WKSP} + echo "" > ./test_simulator_results.html + echo "" >> ./test_simulator_results.html + echo "" >> ./test_simulator_results.html + echo " Simulator Results for $JOB_NAME job build #$BUILD_ID" >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo "" >> ./test_simulator_results.html + echo "" >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo "
" >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " \"\"" >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID" >> ./test_simulator_results.html + echo "
" >> ./test_simulator_results.html + echo "
" >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + if [ $PU_TRIG -eq 1 ]; then echo " " >> ./test_simulator_results.html; fi + if [ $MR_TRIG -eq 1 ]; then echo " " >> ./test_simulator_results.html; fi + echo " " >> ./test_simulator_results.html + if [ $PU_TRIG -eq 1 ] + then + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + fi + if [ $MR_TRIG -eq 1 ] + then + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + fi + echo "
Log File NameCommandStatusStatistics
Build Start Time (UTC)TEMPLATE_BUILD_TIME
GIT Repository$GIT_URL
Job TriggerPush EventMerge-Request
Branch$SOURCE_BRANCH
Commit ID$SOURCE_COMMIT_ID
Source Branch$SOURCE_BRANCH
Source Commit ID$SOURCE_COMMIT_ID
Target Branch$TARGET_BRANCH
Target Commit ID$TARGET_COMMIT_ID
" >> ./test_simulator_results.html + echo "

Test Summary

" >> ./test_simulator_results.html - TRANS_MODES=("fdd" "tdd") - BW_CASES=(05 10 20) - for TMODE in ${TRANS_MODES[@]} - do - for BW in ${BW_CASES[@]} + ARCHIVES_LOC=archives/basic_sim/test + if [ -d $ARCHIVES_LOC ] + then + echo "

Basic Simulator Check

" >> ./test_simulator_results.html + + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + + TRANS_MODES=("fdd" "tdd") + BW_CASES=(05 10 20) + for TMODE in ${TRANS_MODES[@]} do - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_enb.log - UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"` - if [ -f $ENB_LOG ] && [ -f $UE_LOG ] - then - NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` - NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG` - NB_ENB_SYNCED_WITH_UE=`egrep -c "got UE capabilities for UE" $ENB_LOG` - if [ $NB_ENB_GOT_SYNC -eq 1 ] && [ $NB_UE_GOT_SYNC -eq 2 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] + for BW in ${BW_CASES[@]} + do + ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_enb.log + UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"` + if [ -f $ENB_LOG ] && [ -f $UE_LOG ] then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - PING_CASE=$ARCHIVES_LOC/${TMODE}_${BW}MHz_ping_ue.txt - if [ -f $PING_CASE ] - then - echo " " >> ./test_simulator_results.html - NAME=`echo $PING_CASE | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - CMD=`egrep "COMMAND IS" $PING_CASE | sed -e "s#COMMAND IS: ##"` - echo " " >> ./test_simulator_results.html - FILE_COMPLETE=`egrep -c "ping statistics" $PING_CASE` - if [ $FILE_COMPLETE -eq 0 ] - then - echo " " >> ./test_simulator_results.html + NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` + NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - else - NB_TR_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s# packets transmitted.*##"` - NB_RC_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*packets transmitted, ##" -e "s# received,.*##"` - if [ $NB_TR_PACKETS -eq $NB_RC_PACKETS ] + NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` + NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG` + NB_ENB_SYNCED_WITH_UE=`egrep -c "got UE capabilities for UE" $ENB_LOG` + if [ $NB_ENB_GOT_SYNC -eq 1 ] && [ $NB_UE_GOT_SYNC -eq 2 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] then echo " " >> ./test_simulator_results.html else echo " " >> ./test_simulator_results.html fi + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + fi + PING_CASE=$ARCHIVES_LOC/${TMODE}_${BW}MHz_ping_ue.txt + if [ -f $PING_CASE ] + then + echo " " >> ./test_simulator_results.html + NAME=`echo $PING_CASE | sed -e "s#$ARCHIVES_LOC/##"` + echo " " >> ./test_simulator_results.html + CMD=`egrep "COMMAND IS" $PING_CASE | sed -e "s#COMMAND IS: ##"` + echo " " >> ./test_simulator_results.html + FILE_COMPLETE=`egrep -c "ping statistics" $PING_CASE` + if [ $FILE_COMPLETE -eq 0 ] + then + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + else + NB_TR_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s# packets transmitted.*##"` + NB_RC_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*packets transmitted, ##" -e "s# received,.*##"` + if [ $NB_TR_PACKETS -eq $NB_RC_PACKETS ] + then + echo " " >> ./test_simulator_results.html + else + echo " " >> ./test_simulator_results.html + fi + echo " " >> ./test_simulator_results.html + fi + echo " " >> ./test_simulator_results.html + fi + + if [ -f $ARCHIVES_LOC/${TMODE}_${BW}*iperf*dl*client*txt ] + then + IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}*iperf*client*txt` + else + echo "There are no iperf files" + IPERF_TESTS="" + fi + for IPERF_CASE in $IPERF_TESTS + do + echo " " >> ./test_simulator_results.html + NAME=`echo $IPERF_CASE | sed -e "s#$ARCHIVES_LOC/##"` + echo " " >> ./test_simulator_results.html + CMD=`egrep "COMMAND IS" $IPERF_CASE | sed -e "s#COMMAND IS: ##"` + echo " " >> ./test_simulator_results.html + REQ_BITRATE=`echo $CMD | sed -e "s#^.*-b ##" -e "s#-i 1.*##"` + if [[ $REQ_BITRATE =~ .*K.* ]] + then + REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#K##"` + FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000.0" | bc -l` + fi + if [[ $REQ_BITRATE =~ .*M.* ]] + then + REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#M##"` + FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000000.0" | bc -l` + fi + if [[ $REQ_BITRATE =~ .*G.* ]] + then + REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#G##"` + FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000000000.0" | bc -l` + fi + FILE_COMPLETE=`egrep -c "Server Report" $IPERF_CASE` + if [ $FILE_COMPLETE -eq 0 ] + then + echo " " >> ./test_simulator_results.html + SERVER_FILE=`echo $IPERF_CASE | sed -e "s#client#server#"` + FLOAT_EFF_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'` + EFFECTIVE_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}}'` + PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` + JITTER=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*/sec *##" -e "s# *ms.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'` + PACKETLOSS_NOSIGN=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*(##" -e "s#%.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'` + PACKETLOSS=`echo "${PACKETLOSS_NOSIGN}%"` + else + EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` + if [[ $EFFECTIVE_BITRATE =~ .*Kbits/sec.* ]] + then + EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Kbits/sec.*##"` + FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000" | bc -l` + fi + if [[ $EFFECTIVE_BITRATE =~ .*Mbits/sec.* ]] + then + EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Mbits/sec.*##"` + FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000000" | bc -l` + fi + if [[ $EFFECTIVE_BITRATE =~ .*Gbits/sec.* ]] + then + EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Gbits/sec.*##"` + FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000000000" | bc -l` + fi + PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` + PERF_INT=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.0f", $0}'` + if [[ $PERF_INT -lt 90 ]] + then + echo " " >> ./test_simulator_results.html + else + echo " " >> ./test_simulator_results.html + fi + EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` + JITTER=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*Mbits/sec *##" -e "s#ms.*#ms#"` + PACKETLOSS=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*(##" -e "s#).*##"` + fi echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - fi - - if [ -f $ARCHIVES_LOC/${TMODE}_${BW}*iperf*dl*client*txt ] - then - IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}*iperf*client*txt` - else - echo "There are no iperf files" - IPERF_TESTS="" - fi - for IPERF_CASE in $IPERF_TESTS - do - echo " " >> ./test_simulator_results.html - NAME=`echo $IPERF_CASE | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - CMD=`egrep "COMMAND IS" $IPERF_CASE | sed -e "s#COMMAND IS: ##"` - echo " " >> ./test_simulator_results.html - REQ_BITRATE=`echo $CMD | sed -e "s#^.*-b ##" -e "s#-i 1.*##"` - if [[ $REQ_BITRATE =~ .*K.* ]] - then - REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#K##"` - FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000.0" | bc -l` - fi - if [[ $REQ_BITRATE =~ .*M.* ]] - then - REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#M##"` - FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000000.0" | bc -l` - fi - if [[ $REQ_BITRATE =~ .*G.* ]] - then - REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#G##"` - FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000000000.0" | bc -l` - fi - FILE_COMPLETE=`egrep -c "Server Report" $IPERF_CASE` - if [ $FILE_COMPLETE -eq 0 ] - then - echo " " >> ./test_simulator_results.html - SERVER_FILE=`echo $IPERF_CASE | sed -e "s#client#server#"` - FLOAT_EFF_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'` - EFFECTIVE_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}}'` - PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` - JITTER=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*/sec *##" -e "s# *ms.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'` - PACKETLOSS_NOSIGN=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*(##" -e "s#%.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'` - PACKETLOSS=`echo "${PACKETLOSS_NOSIGN}%"` - else - EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` - if [[ $EFFECTIVE_BITRATE =~ .*Kbits/sec.* ]] - then - EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Kbits/sec.*##"` - FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000" | bc -l` - fi - if [[ $EFFECTIVE_BITRATE =~ .*Mbits/sec.* ]] - then - EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Mbits/sec.*##"` - FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000000" | bc -l` - fi - if [[ $EFFECTIVE_BITRATE =~ .*Gbits/sec.* ]] - then - EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Gbits/sec.*##"` - FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000000000" | bc -l` - fi - PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` - PERF_INT=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.0f", $0}'` - if [[ $PERF_INT -lt 90 ]] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` - JITTER=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*Mbits/sec *##" -e "s#ms.*#ms#"` - PACKETLOSS=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*(##" -e "s#).*##"` - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + done done done - done - echo "
Log File NameCommandStatusStatistics
$NAME_ENB --- $NAME_UEN/AOKKO
" >> ./test_simulator_results.html
-                if [ $NB_ENB_GOT_SYNC -eq 1 ]
-                then
-                    echo "- eNB --> got sync" >> ./test_simulator_results.html
-                else
-                    echo "- eNB NEVER got sync" >> ./test_simulator_results.html
-                fi
-                if [ $NB_UE_GOT_SYNC -eq 2 ]
-                then
-                    echo "- UE --> got sync" >> ./test_simulator_results.html
-                else
-                    echo "- UE NEVER got sync" >> ./test_simulator_results.html
-                fi
-                if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
-                then
-                    echo "- UE attached to eNB" >> ./test_simulator_results.html
-                else
-                    echo "- UE NEVER attached to eNB" >> ./test_simulator_results.html
-                fi
-                NB_SEGFAULT_ENB=`egrep -i -c "Segmentation Fault" $ENB_LOG`
-                if [ $NB_SEGFAULT_ENB -ne 0 ]
-                then
-                    echo "- eNB --> Segmentation Fault" >> ./test_simulator_results.html
-                fi
-                NB_SEGFAULT_UE=`egrep -i -c "Segmentation Fault" $UE_LOG`
-                if [ $NB_SEGFAULT_UE -ne 0 ]
-                then
-                    echo "- UE --> Segmentation Fault" >> ./test_simulator_results.html
-                fi
-                NB_ASSERTION_ENB=`egrep -i -c "Assertion" $ENB_LOG`
-                if [ $NB_ASSERTION_ENB -ne 0 ]
-                then
-                    echo "- eNB --> Assertion" >> ./test_simulator_results.html
-                    awk 'BEGIN{assertion=10}{if(assertion < 3){print "    " $0; assertion++};if ($0 ~/Assertion/){print "    " $0;assertion=1}}END{}' $ENB_LOG >> ./test_simulator_results.html
-                fi
-                NB_ASSERTION_UE=`egrep -i -c "Assertion" $UE_LOG`
-                if [ $NB_ASSERTION_UE -ne 0 ]
-                then
-                    echo "- eNB --> Assertion" >> ./test_simulator_results.html
-                    awk 'BEGIN{assertion=10}{if(assertion < 3){print "    " $0; assertion++};if ($0 ~/Assertion/){print "    " $0;assertion=1}}END{}' $UE_LOG >> ./test_simulator_results.html
-                fi
-                echo "        
$NAME$CMDKO
$NAME_ENB --- $NAME_UEN/AOKKO
" >> ./test_simulator_results.html
+                    if [ $NB_ENB_GOT_SYNC -eq 1 ]
+                    then
+                        echo "- eNB --> got sync" >> ./test_simulator_results.html
+                    else
+                        echo "- eNB NEVER got sync" >> ./test_simulator_results.html
+                    fi
+                    if [ $NB_UE_GOT_SYNC -eq 2 ]
+                    then
+                        echo "- UE --> got sync" >> ./test_simulator_results.html
+                    else
+                        echo "- UE NEVER got sync" >> ./test_simulator_results.html
+                    fi
+                    if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
+                    then
+                        echo "- UE attached to eNB" >> ./test_simulator_results.html
+                    else
+                        echo "- UE NEVER attached to eNB" >> ./test_simulator_results.html
+                    fi
+                    NB_SEGFAULT_ENB=`egrep -i -c "Segmentation Fault" $ENB_LOG`
+                    if [ $NB_SEGFAULT_ENB -ne 0 ]
+                    then
+                        echo "- eNB --> Segmentation Fault" >> ./test_simulator_results.html
+                    fi
+                    NB_SEGFAULT_UE=`egrep -i -c "Segmentation Fault" $UE_LOG`
+                    if [ $NB_SEGFAULT_UE -ne 0 ]
+                    then
+                        echo "- UE --> Segmentation Fault" >> ./test_simulator_results.html
+                    fi
+                    NB_ASSERTION_ENB=`egrep -i -c "Assertion" $ENB_LOG`
+                    if [ $NB_ASSERTION_ENB -ne 0 ]
+                    then
+                        echo "- eNB --> Assertion" >> ./test_simulator_results.html
+                        awk 'BEGIN{assertion=10}{if(assertion < 3){print "    " $0; assertion++};if ($0 ~/Assertion/){print "    " $0;assertion=1}}END{}' $ENB_LOG >> ./test_simulator_results.html
+                    fi
+                    NB_ASSERTION_UE=`egrep -i -c "Assertion" $UE_LOG`
+                    if [ $NB_ASSERTION_UE -ne 0 ]
+                    then
+                        echo "- eNB --> Assertion" >> ./test_simulator_results.html
+                        awk 'BEGIN{assertion=10}{if(assertion < 3){print "    " $0; assertion++};if ($0 ~/Assertion/){print "    " $0;assertion=1}}END{}' $UE_LOG >> ./test_simulator_results.html
+                    fi
+                    echo "        
$NAME$CMDKON/AOKKO" >> ./test_simulator_results.html + echo "
" >> ./test_simulator_results.html
+                        STATS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*received, ##" -e "s#, time.*##" -e "s# packet loss##"`
+                        echo "Packet Loss : $STATS" >> ./test_simulator_results.html
+                        RTTMIN=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[1] " " $5}'`
+                        echo "RTT Minimal : $RTTMIN" >> ./test_simulator_results.html
+                        RTTAVG=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[2] " " $5}'`
+                        echo "RTT Average : $RTTAVG" >> ./test_simulator_results.html
+                        RTTMAX=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[3] " " $5}'`
+                        echo "RTT Maximal : $RTTMAX" >> ./test_simulator_results.html
+                        echo "            
" >> ./test_simulator_results.html + echo "
$NAME$CMDKOKOOK" >> ./test_simulator_results.html echo "
" >> ./test_simulator_results.html
-                    STATS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*received, ##" -e "s#, time.*##" -e "s# packet loss##"`
-                    echo "Packet Loss : $STATS" >> ./test_simulator_results.html
-                    RTTMIN=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[1] " " $5}'`
-                    echo "RTT Minimal : $RTTMIN" >> ./test_simulator_results.html
-                    RTTAVG=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[2] " " $5}'`
-                    echo "RTT Average : $RTTAVG" >> ./test_simulator_results.html
-                    RTTMAX=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[3] " " $5}'`
-                    echo "RTT Maximal : $RTTMAX" >> ./test_simulator_results.html
+                    echo "Bitrate      : $EFFECTIVE_BITRATE" >> ./test_simulator_results.html
+                    echo "Bitrate Perf : $PERF %" >> ./test_simulator_results.html
+                    echo "Jitter       : $JITTER" >> ./test_simulator_results.html
+                    echo "Packet Loss  : $PACKETLOSS" >> ./test_simulator_results.html
                     echo "            
" >> ./test_simulator_results.html echo "
$NAME$CMDKOKOOK" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html
-                echo "Bitrate      : $EFFECTIVE_BITRATE" >> ./test_simulator_results.html
-                echo "Bitrate Perf : $PERF %" >> ./test_simulator_results.html
-                echo "Jitter       : $JITTER" >> ./test_simulator_results.html
-                echo "Packet Loss  : $PACKETLOSS" >> ./test_simulator_results.html
-                echo "            
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html -fi + echo " " >> ./test_simulator_results.html + fi -ARCHIVES_LOC=archives/phy_sim/test -if [ -d $ARCHIVES_LOC ] -then - echo "

Physical Simulators Check

" >> ./test_simulator_results.html + ARCHIVES_LOC=archives/phy_sim/test + if [ -d $ARCHIVES_LOC ] + then + echo "

Physical Simulators Check

" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - XML_TESTS=`ls $ARCHIVES_LOC/*xml` - for XML_FILE in $XML_TESTS - do - echo " " >> ./test_simulator_results.html - NAME=`echo $XML_FILE | sed -e "s#$ARCHIVES_LOC/##"` - NB_TESTS=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*tests='##" -e "s#' *time=.*##"` - NB_ERRORS=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*errors='##" -e "s#' *failures=.*##"` - NB_FAILURES=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*failures='##" -e "s#' *hostname=.*##"` - NB_SKIPPED=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*skipped='##" -e "s#' *tests=.*##"` - if [ $NB_ERRORS -eq 0 ] && [ $NB_FAILURES -eq 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - done - - echo "
Log File NameNb TestsNb ErrorsNb FailuresNb Failures
$NAME$NAME$NB_TESTS$NB_ERRORS$NB_FAILURES$NB_SKIPPED
" >> ./test_simulator_results.html - - echo "

Details

" >> ./test_simulator_results.html - for XML_FILE in $XML_TESTS - do echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - TESTCASES_LIST=`sed -e "s# #@#g" $XML_FILE | grep testcase` - for TESTCASE in $TESTCASES_LIST + + XML_TESTS=`ls $ARCHIVES_LOC/*xml` + for XML_FILE in $XML_TESTS do echo " " >> ./test_simulator_results.html - NAME=`echo $TESTCASE | sed -e "s#^.*name='##" -e "s#'@description=.*##" | sed -e "s#@# #g"` - echo " " >> ./test_simulator_results.html - DESC=`echo $TESTCASE | sed -e "s#^.*description='##" -e "s#'@Run_result=.*##" | sed -e "s#@# #g"` - echo " " >> ./test_simulator_results.html - RESULT=`echo $TESTCASE | sed -e "s#^.*RESULT='##" -e "s#'.*##" | sed -e "s#@# #g"` - if [[ $RESULT =~ .*PASS.* ]] + NAME=`echo $XML_FILE | sed -e "s#$ARCHIVES_LOC/##"` + NB_TESTS=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*tests='##" -e "s#' *time=.*##"` + NB_ERRORS=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*errors='##" -e "s#' *failures=.*##"` + NB_FAILURES=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*failures='##" -e "s#' *hostname=.*##"` + NB_SKIPPED=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*skipped='##" -e "s#' *tests=.*##"` + if [ $NB_ERRORS -eq 0 ] && [ $NB_FAILURES -eq 0 ] then - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html else - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html fi - TIME=`echo $TESTCASE | sed -e "s#^.*time='##" -e "s#'@RESULT=.*##" | sed -e "s#@# #g"` - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html done + echo "
Test NameDescriptionResultTimeLog File NameNb TestsNb ErrorsNb FailuresNb Failures
$NAME$DESC$RESULT$NAME$RESULT$NAME$TIME$NB_TESTS$NB_ERRORS$NB_FAILURES$NB_SKIPPED
" >> ./test_simulator_results.html - done -fi -echo "" >> ./test_simulator_results.html -echo "" >> ./test_simulator_results.html + echo "

Details

" >> ./test_simulator_results.html + for XML_FILE in $XML_TESTS + do + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + PREV_SECTION=0 + PREV_TIME_IN_SECS=0 + TESTCASES_LIST=`sed -e "s# #@#g" $XML_FILE | grep testcase` + for TESTCASE in $TESTCASES_LIST + do + NAME=`echo $TESTCASE | sed -e "s#^.*name='##" -e "s#'@description=.*##" | sed -e "s#@# #g"` + SECTION=`echo $NAME | sed -e "s#\..*##"` + if [ $SECTION != $PREV_SECTION ] + then + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + PREV_SECTION=$SECTION + PREV_TIME_IN_SECS=0 + fi + DESC=`echo $TESTCASE | sed -e "s#^.*description='##" -e "s#'@Run_result=.*##" | sed -e "s#@# #g"` + RESULT=`echo $TESTCASE | sed -e "s#^.*RESULT='##" -e "s#'.*##" | sed -e "s#@# #g"` + TIME_IN_SECS=`echo $TESTCASE | sed -e "s#^.*time='##" -e "s#'@RESULT=.*##" | sed -e "s#@# #g" -e "s# s.*##"` + TIME=`echo "$TIME_IN_SECS - $PREV_TIME_IN_SECS" | bc -l | awk '{printf "%.2f s", $0}'` + PREV_TIME_IN_SECS=$TIME_IN_SECS + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + if [[ $RESULT =~ .*PASS.* ]] + then + echo " " >> ./test_simulator_results.html + else + SPLITTED_LINE=`echo -e $TESTCASE | sed -e "s#@#\n#g"` + NB_RUNS=`echo -e "${SPLITTED_LINE}" | grep -v Run_result | egrep -c "Run_"` + NB_FAILS=`echo -e "${SPLITTED_LINE}" | grep -v Run_result | egrep -c "=FAIL"` + echo " " >> ./test_simulator_results.html + fi + echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html + done + echo "
Test NameDescriptionResultTime
\"$SECTION\" series
$NAME$DESC$RESULT${RESULT} (${NB_FAILS}/${NB_RUNS})$TIME
" >> ./test_simulator_results.html + done + fi -exit 0 + echo "" >> ./test_simulator_results.html + echo "" >> ./test_simulator_results.html +} diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 0d4f116179..527fe48edb 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -20,15 +20,18 @@ # * contact@openairinterface.org # */ -function usage { - echo "OAI VM Test Run script" +function run_test_usage { + echo "OAI CI VM script" echo " Original Author: Raphael Defosseux" + echo " Requirements:" + echo " -- uvtool uvtool-libvirt apt-cacher" + echo " -- xenial image already synced" echo " Default:" echo " -- eNB with USRP" echo "" echo "Usage:" echo "------" - echo " runTestOnVM.sh [OPTIONS]" + echo " oai-ci-vm-tool test [OPTIONS]" echo "" echo "Options:" echo "--------" @@ -41,12 +44,7 @@ function usage { echo " --workspace #### OR -ws ####" echo " Specify the workspace." echo "" - echo " --variant enb-usrp OR -v1" - echo " --variant basic-sim OR -v2" - echo " --variant phy-sim OR -v3" - echo " --variant cppcheck OR -v4" - echo " --variant enb-ethernet OR -v7" - echo " --variant ue-ethernet OR -v8" + variant_usage echo " Specify the variant to build." echo "" echo " --keep-vm-alive OR -k" @@ -57,19 +55,6 @@ function usage { echo "" } -function variant_usage { - echo "OAI VM Test Run script" - echo " Original Author: Raphael Defosseux" - echo "" - echo " --variant enb-usrp OR -v1" - echo " --variant basic-sim OR -v2" - echo " --variant phy-sim OR -v3" - echo " --variant cppcheck OR -v4" - echo " --variant enb-ethernet OR -v7" - echo " --variant ue-ethernet OR -v8" - echo "" -} - function start_basic_sim_enb { local LOC_VM_IP_ADDR=$2 local LOC_EPC_IP_ADDR=$3 @@ -95,6 +80,7 @@ function start_basic_sim_enb { echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE\" > ./my-lte-softmodem-run.sh " >> $1 echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 + echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/enb -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 @@ -112,6 +98,7 @@ function start_basic_sim_ue { echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --ue-rxgain 140\" > ./my-lte-uesoftmodem-run.sh" >> $1 echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1 echo "cat ./my-lte-uesoftmodem-run.sh" >> $1 + echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1 echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/ue -o /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ./my-lte-uesoftmodem-run.sh" >> $1 ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1 @@ -299,740 +286,619 @@ function terminate_ltebox_epc { rm $1 } -if [ $# -lt 1 ] || [ $# -gt 9 ] -then - echo "Syntax Error: not the correct number of arguments" - echo "" - usage - exit 1 -fi - -VM_TEMPLATE=ci- -JOB_NAME=XX -BUILD_ID=XX -VM_NAME=ci-enb-usrp -ARCHIVES_LOC=enb_usrp/test -KEEP_VM_ALIVE=0 -RUN_OPTIONS="none" -STATUS=0 - -while [[ $# -gt 0 ]] -do -key="$1" - -case $key in - -h|--help) - shift - usage - exit 0 - ;; - -jn|--job-name) - JOB_NAME="$2" - shift - shift - ;; - -id|--build-id) - BUILD_ID="$2" - shift - shift - ;; - -ws|--workspace) - JENKINS_WKSP="$2" - shift - shift - ;; - -k|--keep-vm-alive) - KEEP_VM_ALIVE=1 - shift - ;; - -v1) - VM_NAME=ci-enb-usrp - shift - ;; - -v2) - VM_NAME=ci-basic-sim - RUN_OPTIONS="complex" - ARCHIVES_LOC=basic_sim/test - shift - ;; - -v3) - VM_NAME=ci-phy-sim - RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b" - ARCHIVES_LOC=phy_sim/test - shift - ;; - -v4) - VM_NAME=ci-cppcheck - shift - ;; - -v7) - VM_NAME=ci-enb-ethernet - shift - ;; - -v8) - VM_NAME=ci-ue-ethernet - shift - ;; - --variant) - variant="$2" - case $variant in - enb-usrp) - VM_NAME=ci-enb-usrp - ;; - basic-sim) - VM_NAME=ci-basic-sim - RUN_OPTIONS="complex" - ARCHIVES_LOC=basic_sim/test - ;; - phy-sim) - VM_NAME=ci-phy-sim - RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b" - ARCHIVES_LOC=phy_sim/test - ;; - cppcheck) - VM_NAME=ci-cppcheck - ;; - enb-ethernet) - VM_NAME=ci-enb-ethernet - ;; - ue-ethernet) - VM_NAME=ci-ue-ethernet - ;; - *) - echo "" - echo "Syntax Error: Invalid Variant option -> $variant" - echo "" - variant_usage - exit 1 - esac - shift - shift - ;; - *) - echo "Syntax Error: unknown option: $key" - echo "" - usage - exit 1 -esac -done - -if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] -then - VM_TEMPLATE=ci- -else - VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}- -fi - -VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"` -VM_CMDS=${VM_NAME}_cmds.txt -ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC} - -echo "VM_NAME = $VM_NAME" -echo "VM_CMD_FILE = $VM_CMDS" -echo "JENKINS_WKSP = $JENKINS_WKSP" -echo "ARCHIVES_LOC = $ARCHIVES_LOC" - -echo "############################################################" -echo "Waiting for VM to be started" -echo "############################################################" -uvt-kvm wait $VM_NAME --insecure - -VM_IP_ADDR=`uvt-kvm ip $VM_NAME` -echo "$VM_NAME has for IP addr = $VM_IP_ADDR" - -if [ "$RUN_OPTIONS" == "none" ] -then - echo "No run on VM testing for this variant currently" - exit $STATUS -fi - -if [[ $RUN_OPTIONS =~ .*run_exec_autotests.* ]] -then +function run_test_on_vm { echo "############################################################" - echo "Running test script on VM ($VM_NAME)" + echo "OAI CI VM script" echo "############################################################" - echo "echo \"sudo apt-get --yes --quiet install bc \"" > $VM_CMDS - echo "sudo apt-get update > bc-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install bc >> bc-install.txt 2>&1" >> $VM_CMDS - echo "cd tmp" >> $VM_CMDS - echo "echo \"source oaienv\"" >> $VM_CMDS - echo "source oaienv" >> $VM_CMDS - echo "echo \"cd cmake_targets/autotests\"" >> $VM_CMDS - echo "cd cmake_targets/autotests" >> $VM_CMDS - echo "echo \"rm -Rf log\"" >> $VM_CMDS - echo "rm -Rf log" >> $VM_CMDS - echo "$RUN_OPTIONS" | sed -e 's@"@\\"@g' -e 's@^@echo "@' -e 's@$@"@' >> $VM_CMDS - echo "$RUN_OPTIONS" >> $VM_CMDS - echo "cp /home/ubuntu/bc-install.txt log" >> $VM_CMDS - echo "cd log" >> $VM_CMDS - echo "zip -r -qq tmp.zip *.* 0*" >> $VM_CMDS - - ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS + echo "VM_NAME = $VM_NAME" + echo "VM_CMD_FILE = $VM_CMDS" + echo "JENKINS_WKSP = $JENKINS_WKSP" + echo "ARCHIVES_LOC = $ARCHIVES_LOC" echo "############################################################" - echo "Creating a tmp folder to store results and artifacts" + echo "Waiting for VM to be started" echo "############################################################" + uvt-kvm wait $VM_NAME --insecure - if [ -d $ARCHIVES_LOC ] + VM_IP_ADDR=`uvt-kvm ip $VM_NAME` + echo "$VM_NAME has for IP addr = $VM_IP_ADDR" + + if [ "$RUN_OPTIONS" == "none" ] then - rm -Rf $ARCHIVES_LOC + echo "No run on VM testing for this variant currently" + exit $STATUS fi - mkdir --parents $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/autotests/log/tmp.zip $ARCHIVES_LOC - pushd $ARCHIVES_LOC - unzip -qq -DD tmp.zip - rm tmp.zip - if [ -f results_autotests.xml ] - then - FUNCTION=`echo $VM_NAME | sed -e "s@$VM_TEMPLATE@@"` - NEW_NAME=`echo "results_autotests.xml" | sed -e "s@results_autotests@results_autotests-$FUNCTION@"` - echo "" > $NEW_NAME - echo "" >> $NEW_NAME - cat results_autotests.xml >> $NEW_NAME - sed -e "s@TEMPLATE@$FUNCTION@" $JENKINS_WKSP/ci-scripts/template.xsl > $FUNCTION.xsl - #mv results_autotests.xml $NEW_NAME - rm results_autotests.xml - fi - popd - - if [ $KEEP_VM_ALIVE -eq 0 ] + if [[ $RUN_OPTIONS =~ .*run_exec_autotests.* ]] then echo "############################################################" - echo "Destroying VM" + echo "Running test script on VM ($VM_NAME)" echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR - fi - rm -f $VM_CMDS + echo "echo \"sudo apt-get --yes --quiet install bc \"" > $VM_CMDS + echo "sudo apt-get update > bc-install.txt 2>&1" >> $VM_CMDS + echo "sudo apt-get --yes install bc >> bc-install.txt 2>&1" >> $VM_CMDS + echo "cd tmp" >> $VM_CMDS + echo "echo \"source oaienv\"" >> $VM_CMDS + echo "source oaienv" >> $VM_CMDS + echo "echo \"cd cmake_targets/autotests\"" >> $VM_CMDS + echo "cd cmake_targets/autotests" >> $VM_CMDS + echo "echo \"rm -Rf log\"" >> $VM_CMDS + echo "rm -Rf log" >> $VM_CMDS + echo "$RUN_OPTIONS" | sed -e 's@"@\\"@g' -e 's@^@echo "@' -e 's@$@"@' >> $VM_CMDS + echo "$RUN_OPTIONS" >> $VM_CMDS + echo "cp /home/ubuntu/bc-install.txt log" >> $VM_CMDS + echo "cd log" >> $VM_CMDS + echo "zip -r -qq tmp.zip *.* 0*" >> $VM_CMDS - echo "############################################################" - echo "Checking run status" - echo "############################################################" + ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS - LOG_FILES=`ls $ARCHIVES_LOC/results_autotests*.xml` - NB_FOUND_FILES=0 - NB_RUNS=0 - NB_FAILURES=0 + echo "############################################################" + echo "Creating a tmp folder to store results and artifacts" + echo "############################################################" - for FULLFILE in $LOG_FILES - do - TESTSUITES=`egrep "testsuite errors" $FULLFILE` - for TESTSUITE in $TESTSUITES - do - if [[ "$TESTSUITE" == *"tests="* ]] - then - RUNS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" ` - NB_RUNS=$((NB_RUNS + RUNS)) - fi - if [[ "$TESTSUITE" == *"failures="* ]] - then - FAILS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" ` - NB_FAILURES=$((NB_FAILURES + FAILS)) - fi - done - NB_FOUND_FILES=$((NB_FOUND_FILES + 1)) - done - - echo "NB_FOUND_FILES = $NB_FOUND_FILES" - echo "NB_RUNS = $NB_RUNS" - echo "NB_FAILURES = $NB_FAILURES" - - if [ $NB_FOUND_FILES -eq 0 ]; then STATUS=-1; fi - if [ $NB_RUNS -eq 0 ]; then STATUS=-1; fi - if [ $NB_FAILURES -ne 0 ]; then STATUS=-1; fi - -fi - -if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-basic-sim.* ]] -then - PING_STATUS=0 - IPERF_STATUS=0 - if [ -d $ARCHIVES_LOC ] - then - rm -Rf $ARCHIVES_LOC - fi - mkdir --parents $ARCHIVES_LOC - - EPC_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#epc#"` - LTEBOX=0 - if [ -d /opt/ltebox-archives/ ] - then - # Checking if all ltebox archives are available to run ltebx epc on a brand new VM - if [ -f /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ] && [ -f /opt/ltebox-archives/etc-conf.zip ] && [ -f /opt/ltebox-archives/hss-sim.zip ] + if [ -d $ARCHIVES_LOC ] then - echo "############################################################" - echo "Test EPC on VM ($EPC_VM_NAME) will be using ltebox" - echo "############################################################" - LTEBOX=1 + rm -Rf $ARCHIVES_LOC fi - fi - # Here we could have other types of EPC detection + mkdir --parents $ARCHIVES_LOC - # Do we need to start the EPC VM - EPC_VM_CMDS=`echo $VM_CMDS | sed -e "s#cmds#epc-cmds#"` - echo "EPC_VM_CMD_FILE = $EPC_VM_CMDS" - IS_EPC_VM_ALIVE=`uvt-kvm list | grep -c $EPC_VM_NAME` - if [ $IS_EPC_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "Creating test EPC VM ($EPC_VM_NAME) on Ubuntu Cloud Image base" - echo "############################################################" - uvt-kvm create $EPC_VM_NAME release=xenial --unsafe-caching - fi + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/autotests/log/tmp.zip $ARCHIVES_LOC + pushd $ARCHIVES_LOC + unzip -qq -DD tmp.zip + rm tmp.zip + if [ -f results_autotests.xml ] + then + FUNCTION=`echo $VM_NAME | sed -e "s@$VM_TEMPLATE@@"` + NEW_NAME=`echo "results_autotests.xml" | sed -e "s@results_autotests@results_autotests-$FUNCTION@"` + echo "" > $NEW_NAME + echo "" >> $NEW_NAME + cat results_autotests.xml >> $NEW_NAME + sed -e "s@TEMPLATE@$FUNCTION@" $JENKINS_WKSP/ci-scripts/template.xsl > $FUNCTION.xsl + #mv results_autotests.xml $NEW_NAME + rm results_autotests.xml + fi + popd - uvt-kvm wait $EPC_VM_NAME --insecure - EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` - echo "$EPC_VM_NAME has for IP addr = $EPC_VM_IP_ADDR" - scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu - - # ltebox specific actions (install and start) - LTE_BOX_TO_INSTALL=1 - if [ $LTEBOX -eq 1 ] - then - echo "ls -ls /opt/ltebox/tools/start_ltebox" > $EPC_VM_CMDS - RESPONSE=`ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS` - NB_EXES=`echo $RESPONSE | grep -c ltebox` - if [ $NB_EXES -eq 1 ]; then LTE_BOX_TO_INSTALL=0; fi - fi - - if [ $LTEBOX -eq 1 ] && [ $LTE_BOX_TO_INSTALL -eq 1 ] - then - echo "############################################################" - echo "Copying ltebox archives into EPC VM ($EPC_VM_NAME)" - echo "############################################################" - scp -o StrictHostKeyChecking=no /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu - scp -o StrictHostKeyChecking=no /opt/ltebox-archives/etc-conf.zip ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu - scp -o StrictHostKeyChecking=no /opt/ltebox-archives/hss-sim.zip ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu - - echo "############################################################" - echo "Install EPC on EPC VM ($EPC_VM_NAME)" - echo "############################################################" - echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $EPC_VM_CMDS - echo "touch /home/ubuntu/.hushlogin" >> $EPC_VM_CMDS - echo "echo \"sudo apt-get --yes --quiet install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf\"" >> $EPC_VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $EPC_VM_CMDS - echo "sudo apt-get --yes install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf >> zip-install.txt 2>&1" >> $EPC_VM_CMDS - - # Installing HSS - echo "echo \"cd /opt\"" >> $EPC_VM_CMDS - echo "cd /opt" >> $EPC_VM_CMDS - echo "echo \"sudo unzip -qq /home/ubuntu/hss-sim.zip\"" >> $EPC_VM_CMDS - echo "sudo unzip -qq /home/ubuntu/hss-sim.zip" >> $EPC_VM_CMDS - echo "echo \"cd /opt/hss_sim0609\"" >> $EPC_VM_CMDS - echo "cd /opt/hss_sim0609" >> $EPC_VM_CMDS - - # Installing ltebox - echo "echo \"cd /home/ubuntu\"" >> $EPC_VM_CMDS - echo "cd /home/ubuntu" >> $EPC_VM_CMDS - echo "echo \"sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb \"" >> $EPC_VM_CMDS - echo "sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb >> zip-install.txt 2>&1" >> $EPC_VM_CMDS - - echo "echo \"cd /opt/ltebox/etc/\"" >> $EPC_VM_CMDS - echo "cd /opt/ltebox/etc/" >> $EPC_VM_CMDS - echo "echo \"sudo unzip -qq -o /home/ubuntu/etc-conf.zip\"" >> $EPC_VM_CMDS - echo "sudo unzip -qq -o /home/ubuntu/etc-conf.zip" >> $EPC_VM_CMDS - echo "sudo sed -i -e 's#EPC_VM_IP_ADDRESS#$EPC_VM_IP_ADDR#' gw.conf" >> $EPC_VM_CMDS - echo "sudo sed -i -e 's#EPC_VM_IP_ADDRESS#$EPC_VM_IP_ADDR#' mme.conf" >> $EPC_VM_CMDS - fi - - # Starting EPC - if [ $LTEBOX -eq 1 ] - then - echo "############################################################" - echo "Start EPC on EPC VM ($EPC_VM_NAME)" - echo "############################################################" - echo "echo \"cd /opt/hss_sim0609\"" >> $EPC_VM_CMDS - echo "cd /opt/hss_sim0609" >> $EPC_VM_CMDS - echo "echo \"sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real\"" >> $EPC_VM_CMDS - echo "sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real" >> $EPC_VM_CMDS - - echo "echo \"cd /opt/ltebox/tools/\"" >> $EPC_VM_CMDS - echo "cd /opt/ltebox/tools/" >> $EPC_VM_CMDS - echo "echo \"sudo ./start_ltebox\"" >> $EPC_VM_CMDS - echo "nohup sudo ./start_ltebox > /home/ubuntu/ltebox.txt" >> $EPC_VM_CMDS - - ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS - rm -f $EPC_VM_CMDS - - # We may have some adaptation to do - if [ -f /opt/ltebox-archives/adapt_ue_sim.txt ] + if [ $KEEP_VM_ALIVE -eq 0 ] then echo "############################################################" - echo "Doing some adaptation on UE side" + echo "Destroying VM" echo "############################################################" - ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < /opt/ltebox-archives/adapt_ue_sim.txt + uvt-kvm destroy $VM_NAME + ssh-keygen -R $VM_IP_ADDR + fi + rm -f $VM_CMDS + + echo "############################################################" + echo "Checking run status" + echo "############################################################" + + LOG_FILES=`ls $ARCHIVES_LOC/results_autotests*.xml` + NB_FOUND_FILES=0 + NB_RUNS=0 + NB_FAILURES=0 + + for FULLFILE in $LOG_FILES + do + TESTSUITES=`egrep "testsuite errors" $FULLFILE` + for TESTSUITE in $TESTSUITES + do + if [[ "$TESTSUITE" == *"tests="* ]] + then + RUNS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" ` + NB_RUNS=$((NB_RUNS + RUNS)) + fi + if [[ "$TESTSUITE" == *"failures="* ]] + then + FAILS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" ` + NB_FAILURES=$((NB_FAILURES + FAILS)) + fi + done + NB_FOUND_FILES=$((NB_FOUND_FILES + 1)) + done + + echo "NB_FOUND_FILES = $NB_FOUND_FILES" + echo "NB_RUNS = $NB_RUNS" + echo "NB_FAILURES = $NB_FAILURES" + + if [ $NB_FOUND_FILES -eq 0 ]; then STATUS=-1; fi + if [ $NB_RUNS -eq 0 ]; then STATUS=-1; fi + if [ $NB_FAILURES -ne 0 ]; then STATUS=-1; fi + + fi + + if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-basic-sim.* ]] + then + PING_STATUS=0 + IPERF_STATUS=0 + if [ -d $ARCHIVES_LOC ] + then + rm -Rf $ARCHIVES_LOC + fi + mkdir --parents $ARCHIVES_LOC + + EPC_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#epc#"` + LTEBOX=0 + if [ -d /opt/ltebox-archives/ ] + then + # Checking if all ltebox archives are available to run ltebx epc on a brand new VM + if [ -f /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ] && [ -f /opt/ltebox-archives/etc-conf.zip ] && [ -f /opt/ltebox-archives/hss-sim.zip ] + then + echo "############################################################" + echo "Test EPC on VM ($EPC_VM_NAME) will be using ltebox" + echo "############################################################" + LTEBOX=1 + fi + fi + # Here we could have other types of EPC detection + + # Do we need to start the EPC VM + EPC_VM_CMDS=`echo $VM_CMDS | sed -e "s#cmds#epc-cmds#"` + echo "EPC_VM_CMD_FILE = $EPC_VM_CMDS" + IS_EPC_VM_ALIVE=`uvt-kvm list | grep -c $EPC_VM_NAME` + if [ $IS_EPC_VM_ALIVE -eq 0 ] + then + echo "############################################################" + echo "Creating test EPC VM ($EPC_VM_NAME) on Ubuntu Cloud Image base" + echo "############################################################" + uvt-kvm create $EPC_VM_NAME release=xenial --unsafe-caching fi - i="0" - echo "ifconfig tun5 | egrep -c \"inet addr\"" > $EPC_VM_CMDS - while [ $i -lt 10 ] - do - sleep 2 - CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - fi - done - rm $EPC_VM_CMDS - if [ $i -lt 50 ] + uvt-kvm wait $EPC_VM_NAME --insecure + EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` + echo "$EPC_VM_NAME has for IP addr = $EPC_VM_IP_ADDR" + scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu + + # ltebox specific actions (install and start) + LTE_BOX_TO_INSTALL=1 + if [ $LTEBOX -eq 1 ] then - echo "Problem w/ starting ltebox EPC" + echo "ls -ls /opt/ltebox/tools/start_ltebox" > $EPC_VM_CMDS + RESPONSE=`ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS` + NB_EXES=`echo $RESPONSE | grep -c ltebox` + if [ $NB_EXES -eq 1 ]; then LTE_BOX_TO_INSTALL=0; fi + fi + + if [ $LTEBOX -eq 1 ] && [ $LTE_BOX_TO_INSTALL -eq 1 ] + then + echo "############################################################" + echo "Copying ltebox archives into EPC VM ($EPC_VM_NAME)" + echo "############################################################" + scp -o StrictHostKeyChecking=no /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu + scp -o StrictHostKeyChecking=no /opt/ltebox-archives/etc-conf.zip ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu + scp -o StrictHostKeyChecking=no /opt/ltebox-archives/hss-sim.zip ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu + + echo "############################################################" + echo "Install EPC on EPC VM ($EPC_VM_NAME)" + echo "############################################################" + echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $EPC_VM_CMDS + echo "touch /home/ubuntu/.hushlogin" >> $EPC_VM_CMDS + echo "echo \"sudo apt-get --yes --quiet install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf\"" >> $EPC_VM_CMDS + echo "sudo apt-get update > zip-install.txt 2>&1" >> $EPC_VM_CMDS + echo "sudo apt-get --yes install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf >> zip-install.txt 2>&1" >> $EPC_VM_CMDS + + # Installing HSS + echo "echo \"cd /opt\"" >> $EPC_VM_CMDS + echo "cd /opt" >> $EPC_VM_CMDS + echo "echo \"sudo unzip -qq /home/ubuntu/hss-sim.zip\"" >> $EPC_VM_CMDS + echo "sudo unzip -qq /home/ubuntu/hss-sim.zip" >> $EPC_VM_CMDS + echo "echo \"cd /opt/hss_sim0609\"" >> $EPC_VM_CMDS + echo "cd /opt/hss_sim0609" >> $EPC_VM_CMDS + + # Installing ltebox + echo "echo \"cd /home/ubuntu\"" >> $EPC_VM_CMDS + echo "cd /home/ubuntu" >> $EPC_VM_CMDS + echo "echo \"sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb \"" >> $EPC_VM_CMDS + echo "sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb >> zip-install.txt 2>&1" >> $EPC_VM_CMDS + + echo "echo \"cd /opt/ltebox/etc/\"" >> $EPC_VM_CMDS + echo "cd /opt/ltebox/etc/" >> $EPC_VM_CMDS + echo "echo \"sudo unzip -qq -o /home/ubuntu/etc-conf.zip\"" >> $EPC_VM_CMDS + echo "sudo unzip -qq -o /home/ubuntu/etc-conf.zip" >> $EPC_VM_CMDS + echo "sudo sed -i -e 's#EPC_VM_IP_ADDRESS#$EPC_VM_IP_ADDR#' gw.conf" >> $EPC_VM_CMDS + echo "sudo sed -i -e 's#EPC_VM_IP_ADDRESS#$EPC_VM_IP_ADDR#' mme.conf" >> $EPC_VM_CMDS + fi + + # Starting EPC + if [ $LTEBOX -eq 1 ] + then + echo "############################################################" + echo "Start EPC on EPC VM ($EPC_VM_NAME)" + echo "############################################################" + echo "echo \"cd /opt/hss_sim0609\"" >> $EPC_VM_CMDS + echo "cd /opt/hss_sim0609" >> $EPC_VM_CMDS + echo "echo \"sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real\"" >> $EPC_VM_CMDS + echo "sudo daemon --unsafe --name=simulated_hss --chdir=/opt/hss_sim0609 ./starthss_real" >> $EPC_VM_CMDS + + echo "echo \"cd /opt/ltebox/tools/\"" >> $EPC_VM_CMDS + echo "cd /opt/ltebox/tools/" >> $EPC_VM_CMDS + echo "echo \"sudo ./start_ltebox\"" >> $EPC_VM_CMDS + echo "nohup sudo ./start_ltebox > /home/ubuntu/ltebox.txt" >> $EPC_VM_CMDS + + ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS + rm -f $EPC_VM_CMDS + + # We may have some adaptation to do + if [ -f /opt/ltebox-archives/adapt_ue_sim.txt ] + then + echo "############################################################" + echo "Doing some adaptation on UE side" + echo "############################################################" + ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < /opt/ltebox-archives/adapt_ue_sim.txt + fi + + i="0" + echo "ifconfig tun5 | egrep -c \"inet addr\"" > $EPC_VM_CMDS + while [ $i -lt 10 ] + do + sleep 2 + CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS` + if [ $CONNECTED -eq 1 ] + then + i="100" + else + i=$[$i+1] + fi + done + rm $EPC_VM_CMDS + if [ $i -lt 50 ] + then + echo "Problem w/ starting ltebox EPC" + exit -1 + fi + fi + + # HERE ADD ANY INSTALL ACTIONS FOR ANOTHER EPC + + # Retrieve EPC real IP address + if [ $LTEBOX -eq 1 ] + then + # in our configuration file, we are using pool 5 + echo "ifconfig tun5 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $EPC_VM_CMDS + REAL_EPC_IP_ADDR=`ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS` + echo "EPC IP Address is : $REAL_EPC_IP_ADDR" + rm $EPC_VM_CMDS + fi + + echo "############################################################" + echo "Starting the eNB in FDD-5MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=fdd_05MHz_enb.log + start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-fdd-basic-sim.conf + + echo "############################################################" + echo "Starting the UE in FDD-5MHz mode" + echo "############################################################" + CURRENT_UE_LOG_FILE=fdd_05MHz_ue.log + start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2680 + if [ $UE_SYNC -eq 0 ] + then + echo "Problem w/ eNB and UE not syncing" + terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC + recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR exit -1 fi - fi + get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - # HERE ADD ANY INSTALL ACTIONS FOR ANOTHER EPC + echo "############################################################" + echo "Pinging the UE" + echo "############################################################" + PING_LOG_FILE=fdd_05MHz_ping_ue.txt + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - # Retrieve EPC real IP address - if [ $LTEBOX -eq 1 ] - then - # in our configuration file, we are using pool 5 - echo "ifconfig tun5 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $EPC_VM_CMDS - REAL_EPC_IP_ADDR=`ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS` - echo "EPC IP Address is : $REAL_EPC_IP_ADDR" - rm $EPC_VM_CMDS - fi + echo "############################################################" + echo "Iperf DL" + echo "############################################################" + CURR_IPERF_LOG_BASE=fdd_05MHz_iperf_dl + iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15 - echo "############################################################" - echo "Starting the eNB in FDD-5MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-fdd-basic-sim.conf + echo "############################################################" + echo "Iperf UL" + echo "############################################################" + CURR_IPERF_LOG_BASE=fdd_05MHz_iperf_ul + iperf_ul $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 2 $CURR_IPERF_LOG_BASE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 2 - echo "############################################################" - echo "Starting the UE in FDD-5MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2680 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" + echo "############################################################" + echo "Terminate enb/ue simulators" + echo "############################################################" terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - exit -1 - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR + sleep 10 - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 + echo "############################################################" + echo "Starting the eNB in FDD-10MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=fdd_10MHz_enb.log + start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 50 lte-fdd-basic-sim.conf - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_05MHz_iperf_dl - iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15 + echo "############################################################" + echo "Starting the UE in FDD-10MHz mode" + echo "############################################################" + CURRENT_UE_LOG_FILE=fdd_10MHz_ue.log + start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 50 2680 + if [ $UE_SYNC -eq 0 ] + then + echo "Problem w/ eNB and UE not syncing" + terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC + recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + exit -1 + fi + get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - echo "############################################################" - echo "Iperf UL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_05MHz_iperf_ul - iperf_ul $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 2 $CURR_IPERF_LOG_BASE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 2 + echo "############################################################" + echo "Pinging the UE" + echo "############################################################" + PING_LOG_FILE=fdd_10MHz_ping_ue.txt + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 + echo "############################################################" + echo "Iperf DL" + echo "############################################################" + CURR_IPERF_LOG_BASE=fdd_10MHz_iperf_dl + iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15 - echo "############################################################" - echo "Starting the eNB in FDD-10MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_10MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 50 lte-fdd-basic-sim.conf + echo "############################################################" + echo "Iperf UL" + echo "############################################################" + CURR_IPERF_LOG_BASE=fdd_10MHz_iperf_ul + iperf_ul $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 2 $CURR_IPERF_LOG_BASE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 2 - echo "############################################################" - echo "Starting the UE in FDD-10MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_10MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 50 2680 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" + echo "############################################################" + echo "Terminate enb/ue simulators" + echo "############################################################" terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - exit -1 - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR + sleep 10 - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=fdd_10MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 + echo "############################################################" + echo "Starting the eNB in FDD-20MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=fdd_20MHz_enb.log + start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 100 lte-fdd-basic-sim.conf - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_10MHz_iperf_dl - iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15 + echo "############################################################" + echo "Starting the UE in FDD-20MHz mode" + echo "############################################################" + CURRENT_UE_LOG_FILE=fdd_20MHz_ue.log + start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 100 2680 + if [ $UE_SYNC -eq 0 ] + then + echo "Problem w/ eNB and UE not syncing" + terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC + recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + exit -1 + fi + get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - echo "############################################################" - echo "Iperf UL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_10MHz_iperf_ul - iperf_ul $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 2 $CURR_IPERF_LOG_BASE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 2 + echo "############################################################" + echo "Pinging the UE" + echo "############################################################" + PING_LOG_FILE=fdd_20MHz_ping_ue.txt + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 + echo "############################################################" + echo "Iperf DL" + echo "############################################################" + CURR_IPERF_LOG_BASE=fdd_20MHz_iperf_dl + iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15 - echo "############################################################" - echo "Starting the eNB in FDD-20MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_20MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 100 lte-fdd-basic-sim.conf - - echo "############################################################" - echo "Starting the UE in FDD-20MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_20MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 100 2680 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" + echo "############################################################" + echo "Terminate enb/ue simulators" + echo "############################################################" terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - exit -1 - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR + sleep 10 - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=fdd_20MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 + echo "############################################################" + echo "Starting the eNB in TDD-5MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=tdd_05MHz_enb.log + start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-tdd-basic-sim.conf - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_20MHz_iperf_dl - iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15 + echo "############################################################" + echo "Starting the UE in TDD-5MHz mode" + echo "############################################################" + CURRENT_UE_LOG_FILE=tdd_05MHz_ue.log + start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2350 + if [ $UE_SYNC -eq 0 ] + then + echo "Problem w/ eNB and UE not syncing" + terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC + recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + exit -1 + fi + get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 + echo "############################################################" + echo "Pinging the UE" + echo "############################################################" + PING_LOG_FILE=tdd_05MHz_ping_ue.txt + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - echo "############################################################" - echo "Starting the eNB in TDD-5MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=tdd_05MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-tdd-basic-sim.conf +# Bug in TDD 5Mhz --- not running it +# echo "############################################################" +# echo "Iperf DL" +# echo "############################################################" +# CURR_IPERF_LOG_BASE=tdd_05MHz_iperf_dl +# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE +# scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC +# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC +# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 - echo "############################################################" - echo "Starting the UE in TDD-5MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=tdd_05MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2350 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" + echo "############################################################" + echo "Terminate enb/ue simulators" + echo "############################################################" terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - exit -1 - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR + sleep 10 - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=tdd_05MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 + echo "############################################################" + echo "Starting the eNB in TDD-10MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=tdd_10MHz_enb.log + start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 50 lte-tdd-basic-sim.conf -# Bug in TDD 5Mhz --- not running it -# echo "############################################################" -# echo "Iperf DL" -# echo "############################################################" -# CURR_IPERF_LOG_BASE=tdd_05MHz_iperf_dl -# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE -# scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC -# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC -# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 + echo "############################################################" + echo "Starting the UE in TDD-10MHz mode" + echo "############################################################" + CURRENT_UE_LOG_FILE=tdd_10MHz_ue.log + start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 50 2350 + if [ $UE_SYNC -eq 0 ] + then + echo "Problem w/ eNB and UE not syncing" + terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC + recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + exit -1 + fi + get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 + echo "############################################################" + echo "Pinging the UE" + echo "############################################################" + PING_LOG_FILE=tdd_10MHz_ping_ue.txt + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - echo "############################################################" - echo "Starting the eNB in TDD-10MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=tdd_10MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 50 lte-tdd-basic-sim.conf + echo "############################################################" + echo "Iperf DL" + echo "############################################################" + CURR_IPERF_LOG_BASE=tdd_10MHz_iperf_dl + iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 - echo "############################################################" - echo "Starting the UE in TDD-10MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=tdd_10MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 50 2350 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" + echo "############################################################" + echo "Terminate enb/ue simulators" + echo "############################################################" terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - exit -1 - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR + sleep 10 - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=tdd_10MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 + echo "############################################################" + echo "Starting the eNB in TDD-20MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=tdd_20MHz_enb.log + start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 100 lte-tdd-basic-sim.conf - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - CURR_IPERF_LOG_BASE=tdd_10MHz_iperf_dl - iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 + echo "############################################################" + echo "Starting the UE in TDD-20MHz mode" + echo "############################################################" + CURRENT_UE_LOG_FILE=tdd_20MHz_ue.log + start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 100 2350 + if [ $UE_SYNC -eq 0 ] + then + echo "Problem w/ eNB and UE not syncing" + terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC + recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC + terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + exit -1 + fi + get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 + echo "############################################################" + echo "Pinging the UE" + echo "############################################################" + PING_LOG_FILE=tdd_20MHz_ping_ue.txt + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - echo "############################################################" - echo "Starting the eNB in TDD-20MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=tdd_20MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 100 lte-tdd-basic-sim.conf + echo "############################################################" + echo "Iperf DL" + echo "############################################################" + CURR_IPERF_LOG_BASE=tdd_20MHz_iperf_dl + iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 - echo "############################################################" - echo "Starting the UE in TDD-20MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=tdd_20MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 100 2350 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" + echo "############################################################" + echo "Terminate enb/ue simulators" + echo "############################################################" terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - exit -1 + sleep 10 + + echo "############################################################" + echo "Terminate EPC" + echo "############################################################" + + if [ $LTEBOX -eq 1 ] + then + terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + fi + + if [ $KEEP_VM_ALIVE -eq 0 ] + then + echo "############################################################" + echo "Destroying VMs" + echo "############################################################" + uvt-kvm destroy $VM_NAME + ssh-keygen -R $VM_IP_ADDR + uvt-kvm destroy $EPC_VM_NAME + ssh-keygen -R $EPC_VM_IP_ADDR + fi + + echo "############################################################" + echo "Checking run status" + echo "############################################################" + + if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi + if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi + fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=tdd_20MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - CURR_IPERF_LOG_BASE=tdd_20MHz_iperf_dl - iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 - - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 - - echo "############################################################" - echo "Terminate EPC" - echo "############################################################" - - if [ $LTEBOX -eq 1 ] - then - terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - fi - - echo "############################################################" - echo "Checking run status" - echo "############################################################" - - if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi - if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi - -fi - -if [ $STATUS -eq 0 ] -then - echo "STATUS seems OK" -else - echo "STATUS failed?" -fi - -exit $STATUS +} diff --git a/ci-scripts/waitBuildOnVM.sh b/ci-scripts/waitBuildOnVM.sh index 011a32bbb9..a6f4edace8 100755 --- a/ci-scripts/waitBuildOnVM.sh +++ b/ci-scripts/waitBuildOnVM.sh @@ -20,8 +20,8 @@ # * contact@openairinterface.org # */ -function usage { - echo "OAI VM Build Check script" +function wait_usage { + echo "OAI CI VM script" echo " Original Author: Raphael Defosseux" echo " Requirements:" echo " -- uvtool uvtool-libvirt apt-cacher" @@ -31,9 +31,9 @@ function usage { echo "" echo "Usage:" echo "------" - echo " waitBuildOnVM.sh [OPTIONS]" + echo " oai-ci-vm-tool wait [OPTIONS]" echo "" - echo "Options:" + echo "Mandatory Options:" echo "--------" echo " --job-name #### OR -jn ####" echo " Specify the name of the Jenkins job." @@ -44,16 +44,11 @@ function usage { echo " --workspace #### OR -ws ####" echo " Specify the workspace." echo "" - echo " --variant enb-usrp OR -v1" - echo " --variant basic-sim OR -v2" - echo " --variant phy-sim OR -v3" - echo " --variant cppcheck OR -v4" - echo " --variant gnb-usrp OR -v5" - echo " --variant nu-ue-usrp OR -v6" - echo " --variant enb-ethernet OR -v7" - echo " --variant ue-ethernet OR -v8" + variant_usage echo " Specify the variant to build." echo "" + echo "Options:" + echo "--------" echo " --keep-vm-alive OR -k" echo " Keep the VM alive after the build." echo "" @@ -62,345 +57,114 @@ function usage { echo "" } -function variant_usage { - echo "OAI VM Build Check script" - echo " Original Author: Raphael Defosseux" - echo "" - echo " --variant enb-usrp OR -v1" - echo " --variant basic-sim OR -v2" - echo " --variant phy-sim OR -v3" - echo " --variant cppcheck OR -v4" - echo " --variant gnb-usrp OR -v5" - echo " --variant nu-ue-usrp OR -v6" - echo " --variant enb-ethernet OR -v7" - echo " --variant ue-ethernet OR -v8" - echo "" +function wait_on_vm_build { + echo "############################################################" + echo "OAI CI VM script" + echo "############################################################" + + echo "VM_NAME = $VM_NAME" + echo "VM_CMD_FILE = $VM_CMDS" + echo "JENKINS_WKSP = $JENKINS_WKSP" + echo "ARCHIVES_LOC = $ARCHIVES_LOC" + echo "BUILD_OPTIONS = $BUILD_OPTIONS" + + IS_VM_ALIVE=`uvt-kvm list | grep -c $VM_NAME` + + if [ $IS_VM_ALIVE -eq 0 ] + then + echo "############################################################" + echo "You should have created the VM before doing anything" + echo "############################################################" + STATUS=1 + return + fi + + echo "Waiting for VM to be started" + uvt-kvm wait $VM_NAME --insecure + + VM_IP_ADDR=`uvt-kvm ip $VM_NAME` + echo "$VM_NAME has for IP addr = $VM_IP_ADDR" + + echo "############################################################" + echo "Waiting build process to end on VM ($VM_NAME)" + echo "############################################################" + + if [[ "$VM_NAME" == *"-cppcheck"* ]] + then + echo "echo \"ps -aux | grep cppcheck \"" >> $VM_CMDS + echo "while [ \$(ps -aux | grep --color=never cppcheck | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done" >> $VM_CMDS + else + echo "echo \"ps -aux | grep build \"" >> $VM_CMDS + echo "while [ \$(ps -aux | grep --color=never build_oai | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done" >> $VM_CMDS + fi + + ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS + rm -f $VM_CMDS } -if [ $# -lt 1 ] || [ $# -gt 9 ] -then - echo "Syntax Error: not the correct number of arguments" - echo "" - usage - exit 1 -fi - -VM_TEMPLATE=ci- -JOB_NAME=XX -BUILD_ID=XX -VM_NAME=ci-enb-usrp -VM_MEMORY=2048 -VM_CPU=4 -ARCHIVES_LOC=enb_usrp -LOG_PATTERN=.Rel15.txt -NB_PATTERN_FILES=4 -BUILD_OPTIONS="--eNB -w USRP" -KEEP_VM_ALIVE=0 - -while [[ $# -gt 0 ]] -do -key="$1" - -case $key in - -h|--help) - shift - usage - exit 0 - ;; - -jn|--job-name) - JOB_NAME="$2" - shift - shift - ;; - -id|--build-id) - BUILD_ID="$2" - shift - shift - ;; - -ws|--workspace) - JENKINS_WKSP="$2" - shift - shift - ;; - -k|--keep-vm-alive) - KEEP_VM_ALIVE=1 - shift - ;; - -v1) - VM_NAME=ci-enb-usrp - ARCHIVES_LOC=enb_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--eNB -w USRP --mu" - shift - ;; - -v2) - VM_NAME=ci-basic-sim - ARCHIVES_LOC=basic_sim - LOG_PATTERN=basic_simulator - NB_PATTERN_FILES=2 - BUILD_OPTIONS="--basic-simulator" - VM_MEMORY=8192 - VM_CPU=4 - shift - ;; - -v3) - VM_NAME=ci-phy-sim - ARCHIVES_LOC=phy_sim - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--phy_simulators" - shift - ;; - -v4) - VM_NAME=ci-cppcheck - VM_MEMORY=8192 - ARCHIVES_LOC=cppcheck - LOG_PATTERN=cppcheck.xml - NB_PATTERN_FILES=1 - BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c" - shift - ;; - -v5) - VM_NAME=ci-gnb-usrp - ARCHIVES_LOC=gnb_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--gNB -w USRP" - shift - ;; - -v6) - VM_NAME=ci-ue-nr-usrp - ARCHIVES_LOC=nrue_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--nrUE -w USRP" - shift - ;; - -v7) - VM_NAME=ci-enb-ethernet - ARCHIVES_LOC=enb_eth - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET --noS1" - shift - ;; - -v8) - VM_NAME=ci-ue-ethernet - ARCHIVES_LOC=ue_eth - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--UE -t ETHERNET --noS1" - shift - ;; - --variant) - variant="$2" - case $variant in - enb-usrp) - VM_NAME=ci-enb-usrp - ARCHIVES_LOC=enb_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--eNB -w USRP --mu" - ;; - basic-sim) - VM_NAME=ci-basic-sim - ARCHIVES_LOC=basic_sim - LOG_PATTERN=basic_simulator - NB_PATTERN_FILES=2 - BUILD_OPTIONS="--basic-simulator" - VM_MEMORY=8192 - VM_CPU=4 - ;; - phy-sim) - VM_NAME=ci-phy-sim - ARCHIVES_LOC=phy_sim - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--phy_simulators" - ;; - cppcheck) - VM_NAME=ci-cppcheck - VM_MEMORY=8192 - ARCHIVES_LOC=cppcheck - LOG_PATTERN=cppcheck.xml - NB_PATTERN_FILES=1 - BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c" - ;; - gnb-usrp) - VM_NAME=ci-gnb-usrp - ARCHIVES_LOC=gnb_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--gNB -w USRP" - ;; - nu-ue-usrp) - VM_NAME=ci-ue-nr-usrp - ARCHIVES_LOC=nrue_usrp - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=4 - BUILD_OPTIONS="--nrUE -w USRP" - ;; - enb-ethernet) - VM_NAME=ci-enb-ethernet - ARCHIVES_LOC=enb_eth - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET --noS1" - ;; - ue-ethernet) - VM_NAME=ci-ue-ethernet - ARCHIVES_LOC=ue_eth - LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--UE -t ETHERNET --noS1" - ;; - *) - echo "" - echo "Syntax Error: Invalid Variant option -> $variant" - echo "" - variant_usage - exit 1 - esac - shift - shift - ;; - *) - echo "Syntax Error: unknown option: $key" - echo "" - usage - exit 1 -esac -done - -if [ ! -f $JENKINS_WKSP/localZip.zip ] -then - echo "Missing localZip.zip file!" - exit 1 -fi -if [ ! -f /etc/apt/apt.conf.d/01proxy ] -then - echo "Missing /etc/apt/apt.conf.d/01proxy file!" - echo "Is apt-cacher installed and configured?" - exit 1 -fi - -if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] -then - VM_TEMPLATE=ci- -else - VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}- -fi - -VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"` -VM_CMDS=${VM_NAME}_cmds.txt -ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC} - -echo "VM_NAME = $VM_NAME" -echo "VM_CMD_FILE = $VM_CMDS" -echo "JENKINS_WKSP = $JENKINS_WKSP" -echo "ARCHIVES_LOC = $ARCHIVES_LOC" -echo "BUILD_OPTIONS = $BUILD_OPTIONS" - -IS_VM_ALIVE=`uvt-kvm list | grep -c $VM_NAME` - -if [ $IS_VM_ALIVE -eq 0 ] -then +function check_on_vm_build { echo "############################################################" - echo "You should have created the VM before doing anything" + echo "Creating a tmp folder to store results and artifacts" echo "############################################################" - exit 1 -fi - -echo "Waiting for VM to be started" -uvt-kvm wait $VM_NAME --insecure - -VM_IP_ADDR=`uvt-kvm ip $VM_NAME` -echo "$VM_NAME has for IP addr = $VM_IP_ADDR" - -echo "############################################################" -echo "Waiting build process to end on VM ($VM_NAME)" -echo "############################################################" - -if [[ "$VM_NAME" == *"-cppcheck"* ]] -then - echo "echo \"ps -aux | grep cppcheck \"" >> $VM_CMDS - echo "while [ \$(ps -aux | grep --color=never cppcheck | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done" >> $VM_CMDS -else - echo "echo \"ps -aux | grep build \"" >> $VM_CMDS - echo "while [ \$(ps -aux | grep --color=never build_oai | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done" >> $VM_CMDS -fi - -ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS - -echo "############################################################" -echo "Creating a tmp folder to store results and artifacts" -echo "############################################################" -if [ ! -d $JENKINS_WKSP/archives ] -then - mkdir $JENKINS_WKSP/archives -fi - -if [ ! -d $ARCHIVES_LOC ] -then - mkdir $ARCHIVES_LOC -fi - -scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.txt $ARCHIVES_LOC -if [[ "$VM_NAME" == *"-cppcheck"* ]] -then - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.xml $ARCHIVES_LOC -fi - -if [ $KEEP_VM_ALIVE -eq 0 ] -then - echo "############################################################" - echo "Destroying VM" - echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR -fi -rm -f $VM_CMDS - -echo "############################################################" -echo "Checking build status" -echo "############################################################" - -LOG_FILES=`ls $ARCHIVES_LOC/*.txt $ARCHIVES_LOC/*.xml` -STATUS=0 -NB_FOUND_FILES=0 - -for FULLFILE in $LOG_FILES -do - if [[ $FULLFILE == *"$LOG_PATTERN"* ]] + if [ ! -d $JENKINS_WKSP/archives ] then - filename=$(basename -- "$FULLFILE") - if [ "$LOG_PATTERN" == ".Rel15.txt" ] - then - PASS_PATTERN=`echo $filename | sed -e "s#$LOG_PATTERN##"` - fi - if [ "$LOG_PATTERN" == "basic_simulator" ] - then - PASS_PATTERN="lte-" - fi - if [ "$LOG_PATTERN" == "cppcheck.xml" ] - then - PASS_PATTERN="results version" - LOCAL_STAT=`egrep -c "$PASS_PATTERN" $FULLFILE` - else - LOCAL_STAT=`egrep -c "Built target $PASS_PATTERN" $FULLFILE` - fi - if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi - NB_FOUND_FILES=$((NB_FOUND_FILES + 1)) + mkdir $JENKINS_WKSP/archives fi -done -if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi + if [ ! -d $ARCHIVES_LOC ] + then + mkdir $ARCHIVES_LOC + fi -if [ $STATUS -eq 0 ] -then - echo "STATUS seems OK" -else - echo "STATUS failed?" -fi -exit $STATUS + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.txt $ARCHIVES_LOC + if [[ "$VM_NAME" == *"-cppcheck"* ]] + then + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.xml $ARCHIVES_LOC + fi + + if [ $KEEP_VM_ALIVE -eq 0 ] + then + echo "############################################################" + echo "Destroying VM" + echo "############################################################" + uvt-kvm destroy $VM_NAME + ssh-keygen -R $VM_IP_ADDR + fi + rm -f $VM_CMDS + + echo "############################################################" + echo "Checking build status" + echo "############################################################" + + LOG_FILES=`ls $ARCHIVES_LOC/*.txt $ARCHIVES_LOC/*.xml` + STATUS=0 + NB_FOUND_FILES=0 + + for FULLFILE in $LOG_FILES + do + if [[ $FULLFILE == *"$LOG_PATTERN"* ]] + then + filename=$(basename -- "$FULLFILE") + if [ "$LOG_PATTERN" == ".Rel15.txt" ] + then + PASS_PATTERN=`echo $filename | sed -e "s#$LOG_PATTERN##"` + fi + if [ "$LOG_PATTERN" == "basic_simulator" ] + then + PASS_PATTERN="lte-" + fi + if [ "$LOG_PATTERN" == "cppcheck.xml" ] + then + PASS_PATTERN="results version" + LOCAL_STAT=`egrep -c "$PASS_PATTERN" $FULLFILE` + else + LOCAL_STAT=`egrep -c "Built target $PASS_PATTERN" $FULLFILE` + fi + if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi + NB_FOUND_FILES=$((NB_FOUND_FILES + 1)) + fi + done + + if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi + +} From d348c414a835d74ea60c68f20979f27da6468c65 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 7 Nov 2018 18:34:56 +0100 Subject: [PATCH 11/21] nr_pbchsim CI improvements --- cmake_targets/autotests/test_case_list.xml | 2 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 57b16bcca4..64ea824187 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1055,7 +1055,7 @@ -s-11 -S-10 -n1000 -s-11 -S-10 -n10 -I nr_pbchsim.test1 - n_errors \(negative CRC\) = 0 + PBCH test OK segmentation fault|assertion|exiting|fatal 3 diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 5652c5712a..c8d8d39783 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -133,6 +133,8 @@ int main(int argc, char **argv) int loglvl=OAILOG_WARNING; + float target_error_rate = 0.01; + cpuf = get_cpu_freq_GHz(); if ( load_configmodule(argc,argv) == 0) { @@ -296,6 +298,7 @@ int main(int argc, char **argv) case 'I': run_initial_sync=1; + target_error_rate=0.1; break; case 'L': @@ -571,7 +574,12 @@ int main(int argc, char **argv) printf("SNR %f : n_errors (negative CRC) = %d/%d\n", SNR,n_errors,n_trials); - if (n_trials==1 || ((float)n_errors/(float)n_trials < 0.01)) + if ((float)n_errors/(float)n_trials <= target_error_rate) { + printf("PBCH test OK\n"); + break; + } + + if (n_trials==1) break; } // NSR From 5c9b76f1e9f50bf826ba4a5924c27a3a75ac29b7 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Thu, 8 Nov 2018 11:09:58 +0100 Subject: [PATCH 12/21] bugfix for parameter passing --- targets/RT/USER/nr-gnb.c | 9 ++++----- targets/RT/USER/nr-ru.c | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index d5ea712ad9..037e5b3d73 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -545,10 +545,9 @@ int wakeup_tx(PHY_VARS_gNB *gNB) { int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { gNB_L1_proc_t *proc=&gNB->proc; - gNB_L1_rxtx_proc_t *L1_proc=&proc->L1_proc; - NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; + RU_proc_t *ru_proc=&ru->proc; int i; struct timespec wait; @@ -602,9 +601,9 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - L1_proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); - L1_proc->frame_rx = proc->frame_rx; - L1_proc->subframe_rx = proc->subframe_rx; + L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); + L1_proc->frame_rx = ru_proc->frame_rx; + L1_proc->subframe_rx = ru_proc->subframe_rx; L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index 83843a03c6..044fce188a 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -1620,6 +1620,7 @@ static void* ru_thread( void* param ) { }*/ // adjust for timing offset between RU +printf("~~~~~~~~~~~~~~~~~~~~~~~~~~%d.%d in ru_thread is in process\n", proc->frame_rx, proc->subframe_rx); if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023; From a0844822d40c844289590faaf3d9efe96ea7343c Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Thu, 8 Nov 2018 15:16:25 +0100 Subject: [PATCH 13/21] fix for multiple RU_TX process --- targets/RT/USER/nr-ru.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index 044fce188a..bd6216d707 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -771,8 +771,6 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) { if (ru == RC.ru[0]) { VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, proc->frame_rx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, proc->subframe_rx ); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx ); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx ); } if (proc->first_rx == 0) { @@ -844,6 +842,8 @@ void tx_rf(RU_t *ru) { flags = 4; // start of burst and end of burst (only one DL SF between two UL) sf_extension = ru->N_TA_offset<<1; } */ + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx ); for (i=0; inb_tx; i++) txp[i] = (void*)&ru->common.txdata[i][(proc->subframe_tx*fp->samples_per_subframe)-sf_extension]; @@ -1415,6 +1415,9 @@ static void* ru_thread_tx( void* param ) { wait_on_condition(&proc->mutex_gNBs,&proc->cond_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx"); if (oai_exit) break; +printf("~~~~~~~~~~~~~~~~start process for ru_thread_tx %d.%d\n", proc->frame_tx, proc->subframe_tx); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx ); // do TX front-end processing if needed (precoding and/or IDFTs) if (ru->feptx_prec) ru->feptx_prec(ru); @@ -1634,22 +1637,7 @@ printf("~~~~~~~~~~~~~~~~~~~~~~~~~~%d.%d in ru_thread is in process\n", proc->fra // wakeup all gNB processes waiting for this RU if (ru->num_gNB>0) wakeup_gNB_L1s(ru); - if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0){ - // do TX front-end processing if needed (precoding and/or IDFTs) - if (ru->feptx_prec) ru->feptx_prec(ru); - - // do OFDM if needed - if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru); - if(!emulate_rf){ - // do outgoing fronthaul (south) if needed - if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru); - - if (ru->fh_north_out) ru->fh_north_out(ru); - } - proc->emulate_rf_busy = 0; - } - - if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) + if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD && ru->num_eNB==0) { // do TX front-end processing if needed (precoding and/or IDFTs) if (ru->feptx_prec) ru->feptx_prec(ru); @@ -1691,6 +1679,7 @@ printf("~~~~~~~~~~~~~~~~~~~~~~~~~~%d.%d in ru_thread is in process\n", proc->fra }//for (i=0; inb_tx; i++) }//if(proc->frame_tx == print_frame) }//else emulate_rf + proc->emulate_rf_busy = 0; }//if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) } From e498a37e0d474701cc153b9df8f0f0d3edbb3c6a Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Thu, 8 Nov 2018 15:23:58 +0100 Subject: [PATCH 14/21] print mark out and adding gtkw file for gnb --- targets/RT/USER/gNB_usrp.gtkw | 57 +++++++++++++++++++++++++++++++++++ targets/RT/USER/nr-gnb.c | 4 +-- targets/RT/USER/nr-ru.c | 4 +-- 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 targets/RT/USER/gNB_usrp.gtkw diff --git a/targets/RT/USER/gNB_usrp.gtkw b/targets/RT/USER/gNB_usrp.gtkw new file mode 100644 index 0000000000..f7ca2c291a --- /dev/null +++ b/targets/RT/USER/gNB_usrp.gtkw @@ -0,0 +1,57 @@ +[*] +[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI +[*] Tue Nov 6 14:54:14 2018 +[*] +[dumpfile] "/tmp/openair_dump_eNB.vcd" +[dumpfile_mtime] "Tue Nov 6 14:50:45 2018" +[dumpfile_size] 1894074 +[savefile] "/homes/wangts/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw" +[timestart] 1238454000 +[size] 1920 1018 +[pos] -159 -155 +*-20.848083 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +[sst_width] 386 +[signals_width] 344 +[sst_expanded] 1 +[sst_vpaned_height] 421 +@28 +functions.trx_read +functions.trx_write +@24 +variables.trx_ts[63:0] +variables.trx_tst[63:0] +@28 +functions.eNB_thread_rxtx0 +@24 +variables.frame_number_RX0_RU[63:0] +variables.subframe_number_RX0_RU[63:0] +variables.frame_number_TX0_RU[63:0] +variables.subframe_number_TX0_RU[63:0] +@28 +functions.mac_schedule_dlsch +functions.macxface_eNB_dlsch_ulsch_scheduler +functions.macxface_ue_scheduler +functions.phy_eNB_ofdm_mod_l +@24 +variables.frame_number_RX0_gNB[63:0] +variables.subframe_number_RX0_gNB[63:0] +variables.frame_number_TX0_gNB[63:0] +variables.subframe_number_TX0_gNB[63:0] +@28 +functions.gNB_thread_rxtx0 +@24 +variables.frame_number_RX1_gNB[63:0] +variables.subframe_number_RX1_gNB[63:0] +variables.frame_number_TX1_gNB[63:0] +variables.subframe_number_TX1_gNB[63:0] +@28 +functions.gNB_thread_rxtx1 +functions.phy_procedures_ru_feprx0 +functions.phy_procedures_ru_feprx0 +functions.phy_procedures_ru_feprx1 +functions.phy_procedures_ru_feptx_ofdm0 +functions.phy_procedures_ru_feptx_ofdm1 +functions.phy_procedures_ru_feptx_prec0 +functions.phy_procedures_ru_feptx_prec1 +[pattern_trace] 1 +[pattern_trace] 0 diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index 037e5b3d73..eae095b936 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -455,7 +455,7 @@ int wakeup_txfh(gNB_L1_rxtx_proc_t *proc,PHY_VARS_gNB *gNB) { struct timespec wait; wait.tv_sec=0; wait.tv_nsec=5000000L; -printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); +//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); if(wait_on_condition(&proc->mutex_RUs,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) { LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx); @@ -607,7 +607,7 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; -printf("~~~~~~~~~~~~~~~~~~~~~~passing parameter IC = %d, RX: %d.%d, TX: %d.%d to L1 sf_ahead = %d\n", L1_proc->instance_cnt, L1_proc->frame_rx, L1_proc->subframe_rx, L1_proc->frame_tx, L1_proc->subframe_tx, sf_ahead); +//printf("~~~~~~~~~~~~~~~~~~~~~~passing parameter IC = %d, RX: %d.%d, TX: %d.%d to L1 sf_ahead = %d\n", L1_proc->instance_cnt, L1_proc->frame_rx, L1_proc->subframe_rx, L1_proc->frame_tx, L1_proc->subframe_tx, sf_ahead); // the thread can now be woken up if (pthread_cond_signal(&L1_proc->cond) != 0) { diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index bd6216d707..d329e467be 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -1415,7 +1415,7 @@ static void* ru_thread_tx( void* param ) { wait_on_condition(&proc->mutex_gNBs,&proc->cond_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx"); if (oai_exit) break; -printf("~~~~~~~~~~~~~~~~start process for ru_thread_tx %d.%d\n", proc->frame_tx, proc->subframe_tx); +//printf("~~~~~~~~~~~~~~~~start process for ru_thread_tx %d.%d\n", proc->frame_tx, proc->subframe_tx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx ); // do TX front-end processing if needed (precoding and/or IDFTs) @@ -1623,7 +1623,7 @@ static void* ru_thread( void* param ) { }*/ // adjust for timing offset between RU -printf("~~~~~~~~~~~~~~~~~~~~~~~~~~%d.%d in ru_thread is in process\n", proc->frame_rx, proc->subframe_rx); +//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~%d.%d in ru_thread is in process\n", proc->frame_rx, proc->subframe_rx); if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023; From b4b8db63894aff8a654bb17353bdfc9e1bf46b9e Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 8 Nov 2018 16:35:44 +0100 Subject: [PATCH 15/21] CI: adding support for slave jobs to support non-develop branch targets Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index f170aa081f..b371f6af20 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -338,7 +338,8 @@ pipeline { string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), - booleanParam(name: 'eNB_mergeRequest', value: true) + booleanParam(name: 'eNB_mergeRequest', value: true), + string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch)) ] } } else { @@ -383,7 +384,8 @@ pipeline { string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), - booleanParam(name: 'eNB_mergeRequest', value: true) + booleanParam(name: 'eNB_mergeRequest', value: true), + string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch)) ] } } else { @@ -428,7 +430,8 @@ pipeline { string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), - booleanParam(name: 'eNB_mergeRequest', value: true) + booleanParam(name: 'eNB_mergeRequest', value: true), + string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch)) ] } } else { @@ -473,7 +476,8 @@ pipeline { string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), - booleanParam(name: 'eNB_mergeRequest', value: true) + booleanParam(name: 'eNB_mergeRequest', value: true), + string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch)) ] } } else { From ec1fc635c03de9450e61a3560dbb050276a8f168 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 8 Nov 2018 19:15:37 +0100 Subject: [PATCH 16/21] CI: normalize IPv4 addresses for scripts Signed-off-by: Raphael Defosseux --- .../enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf | 10 ++++------ .../enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf | 10 ++++------ .../enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf | 10 ++++------ .../conf_files/enb.band7.tm1.100PRB.usrpb210.conf | 9 ++++----- .../conf_files/enb.band7.tm1.25PRB.usrpb210.conf | 9 ++++----- .../conf_files/enb.band7.tm1.50PRB.usrpb210.conf | 9 ++++----- ci-scripts/conf_files/lte-fdd-basic-sim.conf | 1 - ci-scripts/conf_files/lte-tdd-basic-sim.conf | 2 -- .../rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf | 10 ++++------ .../rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf | 10 ++++------ .../rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf | 10 ++++------ .../rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf | 9 ++++----- .../rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf | 9 ++++----- .../rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf | 9 ++++----- ci-scripts/main.py | 6 ++---- 15 files changed, 50 insertions(+), 73 deletions(-) diff --git a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf index ec968e8cef..b6028a8152 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -134,7 +134,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "10.0.0.2"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -144,13 +144,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.0.1/24"; - + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "10.0.0.1/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; diff --git a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf index c2f69cb1b9..10cbd04e9a 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -134,7 +134,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "10.0.0.2"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -144,13 +144,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.0.1/24"; - + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "10.0.0.1/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; diff --git a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf index 6bdbd4e39b..c79dbf1ac0 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -134,7 +134,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "10.0.0.2"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -144,13 +144,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.0.1/24"; - + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "10.0.0.1/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; diff --git a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf index 1a566e9579..f3cb31f449 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf @@ -171,7 +171,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -181,12 +181,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; } diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index fd49fe9d83..e33daa7a8a 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -171,7 +171,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -181,12 +181,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; } diff --git a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf index 1613dd4c32..32e8bb9931 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf @@ -171,7 +171,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -181,12 +181,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; } diff --git a/ci-scripts/conf_files/lte-fdd-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-basic-sim.conf index 0211e126a1..1d1395cf6d 100644 --- a/ci-scripts/conf_files/lte-fdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-basic-sim.conf @@ -186,7 +186,6 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "eth0"; ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; diff --git a/ci-scripts/conf_files/lte-tdd-basic-sim.conf b/ci-scripts/conf_files/lte-tdd-basic-sim.conf index a7bc31eed8..32a84fd206 100644 --- a/ci-scripts/conf_files/lte-tdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-tdd-basic-sim.conf @@ -145,11 +145,9 @@ eNBs = { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; diff --git a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf index 217991f69f..285b7eaf9f 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -137,7 +137,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "10.0.0.2"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -147,13 +147,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.0.1/24"; - + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "10.0.0.1/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; diff --git a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf index 21f4f34ba9..62e7fb48a4 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -137,7 +137,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "10.0.0.2"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -147,13 +147,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.0.1/24"; - + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "10.0.0.1/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; diff --git a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf index 2fdfa3c4e7..f99b701b8e 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -137,7 +137,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "10.0.0.2"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -147,13 +147,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.0.1/24"; - + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "10.0.0.1/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf index 28ffc43b23..fc2f24b8a1 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf @@ -174,7 +174,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -184,12 +184,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; } diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf index 4d064ecc0e..010ef28061 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf @@ -174,7 +174,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -184,12 +184,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; } diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf index efb1e823ad..ddf01096cd 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf @@ -174,7 +174,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -184,12 +184,11 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - - ENB_IPV4_ADDRESS_FOR_X2C = "192.168.12.111/24"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; } diff --git a/ci-scripts/main.py b/ci-scripts/main.py index b54c6f3fab..24475f7eb3 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -367,10 +367,8 @@ class SSHConnection(): rruCheck = True # Make a copy and adapt to EPC / eNB IP addresses self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) - self.command('sed -i -e \'s/mme_ip_address.*$/mme_ip_address = ( { ipv4 = "' + self.EPCIPAddress + '";/\' ' + ci_full_config_file, '\$', 2); - self.command('sed -i -e \'s/ENB_IPV4_ADDRESS_FOR_S1_MME.*$/ENB_IPV4_ADDRESS_FOR_S1_MME = "' + self.eNBIPAddress + '";/\' ' + ci_full_config_file, '\$', 2); - self.command('sed -i -e \'s/ENB_IPV4_ADDRESS_FOR_S1U.*$/ENB_IPV4_ADDRESS_FOR_S1U = "' + self.eNBIPAddress + '";/\' ' + ci_full_config_file, '\$', 2); - self.command('sed -i -e \'s/ENB_IPV4_ADDRESS_FOR_X2C.*$/ENB_IPV4_ADDRESS_FOR_X2C = "' + self.eNBIPAddress + '";/\' ' + ci_full_config_file, '\$', 2); + self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2); + self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); # Launch eNB with the modified config file self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) From 01aead2b86eea940c7c62b2b959d47485adb88c6 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 9 Nov 2018 11:55:44 +0100 Subject: [PATCH 17/21] CI: proper description of the phy-sim test-cases Signed-off-by: Raphael Defosseux --- .../autotests/run_exec_autotests.bash | 5 +- cmake_targets/autotests/test_case_list.xml | 63 ++++++++++--------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index 9a1a5cad02..895bd9554b 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -303,8 +303,9 @@ function test_compile_and_run() { do global_result=1 result_string="" - PROPER_DESC=`echo ${desc_array[$tags_array_index]} | sed -e "s@^.*lsim.*est case.*(Test@Test@" -e "s@^ *(@@" -e "s/),$//"` - + PROPER_DESC=`echo ${desc_array[$tags_array_index]} | sed -e "s@^.*Test cases.*(Test@Test@" -e "s@^ *(@@" -e"s/)$//" -e "s/),$//"` + echo_info "$PROPER_DESC" + for (( run_index=1; run_index <= $nruns; run_index++ )) do temp_exec_log=$log_dir/test.$test_case_name.${tags_array[$tags_array_index]}.run_$run_index diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 64ea824187..4c4ed12ca5 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -933,23 +933,20 @@ execution - dlsim test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB), + dlsim Test cases. (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB), (Test 5: 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)), - (Test 6, 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)), - (Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)), - (Test 7, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)), - (Test 7b, 5 MHz, R3-1.FDD (MCS 15), ETU70, 1.4 dB (30%)), - (Test 10, 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)), - (Test 10b, 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)), - (Test 11, 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)), - (Test 11b, 10 MHz, R7-1.FDD (MCS 25), EVA5, 16.7dB (70%)), - (Test 15, 20 MHz, R.9 FDD (MCS 26), EVA5, 17.6dB (70%)), - (Test 15b, 20 MHz, R.9-2 FDD (MCS 26, 17PRB), EVA5, 17.3dB (70%)), - (Test 15c, 20 MHz, R.9-1 FDD (MCS 26, 83 PRB), EVA5, 16.6dB (70%)), - - (TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)), - (TM2 Test 1b 5 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)), - + (Test 6: 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)), + (Test 6b: 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)), + (Test 7: 10 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)), + (Test 7b: 5 MHz, R3-1.FDD (MCS 15), ETU70, 1.4 dB (30%)), + (Test 10: 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)), + (Test 10b: 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)), + (Test 11: 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)), + (Test 15: 20 MHz, R.9 FDD (MCS 26), EVA5, 17.6dB (70%)), + (Test 15b: 20 MHz, R.9-2 FDD (MCS 26, 17PRB), EVA5, 17.3dB (70%)), + (Test 15c: 20 MHz, R.9-1 FDD (MCS 26, 83 PRB), EVA5, 16.6dB (70%)), + (TM2 Test 1: 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)), + (TM2 Test 1b: 5 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -970,7 +967,7 @@ -m26 -gF -s16.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1899 -O60 -m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O60 -m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O60 - dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.TM2_test1 dlsim.TM2_test1b + dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.test11a dlsim.test11b dlsim.test11c dlsim.TM2_test1 dlsim.TM2_test1b "passed" segmentation fault|assertion|exiting|fatal 3 @@ -978,12 +975,12 @@ execution - ulsim Test cases. (Test 1, 5 MHz, FDD (MCS 5), AWGN, 6dB), - (Test 2, 5 MHz, FDD (MCS 16), AWGN , 12dB (70%)), - (Test 3, 10 MHz, R3.FDD (MCS 5), AWGN, 6dB (70%)), - (Test 4, 10 MHz, R3-1.FDD (MCS 16), AWGN, 12dB (70%)), - (Test 5, 20 MHz, FDD (MCS 5), AWGN, 6dB (70%)), - (Test 6, 20 MHz, FDD (MCS 16), AWGN, 12 dB (70%)) + ulsim Test cases. (Test 1: 5 MHz, FDD (MCS 5), AWGN, 6dB), + (Test 2: 5 MHz, FDD (MCS 16), AWGN , 12dB (70%)), + (Test 3: 10 MHz, R3.FDD (MCS 5), AWGN, 6dB (70%)), + (Test 4: 10 MHz, R3-1.FDD (MCS 16), AWGN, 12dB (70%)), + (Test 5: 20 MHz, FDD (MCS 5), AWGN, 6dB (70%)), + (Test 6: 20 MHz, FDD (MCS 16), AWGN, 12 dB (70%)) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -1004,7 +1001,16 @@ execution - ldpctest test cases. + ldpc Test cases. (Test1: block length = 3872), + (Test2: block length = 4224), + (Test3: block length = 4576), + (Test4: block length = 4928), + (Test5: block length = 5280), + (Test6: block length = 5632), + (Test7: block length = 6336), + (Test8: block length = 7040), + (Test9: block length = 7744), + (Test10: block length = 8448) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -1021,7 +1027,7 @@ -l7040 -s10 -n100 -l7744 -s10 -n100 -l8448 -s10 -n100 - ldpctest.test1 + ldpctest.test1 ldpctest.test2 ldpctest.test3 ldpctest.test4 ldpctest.test5 ldpctest.test6 ldpctest.test7 ldpctest.test8 ldpctest.test9 ldpctest.test10 BLER 0.000000 segmentation fault|assertion|exiting|fatal 3 @@ -1029,7 +1035,7 @@ execution - polartest test cases. + polartest Test cases. (Test1: PBCH polar test) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -1045,7 +1051,8 @@ execution - nr_pbchsim test cases. + nr_pbchsim Test cases. (Test1: PBCH-only), + (Test2: PBCH and synchronization) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -1054,7 +1061,7 @@ $OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15 -s-11 -S-10 -n1000 -s-11 -S-10 -n10 -I - nr_pbchsim.test1 + nr_pbchsim.test1 nr_pbchsim.test2 PBCH test OK segmentation fault|assertion|exiting|fatal 3 From 48e7b9be452ba2cc5e480b8e2fd480fe7f0cfe76 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Fri, 9 Nov 2018 16:41:59 +0100 Subject: [PATCH 18/21] adding adjustable sf_ahead --- openair2/GNB_APP/gnb_config.c | 10 +++++++--- targets/RT/USER/nr-ru.c | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index e9cc6df079..d695833ed3 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -294,7 +294,7 @@ void RCconfig_NR_L1(void) { } if(strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { - sf_ahead = 2; // Need 4 subframe gap between RX and TX + //sf_ahead = 2; // Need 4 subframe gap between RX and TX }else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) { RC.gNB[j][0]->eth_params_n.local_if_name = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr)); RC.gNB[j][0]->eth_params_n.my_addr = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_ADDRESS_IDX].strptr)); @@ -305,7 +305,7 @@ void RCconfig_NR_L1(void) { RC.gNB[j][0]->eth_params_n.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr); RC.gNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE; - sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2 + //sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2 RC.nb_nr_macrlc_inst = 1; // This is used by mac_top_init_gNB() @@ -404,7 +404,7 @@ void RCconfig_nr_macrlc() { RC.nrmac[j]->eth_params_s.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr); RC.nrmac[j]->eth_params_s.transp_preference = ETH_UDP_MODE; - sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2 + //sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2 printf("**************** vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc); configure_nfapi_vnf(RC.nrmac[j]->eth_params_s.my_addr, RC.nrmac[j]->eth_params_s.my_portc); @@ -799,6 +799,10 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } NRRRC_CONFIGURATION_REQ (msg_p).N_RB_DL[j]= N_RB_DL; + if(N_RB_DL == 217) sf_ahead = 2; + else if(N_RB_DL == 106) sf_ahead = 4; + else AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for N_RB_DL choice: 106, 217 !\n", + RC.config_file_name, i, N_RB_DL); /* if ((N_RB_DL!=6) && (N_RB_DL!=15) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=75) && (N_RB_DL!=100)) { diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index d329e467be..0aac90b840 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -848,10 +848,10 @@ void tx_rf(RU_t *ru) { for (i=0; inb_tx; i++) txp[i] = (void*)&ru->common.txdata[i][(proc->subframe_tx*fp->samples_per_subframe)-sf_extension]; - if (proc->subframe_tx == 0){ + /*if (proc->subframe_tx == 0){ write_output("txdataF_frame.m","txdataF_frame",&ru->common.txdataF_BF[i],fp->samples_per_subframe_wCP, 1, 1); write_output("txdata_frame.m","txdata_frame",&ru->common.txdata[i],fp->samples_per_subframe, 1, 1); - } + }*/ VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); From b6dc14f4e8901ccb51bf70cc979b42f43d196239 Mon Sep 17 00:00:00 2001 From: WANG Tsu-Han Date: Fri, 9 Nov 2018 16:52:43 +0100 Subject: [PATCH 19/21] adding config file for 80MHz --- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf new file mode 100644 index 0000000000..a604feabec --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -0,0 +1,288 @@ +Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + + cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-Eurecom-5GNRBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;}); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "3GPP_gNODEB"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + DL_prefix_type = "NORMAL"; + UL_prefix_type = "NORMAL"; + eutra_band = 22; + downlink_frequency = 3510000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 217; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + MIB_subCarrierSpacingCommon = 30; + MIB_ssb_SubcarrierOffset = 0; + MIB_dmrs_TypeA_Position = 2; + pdcch_ConfigSIB1 = 0; + SIB1_frequencyOffsetSSB = "khz5"; + SIB1_ssb_PeriodicityServingCell = 5; + SIB1_ss_PBCH_BlockPower = -60; + absoluteFrequencySSB = 0; + DL_FreqBandIndicatorNR = 15; + DL_absoluteFrequencyPointA = 15; + DL_offsetToCarrier = 15; + DL_SCS_SubcarrierSpacing = "kHz30"; + DL_SCS_SpecificCarrier_k0 = 0; + DL_carrierBandwidth = 15; + DL_locationAndBandwidth = 15; + DL_BWP_SubcarrierSpacing = "kHz30"; + DL_BWP_prefix_type = "NORMAL"; + UL_FreqBandIndicatorNR = 15; + UL_absoluteFrequencyPointA = 13; + UL_additionalSpectrumEmission = 3; + UL_p_Max = -1; + UL_frequencyShift7p5khz = "TRUE"; + UL_offsetToCarrier = 10; + UL_SCS_SubcarrierSpacing = "kHz30"; + UL_SCS_SpecificCarrier_k0 = 0; + UL_carrierBandwidth = 15; + UL_locationAndBandwidth = 15; + UL_BWP_SubcarrierSpacing = "kHz30"; + UL_BWP_prefix_type = "NORMAL"; + UL_timeAlignmentTimerCommon = "infinity"; + ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" + ServingCellConfigCommon_ssb_PositionsInBurst_PR = "shortBitmap"; + ServingCellConfigCommon_ssb_periodicityServingCell = 10; + ServingCellConfigCommon_dmrs_TypeA_Position = 2; + NIA_SubcarrierSpacing = "kHz15"; + ServingCellConfigCommon_ss_PBCH_BlockPower = -60; + referenceSubcarrierSpacing = "kHz15"; + dl_UL_TransmissionPeriodicity = "ms0p5"; + nrofDownlinkSlots = 10; + nrofDownlinkSymbols = 10; + nrofUplinkSlots = 10; + nrofUplinkSymbols = 10; + rach_totalNumberOfRA_Preambles = 63; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice = "oneEighth"; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth = 4; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth = 8; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf = 16; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one = 24; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two = 32; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four = 8; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight = 4; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen = 2; + rach_groupBconfigured = "ENABLE"; + rach_ra_Msg3SizeGroupA = 56; + rach_messagePowerOffsetGroupB = "dB0"; + rach_numberOfRA_PreamblesGroupA = 32; + rach_ra_ContentionResolutionTimer = 8; + rsrp_ThresholdSSB = 64; + rsrp_ThresholdSSB_SUL = 64; + prach_RootSequenceIndex_choice = "l839"; + prach_RootSequenceIndex_l839 = 0; + prach_RootSequenceIndex_l139 = 0; + prach_msg1_SubcarrierSpacing = "kHz30"; + restrictedSetConfig = "unrestrictedSet"; + msg3_transformPrecoding = "ENABLE"; + prach_ConfigurationIndex = 10; + prach_msg1_FDM = "one"; + prach_msg1_FrequencyStart = 10; + zeroCorrelationZoneConfig = 10; + preambleReceivedTargetPower = -150; + preambleTransMax = 6; + powerRampingStep = "dB0"; + ra_ResponseWindow = 8; + groupHoppingEnabledTransformPrecoding = "ENABLE"; + msg3_DeltaPreamble = 0; + p0_NominalWithGrant = 0; + PUSCH_TimeDomainResourceAllocation_k2 = 0; + PUSCH_TimeDomainResourceAllocation_mappingType = "typeA"; + PUSCH_TimeDomainResourceAllocation_startSymbolAndLength = 0; + pucch_ResourceCommon = 0; + pucch_GroupHopping = "neither"; + hoppingId = 0; + p0_nominal = -30; + PDSCH_TimeDomainResourceAllocation_k0 = 2; + PDSCH_TimeDomainResourceAllocation_mappingType = "typeA"; + PDSCH_TimeDomainResourceAllocation_startSymbolAndLength = 0; + rateMatchPatternId = 0; + RateMatchPattern_patternType = "bitmaps"; + symbolsInResourceBlock = "oneSlot"; + periodicityAndPattern = 2; + RateMatchPattern_controlResourceSet = 5; + RateMatchPattern_subcarrierSpacing = "kHz30"; + RateMatchPattern_mode = "dynamic"; + controlResourceSetZero = 0; + searchSpaceZero = 0; + searchSpaceSIB1 = 10; + searchSpaceOtherSystemInformation = 10; + pagingSearchSpace = 10; + ra_SearchSpace = 10; + PDCCH_common_controlResourceSetId = 5; + PDCCH_common_ControlResourceSet_duration = 2; + PDCCH_cce_REG_MappingType = "nonInterleaved"; + PDCCH_reg_BundleSize = 3; + PDCCH_interleaverSize = 3; + PDCCH_shiftIndex = 10; + PDCCH_precoderGranularity = "sameAsREG-bundle"; + PDCCH_TCI_StateId = 32; + tci_PresentInDCI = "ENABLE"; + PDCCH_DMRS_ScramblingID = 0; + SearchSpaceId = 10; + commonSearchSpaces_controlResourceSetId = 5; + SearchSpace_monitoringSlotPeriodicityAndOffset_choice = "sl1"; + SearchSpace_monitoringSlotPeriodicityAndOffset_value = 0; + SearchSpace_duration = 2; + SearchSpace_nrofCandidates_aggregationLevel1 = 0; + SearchSpace_nrofCandidates_aggregationLevel2 = 0; + SearchSpace_nrofCandidates_aggregationLevel4 = 0; + SearchSpace_nrofCandidates_aggregationLevel8 = 0; + SearchSpace_nrofCandidates_aggregationLevel16 = 0; + SearchSpace_searchSpaceType = "common"; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1 = 1; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2 = 1; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4 = 1; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8 = 1; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16 = 1; + Common_dci_Format2_3_monitoringPeriodicity = 1; + Common_dci_Format2_3_nrofPDCCH_Candidates = 1; + ue_Specific__dci_Formats = "formats0-0-And-1-0"; + RateMatchPatternLTE_CRS_carrierFreqDL = 6; + RateMatchPatternLTE_CRS_carrierBandwidthDL = 6; + RateMatchPatternLTE_CRS_nrofCRS_Ports = 1; + RateMatchPatternLTE_CRS_v_Shift = 0; + RateMatchPatternLTE_CRS_radioframeAllocationPeriod = 1; + RateMatchPatternLTE_CRS_radioframeAllocationOffset = 0; + RateMatchPatternLTE_CRS_subframeAllocation_choice = "oneFrame"; + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.26"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + GNB_INTERFACE_NAME_FOR_S1U = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + eNB_instances = [0]; + sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.100.8"; + clock_src = "external"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + From a272960353e9f2b41fef3e646687b79c1630a3e5 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Mon, 12 Nov 2018 15:22:38 +0100 Subject: [PATCH 20/21] adding parallel function for nrUE and fixes for commenadline option --- targets/RT/USER/nr-softmodem.h | 9 +++++++-- targets/RT/USER/nr-uesoftmodem.c | 26 ++++++++++++++++++++++++-- targets/RT/USER/nr-uesoftmodem.h | 4 ++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/targets/RT/USER/nr-softmodem.h b/targets/RT/USER/nr-softmodem.h index 426d124b26..9dce5f34bd 100644 --- a/targets/RT/USER/nr-softmodem.h +++ b/targets/RT/USER/nr-softmodem.h @@ -86,7 +86,10 @@ #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" +#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" +#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n" +#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n" /***************************************************************************************************************************************/ /* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument @@ -167,8 +170,10 @@ {"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \ {"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ {"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ -{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ -{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \ +{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \ +{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \ +{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \ +{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT,PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \ } diff --git a/targets/RT/USER/nr-uesoftmodem.c b/targets/RT/USER/nr-uesoftmodem.c index 75eacb829a..02db7d1a02 100644 --- a/targets/RT/USER/nr-uesoftmodem.c +++ b/targets/RT/USER/nr-uesoftmodem.c @@ -165,9 +165,31 @@ uint8_t nb_antenna_rx = 1; char ref[128] = "internal"; char channels[128] = "0"; -int codingw = 0; -int fepw = 0; +char *parallel_config = NULL; +char *worker_config = NULL; +static THREAD_STRUCT thread_struct; +void set_parallel_conf(char *parallel_conf) +{ + if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD; + else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT; + else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT; + printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf); +} +void set_worker_conf(char *worker_conf) +{ + if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE; + else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE; + printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf); +} +PARALLEL_CONF_t get_thread_parallel_conf(void) +{ + return thread_struct.parallel_conf; +} +WORKER_CONF_t get_thread_worker_conf(void) +{ + return thread_struct.worker_conf; +} int rx_input_level_dBm; //static int online_log_messages=0; diff --git a/targets/RT/USER/nr-uesoftmodem.h b/targets/RT/USER/nr-uesoftmodem.h index 1beab9bb64..ff3ec107de 100644 --- a/targets/RT/USER/nr-uesoftmodem.h +++ b/targets/RT/USER/nr-uesoftmodem.h @@ -85,9 +85,9 @@ #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" -#define CONFIG_HLP_CODINGW "coding worker thread enable(disable by defult)\n" -#define CONFIG_HLP_FEPW "FEP worker thread enabled(disable by defult)\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" +#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n" +#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" From d849dbd053e0984ad62860cf466fba4e02f530f7 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Mon, 12 Nov 2018 17:12:45 +0100 Subject: [PATCH 21/21] putting back variable needed for eNB --- openair1/PHY/defs_RU.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 6f68ee0fb4..3ad007813e 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -304,6 +304,8 @@ typedef struct RU_proc_t_s { int instance_pre_scd; #endif /// pipeline ready state + int ru_rx_ready; + int ru_tx_ready; int emulate_rf_busy; } RU_proc_t;