Commit c52f868a authored by Navid Nikaein's avatar Navid Nikaein

* add an OTG test to pre-ci

* fix the bug for selecting the destination address/ID



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5669 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent bb55cd63
......@@ -833,17 +833,22 @@ void pdcp_run (
#if defined(USER_MODE) && defined(OAI_EMU)
pdcp_t *pdcp_p = NULL;
int drb_id=0 ;
// add other rb_ids
for (drb_id=0; drb_id < DTCH; drb_id++) {
int drb_id=1 ;
int ue_id=0;
int read_otg=1;
// add check for other rb_ids later
if (enb_flagP == ENB_FLAG_NO) {
pdcp_p = &pdcp_array_drb_ue[ue_mod_idP][drb_id];
if (pdcp_array_drb_ue[ue_mod_idP][drb_id-1].instanciated_instance != TRUE )
read_otg=0;
} else {
pdcp_p = &pdcp_array_drb_eNB[enb_mod_idP][ue_mod_idP][drb_id];
for (ue_id=0; ue_id < NB_UE_INST; ue_id++)
if (pdcp_array_drb_eNB[enb_mod_idP][ue_id][drb_id-1].instanciated_instance != TRUE ){
read_otg =0;
break;
}
if (pdcp_p->instanciated_instance == TRUE )
pdcp_fifo_read_input_sdus_from_otg(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
}
if (read_otg == 1 )
pdcp_fifo_read_input_sdus_from_otg(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
#endif
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
......
......@@ -848,7 +848,8 @@ void pdcp_fifo_read_input_sdus_from_otg (frame_t frameP, eNB_flag_t enb_flagP, m
module_id_t src_id, module_id; // src for otg
module_id_t dst_id; // dst for otg
rb_id_t rb_id;
signed long pkt_size=0, pkt_cnt=0;
signed long pkt_size=0;
static unsigned int pkt_cnt_enb=0, pkt_cnt_ue=0;
uint8_t pdcp_mode, is_ue=0;
Packet_otg_elt_t *otg_pkt_info=NULL;
int result;
......@@ -878,23 +879,23 @@ void pdcp_fifo_read_input_sdus_from_otg (frame_t frameP, eNB_flag_t enb_flagP, m
pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size;
if (otg_pkt != NULL) {
if (is_ue == 0 ) {
rlc_util_print_hex_octets(PDCP,
/*rlc_util_print_hex_octets(PDCP,
otg_pkt,
pkt_size);
*/
//rb_id = (/*NB_eNB_INST +*/ dst_id -1 ) * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d for pdcp mode %d\n",
enb_mod_idP, frameP, pkt_cnt++, module_id, rb_id, module_id, dst_id, pkt_size, pdcp_mode);
result = pdcp_data_req(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,pdcp_mode);
enb_mod_idP, frameP, pkt_cnt_enb++, module_id, rb_id, module_id, dst_id, pkt_size, pdcp_mode);
result = pdcp_data_req(enb_mod_idP, dst_id, frameP, enb_flagP, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,pdcp_mode);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
else {
//rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] sending packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n",
ue_mod_idP, src_id, rb_id, src_id, dst_id, pkt_size);
result = pdcp_data_req( enb_mod_idP,
LOG_D(OTG,"[UE %d] Frame %d: sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d\n",
ue_mod_idP, frameP, pkt_cnt_ue++, src_id, rb_id, src_id, dst_id, pkt_size);
result = pdcp_data_req( dst_id,
ue_mod_idP,
frameP,
enb_flagP,
......
......@@ -212,6 +212,8 @@ void kpi_gen() {
int num_active_source=0;
int dl_ok=0,ul_ok;
char traffic_type[12];
char traffic[30];
......@@ -686,6 +688,8 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
LOG_I(OTG,"[DATA] TX throughput = %.7f(Kbit/s) \n", ((double)tx_total_bytes_dl*1000*8)/(otg_info->ctime*1024));
LOG_I(OTG,"[DATA] RX throughput = %.7f(Kbit/s) \n", ((double)rx_total_bytes_dl*1000*8)/(otg_info->ctime*1024));
LOG_I(OTG,"[DATA] NB lost packet = %d \n", tx_total_pkts_dl - rx_total_pkts_dl );
if (tx_total_pkts_dl - rx_total_pkts_dl < (int) (tx_total_pkts_dl / 10) ) // below 10% of loss
dl_ok=1;
if ((g_otg->background_stats==1)&&(tx_total_pkts_dl_background>0)){
LOG_I(OTG,"[BACKGROUND] Total packets(TX)= %d \n", tx_total_pkts_dl_background);
LOG_I(OTG,"[BACKGROUND] Total bytes(TX)= %d \n", tx_total_bytes_dl_background);
......@@ -747,6 +751,10 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
LOG_I(OTG,"[DATA] JITTER AVG ms= %lf \n", otg_info->average_jitter_ul/(float)num_active_source);
LOG_I(OTG,"[DATA] TX throughput = %.7f(Kbit/s) \n", ((double)tx_total_bytes_ul*1000*8)/(otg_info->ctime*1024));
LOG_I(OTG,"[DATA] RX throughput = %.7f(Kbit/s) \n", ((double)rx_total_bytes_ul*1000*8)/(otg_info->ctime*1024));
LOG_I(OTG,"[DATA] NB lost packet = %d \n", tx_total_pkts_ul - rx_total_pkts_ul );
if ((tx_total_pkts_ul - rx_total_pkts_ul) < (int)(tx_total_pkts_ul / 10) )
ul_ok=1;
if ((g_otg->background_stats==1)&&(tx_total_pkts_ul_background>0)){
LOG_I(OTG,"[BACKGROUND] Total packets(TX)= %d \n", tx_total_pkts_ul_background);
LOG_I(OTG,"[BACKGROUND] Total bytes(TX)= %d \n", tx_total_bytes_ul_background);
......@@ -767,6 +775,7 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
LOG_F(OTG,"[DATA] JITTER AVG ms= %lf \n", otg_info->average_jitter_ul/(float)num_active_source);
LOG_F(OTG,"[DATA] TX throughput = %.7f(Kbit/s) \n", ((double)tx_total_bytes_ul*1000*8)/(otg_info->ctime*1024));
LOG_F(OTG,"[DATA] RX throughput = %.7f(Kbit/s) \n", ((double)rx_total_bytes_ul*1000*8)/(otg_info->ctime*1024));
LOG_F(OTG,"[DATA] NB lost packet = %d \n", tx_total_pkts_ul - rx_total_pkts_ul );
if ((g_otg->background_stats==1)&&(tx_total_pkts_ul_background>0)){
LOG_F(OTG,"[BACKGROUND] Total packets(TX)= %d \n", tx_total_pkts_ul_background);
LOG_F(OTG,"[BACKGROUND] Total bytes(TX)= %d \n", tx_total_bytes_ul_background);
......@@ -777,6 +786,10 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
}
if ((dl_ok == 1 ) && (ul_ok ==1))
LOG_I(OTG,"************ DL and UL loss rate below 10% *************\n");
else
LOG_I(OTG,"************ DL and UL loss rate above 10% *************\n");
#endif
}
......
......@@ -1108,8 +1108,8 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1;
g_otg->background[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]] =map_str_to_int(switch_names,oai_emulation.application_config.customized_traffic.background[customized_traffic_config_index]);
g_otg->m2m[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]] =map_str_to_int(switch_names,oai_emulation.application_config.customized_traffic.m2m[customized_traffic_config_index]);
LOG_I(OTG, "[src %d][dst %d][ %d]test_m2m %d \n",source_id_index, destination_id_index , g_otg->application_idx[source_id_index][destination_id_index] , g_otg->m2m[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]] );
/* LOG_I(OTG, "[src %d][dst %d][app %d]test_m2m %d \n",source_id_index, destination_id_index , g_otg->application_idx[source_id_index][destination_id_index] , g_otg->m2m[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]] );
*/
g_otg->trans_proto[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]] = map_str_to_int(otg_transport_protocol_names, oai_emulation.application_config.customized_traffic.transport_protocol[customized_traffic_config_index]);
g_otg->ip_v[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]] = map_str_to_int(otg_ip_version_names, oai_emulation.application_config.customized_traffic.ip_version[customized_traffic_config_index]);
......@@ -1148,7 +1148,10 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1;
g_otg->holding_time_pe_off[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]]=oai_emulation.application_config.customized_traffic.holding_time_pe_off[customized_traffic_config_index];
LOG_I(OTG,"OCG_config_OTG (single node config): source = %d, dest = %d\n", source_id_index, destination_id_index);
LOG_I(OTG,"customized:: OCG_config_OTG:(3) FORMAT (%d:%d) source = %d, dest = %d, Application = %d\n", did_start, did_end, source_id_index, destination_id_index, g_otg->application_type[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]]);
LOG_I(OTG,"customized:: OCG_config_OTG:(3) FORMAT (%d:%d) source = %d, dest = %d, Application = %d, IDT dist %d \n",
did_start, did_end, source_id_index, destination_id_index,
g_otg->application_type[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]],
g_otg->idt_dist[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]][state]);
g_otg->application_idx[source_id_index][destination_id_index]+=1;
}
......
......@@ -1096,10 +1096,10 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) {
for_times += 1;
// generate traffic if the ue is rrc reconfigured state
if (mac_get_rrc_status(enb_module_idP, ENB_FLAG_YES, dst_id) > 2 /*RRC_CONNECTED*/ ) {
if_times += 1;
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++){
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
if_times += 1;
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(enb_module_idP, dst_id + NB_eNB_INST, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
......
......@@ -76,7 +76,7 @@ def execute(oai, user, pw, logfile,logdir):
conf = '-a -A AWGN -n 100 -l7'
trace = logdir + '/log_' + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
diag = 'Error(s) found in the execution, check the execution logs'
diag = '[E] Error(s) found during the execution, check the execution logs'
oai.send_expect_false('./oaisim.rel8 ' + conf, '[E]', 30)
except log.err, e:
......@@ -187,3 +187,15 @@ def execute(oai, user, pw, logfile,logdir):
log.ok(case, test, name, conf, '', logfile)
try:
test='07'
name = 'Run oai.rel8.abs.ocg.otg'
diag = 'Check the scenario if the tests 0202 and 0203 are passed.'
conf = '-a -c26'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./oaisim.rel8 ' + conf + tee, ' DL and UL loss rate below 10% ', 500)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
......@@ -92,11 +92,12 @@ class openair(core):
return (stdout, stderr)
def connect(self, username, password, prompt):
self.prompt1 = self.shell_prompt
self.prompt2 = self.shell_prompt
if not prompt :
self.prompt2 = self.prompt1
self.prompt1 = self.prompt2
else :
self.prompt2 = prompt
self.prompt1 = prompt
while 1:
try:
if not username:
......
......@@ -53,7 +53,7 @@ import case05
from openair import *
debug = 0
prompt = '$'
prompt2 = '$'
pw =''
i = 0
dlsim=0
......@@ -64,7 +64,7 @@ for arg in sys.argv:
elif arg == '-dd':
debug = 2
elif arg == '-p' :
prompt = sys.argv[i+1]
prompt2 = sys.argv[i+1]
elif arg == '-w' :
pw = sys.argv[i+1]
elif arg == '-P' :
......@@ -84,6 +84,7 @@ try:
user = getpass.getuser()
print '\n******* Note that the user <'+user+'> should be a sudoer *******\n'
print '******* Connecting to the localhost to perform the test *******\n'
print '******* Make sure that the prompt is correct *******\n'
if not pw :
print "username: " + user
......@@ -91,7 +92,9 @@ try:
else :
print "username: " + user
#print "password: " + pw
print "prompt: " + prompt
prompt = os.getenv("PS1")[-2]
print "your prompt: " + prompt
oai.connect(user,pw,prompt)
#oai.get_shell()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment