Commit 388ad205 authored by Navid Nikaein's avatar Navid Nikaein

*update dlsim to capture overall timing

*add performance measurment test cases
*update the start_one_eNB_multi_UE_nas script



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5151 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 3dfe046c
......@@ -233,7 +233,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN
memcpy(phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->b,
a,
phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3);
LOG_D(PHY, "eNB %d dlsch_encoding_emul pmch , tbs is %d \n",
LOG_D(PHY, "[eNB %d] dlsch_encoding_emul pmch , tbs is %d \n",
phy_vars_eNB->Mod_id,
phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3);
......
......@@ -32,3 +32,15 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti
}
}
double get_time_meas_us(time_stats_t *ts){
static double cpu_freq_GHz = 0.0;
if (cpu_freq_GHz == 0.0)
cpu_freq_GHz = get_cpu_freq_GHz();
if (ts->trials>0)
return (ts->diff/ts->trials/cpu_freq_GHz/1000.0);
}
......@@ -17,6 +17,7 @@ static inline void start_meas(time_stats_t *ts) __attribute__((always_inline));
static inline void stop_meas(time_stats_t *ts) __attribute__((always_inline));
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time);
double get_time_meas_us(time_stats_t *ts);
#if defined(__i386__)
static inline unsigned long long rdtsc_oai(void) __attribute__((always_inline));
......
......@@ -512,6 +512,7 @@ typedef struct
time_stats_t ulsch_multiplexing_stats;
time_stats_t ofdm_demod_stats;
time_stats_t dlsch_rx_pdcch_stats;
time_stats_t rx_dft_stats;
time_stats_t dlsch_channel_estimation_stats;
time_stats_t dlsch_freq_offset_estimation_stats;
......
This diff is collapsed.
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
*******************************************************************************/
/*! \file ulsim.c
\brief Top-level DL simulator
\author R. Knopp
\date 2011
\version 0.1
\company Eurecom
\email: knopp@eurecom.fr
\note
\warning
*/
#include <string.h>
#include <math.h>
#include <unistd.h>
......
......@@ -1053,7 +1053,7 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint
start_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_IN);
#ifdef CBA
if (*access_mode==CBA_ACCESS){
LOG_D(MAC,"[UE %d] frameP %d subframe %d try CBA transmission\n",
......@@ -1087,8 +1087,13 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint
bsr_len = bsr_ce_len + bsr_header_len;
LOG_D(MAC,"[UE %d] header size info: dcch %d, dcch1 %d, dtch %d, bsr (ce%d,hdr%d) buff_len %d\n",
module_idP, dcch_header_len,dcch1_header_len,dtch_header_len, bsr_ce_len, bsr_header_len, buflen);
} else
bsr_len = 0;
} else {
bsr_len=0;
//LOG_D(MAC,"[UE %d] Empty buffers, send a long BSR to reset the bsr at eNB \n ",Mod_id);
// bsr_ce_len = sizeof(BSR_LONG);
//bsr_len = bsr_ce_len + bsr_header_len;
}
// check for UL bandwidth requests and add SR control element
// check for UL bandwidth requests and add SR control element
......@@ -1259,6 +1264,7 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint
bsr_s, // short bsr
bsr_l,
post_padding); // long_bsr
LOG_I(MAC,"[UE %d] Generate header :bufflen %d sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d, dcch_header_len %d, dtch_header_len %d, padding %d,post_padding %d, bsr len %d, phr len %d, reminder %d \n",
module_idP,buflen, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],payload_offset, dcch_header_len, dtch_header_len,
short_padding,post_padding, bsr_len, phr_len,buflen-sdu_length_total-payload_offset);
......
......@@ -157,6 +157,12 @@ boolean_t pdcp_data_req(
rlc_status = rlc_data_req(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p);
} else {
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
LOG_W(PDCP,"[FRAME %5u][%s][PDCP][MOD %u/%u][RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
frameP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
rb_idP);
#if defined(STOP_ON_IP_TRAFFIC_OVERLOAD)
AssertFatal(0, "[FRAME %5u][%s][PDCP][MOD %u/%u][RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
frameP,
......
......@@ -24,7 +24,7 @@ if [ $1 -ge 2 ]; then
sudo ifconfig oai2 10.0.3.3 netmask 255.255.255.0 broadcast 10.0.3.255
# enb -> ue2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -s 10.0.1.1 -t 10.0.1.3 -r 14
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -s 10.0.1.1 -t 10.0.1.3 -r 17
# ue2 -> enb
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i2 -z0 -s 10.0.3.3 -t 10.0.3.1 -r 3
fi
......@@ -34,7 +34,7 @@ if [ $1 -ge 3 ]; then
sudo ifconfig oai3 10.0.4.4 netmask 255.255.255.0 broadcast 10.0.4.255
# enb -> ue2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s 10.0.1.1 -t 10.0.1.4 -r 25
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s 10.0.1.1 -t 10.0.1.4 -r 31
# ue2 -> enb
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i3 -z0 -s 10.0.4.4 -t 10.0.4.1 -r 3
fi
......
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file case02.py
# \brief test case 02 for OAI: executions
# \author Navid Nikaein
# \date 2013
# \version 0.1
# @ingroup _test
import time
import random
import log
import openair
import core
NUM_UE=2
NUM_eNB=1
NUM_TRIALS=3
def execute(oai, user, pw, logfile,logdir):
case = '04'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
try:
test = '00'
name = 'Run oai.dlsim.sanity'
conf = '-a -A AWGN -n 100'
diag = 'dlsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
trace = logdir + '/log_' + case + test + '_1.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'Segmentation fault', 30)
trace = logdir + '/log_' + case + test + '_2.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'Exiting', 30)
trace = logdir + '/log_' + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'FATAL', 30)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '01'
name = 'Run oai.dlsim.test1'
diag = 'Test 1, 10 MHz, R2.FDD (MCS 5), EVA5, -1dB'
conf = '-m5 -gF -s-3.2 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test +'.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06'
name = 'Run oai.dlsim.test5'
diag = 'Test 5, 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)'
conf = '-m4 -gF -s-2 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06'
name = 'Run oai.dlsim.test6'
diag = 'Test 6, 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)'
conf = '-m15 -gF -s4 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06b'
name = 'Run oai.dlsim.test6b'
diag = 'Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)'
conf = '-m14 -gF -s4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '07'
name = 'Run oai.dlsim.test7'
diag = 'Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)'
conf = '-m15 -gG -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O30'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '07b'
name = 'Run oai.dlsim.test7b'
diag = 'Test 7b, 5 MHz, R3-1.FDD (MCS 15), ETU70, 1.4 dB (30%)'
conf = '-m14 -gG -s-1 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O30'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '10'
name = 'Run oai.dlsim.test10'
diag = 'Test 10, 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)'
conf = '-m25 -gF -s13 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '10b'
name = 'Run oai.dlsim.test10b'
diag = 'Test 10b, 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)'
conf = '-m25 -gF -s15.2 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '11'
name = 'Run oai.dlsim.test11'
diag = 'Test 11, 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)'
conf = '-m26 -gF -s14.2 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file case02.py
# \brief test case 02 for OAI: executions
# \author Navid Nikaein
# \date 2013
# \version 0.1
# @ingroup _test
import time
import random
import log
import openair
import core
NUM_UE=2
NUM_eNB=1
NUM_TRIALS=3
def execute(oai, user, pw, logfile,logdir):
case = '04'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
try:
test = '00'
name = 'Run oai.dlsim.sanity'
conf = '-a -A AWGN -n 100'
diag = 'ulsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
trace = logdir + '/log_' + case + test + '_1.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8 ' + conf + tee, 'Segmentation fault', 30)
trace = logdir + '/log_' + case + test + '_2.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8 ' + conf + tee, 'Exiting', 30)
trace = logdir + '/log_' + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8 ' + conf + tee, 'FATAL', 30)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '01'
name = 'Run oai.ulsim.test1'
diag = 'Test 1, 10 MHz, R2.FDD (MCS 5), EVA5, -1dB'
conf = '-m5 -gF -s-3.2 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test +'.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06'
name = 'Run oai.ulsim.test5'
diag = 'Test 5, 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)'
conf = '-m4 -gF -s-2 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06'
name = 'Run oai.ulsim.test6'
diag = 'Test 6, 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)'
conf = '-m15 -gF -s4 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06b'
name = 'Run oai.ulsim.test6b'
diag = 'Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)'
conf = '-m14 -gF -s4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '07'
name = 'Run oai.ulsim.test7'
diag = 'Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)'
conf = '-m15 -gG -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O30'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '10'
name = 'Run oai.ulsim.test10'
diag = 'Test 10, 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)'
conf = '-m25 -gF -s13 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '10b'
name = 'Run oai.ulsim.test10b'
diag = 'Test 10b, 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)'
conf = '-m25 -gF -s15.2 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '11'
name = 'Run oai.ulsim.test11'
diag = 'Test 11, 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)'
conf = '-m26 -gF -s14.2 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file case01.py
# \brief test case 01 for OAI: compilations
# \author Navid Nikaein
# \date 2014
# \version 0.1
# @ingroup _test
import log
import openair
import core
makerr1 = '***'
makerr2 = 'Error 1'
def execute(oai, user, pw, logfile,logdir):
case = '101'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
try:
test = '01'
name = 'Compile oai.rel8.phy.dlsim.make'
conf = 'make dlsim'
trace = logdir + '/log_' + case + test + '.txt;'
tee = ' 2>&1 | tee ' + trace
diag = 'check the compilation errors for dlsim in $OPENAIR1_DIR/SIMULATION/LTE_PHY'
oai.send('make clean;')
oai.send('rm -f ./dlsim.rel8;')
oai.send_expect_false('make dlsim -j4' + tee, makerr1, 1500)
oai.send('cp ./dlsim ./dlsim.rel8;')
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '02'
name = 'Compile oai.rel8.phy.ulsim.make'
conf = 'make ulsim'
trace = logdir + '/log_' + case + test + '.txt;'
tee = ' 2>&1 | tee ' + trace
diag = 'check the compilation errors for ulsim in $OPENAIR1_DIR/SIMULATION/LTE_PHY'
oai.send('make clean;')
oai.send('rm -f ./ulsim.rel8;')
oai.send_expect_false('make ulsim -j4' + tee, makerr1, 1500)
oai.send('cp ./ulsim ./ulsim.rel8;')
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file case02.py
# \brief test case 02 for OAI: executions
# \author Navid Nikaein
# \date 2013
# \version 0.1
# @ingroup _test
import time
import random
import log
import openair
import core
import os
import shutil # copy file
NUM_UE=2
NUM_eNB=1
NUM_TRIALS=3
PRB=[25,50,75,100]
MCS=[4,5,7,9,12,15,18,21,24,27]
ANT_TX=2 # 2
ANT_RX=2 # 2
PDCCH=2 #, 2, 3, 4
CHANNEL=["N"] # A,B,C,D,E,F,
TX_MODE=2 # 2,
MIN_SNR=2
MAX_SNR=18
#OPT="-L -d" # 8bit decoder , activate dci decoding at UE
def execute(oai, user, pw, logfile,logdir):
case = '102'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
try:
test = '0'
name = 'Run oai.dlsim.sanity'
conf = '-a -n 100'
diag = 'dlsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
trace = logdir + '/log_' + case + test + '_1.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'Segmentation fault', 30)
trace = logdir + '/log_' + case + test + '_2.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'Exiting', 30)
trace = logdir + '/log_' + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'FATAL', 30)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = 1
MIN_SNR = 2
name = 'Run oai.dlsim.perf.70%'
diag = 'no diagnostic is available, check the log file'
for i in range(len(PRB)):
for j in range(len(MCS)):
for k in range(1,ANT_TX):
for m in range (1,ANT_RX):
for n in range(1,PDCCH):
for o in range(len(CHANNEL)):
for p in range(1,TX_MODE):
for q in range(MIN_SNR,MAX_SNR):
#if if PRB[i] :
conf = '-B' + str(PRB[i]) + ' -m'+str(MCS[j]) + ' -y'+str(k) + ' -z'+str(m) +' -c'+str(n) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -f.1 -n500 -P -O80' #+ OPT
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+'_mcs'+ str(MCS[j])+ '_anttx' + str(k)+ '_antrx' + str(m) + '_pdcch' + str(n) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
tee = ' 2>&1 | tee ' + trace
match = oai.send_expect_re('./dlsim.rel8 ' + conf + tee, 'passed', 0, 1000)
#print conf
if match :
log.ok(case, str(test), name, conf, '', logfile)
MIN_SNR = q # just to speed up the test
test+=1
break; # found smallest snr
else :
try:
if os.path.isfile(trace) :
os.remove(trace)
except OSError, e: ## if failed, report it back to the user ##
print ("Error: %s - %s." % (e.filename,e.strerror))
except log.err, e:
log.fail(case, str(test), name, conf, e.value, diag, logfile,trace)
#else:
# log.ok(case, test, name, conf, '', logfile)
......@@ -201,17 +201,19 @@ class core:
# **************************send_expect_re*************************
# 1) send a command, and optionally specify a the time to wait
# 2) search for an expected pattern defined by a regular expression in the response
# 3) return a error if not found
# 3) return a error if raise_err flag is set and re not found, otherwise return 'Ok'
# *****************************************************************
def send_expect_re(self, command, expect, delay = 5, rsp1=None, rsp2=None,debug=0):
def send_expect_re(self, command, expect, raise_err=1, delay = 50, rsp1=None, rsp2=None,debug=0):
rsp = self.send_recv(command, delay, rsp1, rsp2)
# print rsp
match = re.compile(expect).search(rsp)
if match:
return match
raise log.err(self.failed(command, expect,debug))
if raise_err:
raise log.err(self.failed(command, expect,debug))
else :
return None
# **************************send_expect*************************
# 1) send a command, and optionally specify a the time to wait
# 2) search for an expected pattern defined by a re in the response
......
......@@ -50,6 +50,7 @@ class openair(core):
self.error = '% '
self.hostname = hostname
self.address = address
self.localhost = None
self.shell_prompt = '$'
core.__init__(self)
......@@ -66,6 +67,30 @@ class openair(core):
except Exception, val:
print "Error:", val
@property
def localhost(self):
if self.localhost :
return self.localhost
elif self.hostname in ['localhost', '127.0.0.7', '::1'] :
self.localhost = self.hostname
return self.localhost
@localhost.setter
def localhost(self,localhost):
self.localhost = localhost
def shcmd(self,cmd,sudo=False):
if sudo:
cmd = "sudo %s" % command
proc = subprocess.Popen(command, shell=True,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
stdout, stderr = proc.communicate()
return (stdout, stderr)
def connect(self, username, password, prompt):
self.prompt1 = self.shell_prompt
if not prompt :
......@@ -78,12 +103,12 @@ class openair(core):
username = root
if not password:
password = username
self.oai = pexpect.spawn('ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "ConnectionAttempts=1" ' \
+ username + '@' + self.address)
index = self.oai.expect([re.escape(self.prompt1), re.escape(self.prompt2), pexpect.TIMEOUT], timeout=40)
if index == 0 :
index = self.oai.expect([re.escape(self.prompt1), re.escape(self.prompt2), pexpect.TIMEOUT], timeout=40)
if index == 0 :
return 'Ok'
else :
index = self.oai.expect(['password:', pexpect.TIMEOUT], timeout=40)
......@@ -95,11 +120,11 @@ class openair(core):
print 'Expected ' + self.prompt1 + ', received >>>>' + self.oai.before + '<<<<'
sys.exit(1)
return 'Ok'
except Exception, val:
time.sleep(5)
print "Error:", val
def disconnect(self):
print 'disconnecting the ssh connection to ' + self.address + '\n'
......
......@@ -47,6 +47,8 @@ import log
import case01
import case02
import case03
import case04
import case05
from openair import *
......@@ -54,6 +56,8 @@ debug = 0
prompt = '$'
pw =''
i = 0
dlsim=0
for arg in sys.argv:
if arg == '-d':
debug = 1
......@@ -63,6 +67,8 @@ for arg in sys.argv:
prompt = sys.argv[i+1]
elif arg == '-w' :
pw = sys.argv[i+1]
elif arg == '-P' :
dlsim = 1
elif arg == '-h' :
print "-d: low debug level"
print "-dd: high debug level"
......@@ -112,6 +118,9 @@ oai.rm_driver(oai,user,pw)
case01.execute(oai, user, pw, logfile,logdir)
case02.execute(oai, user, pw, logfile,logdir)
case03.execute(oai, user, pw, logfile,logdir)
if dlsim != 0 :
case04.execute(oai, user, pw, logfile,logdir)
case05.execute(oai, user, pw, logfile,logdir)
oai.kill(user, pw)
oai.rm_driver(oai,user,pw)
......
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file test01.py
# \brief test 02 for OAI: downlink and uplink performance and profiler
# \author Navid Nikaein
# \date 2014
# \version 0.1
# @ingroup _test
import sys
import wave
import os
import time
import datetime
import getpass
import math #from time import clock
import log
import case11
import case12
from openair import *
debug = 0
prompt = '$'
pw =''
i = 0
for arg in sys.argv:
if arg == '-d':
debug = 1
elif arg == '-dd':
debug = 2
elif arg == '-p' :
prompt = sys.argv[i+1]
elif arg == '-w' :
pw = sys.argv[i+1]
elif arg == '-h' :
print "-d: low debug level"
print "-dd: high debug level"
print "-p: set the prompt"
print "-w: set the password for ssh to localhost"
sys.exit()
i= i + 1
# get the oai object
oai = openair('localdomain','localhost')
#start_time = time.time() # datetime.datetime.now()
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'
if not pw :
print "username: " + user
pw = getpass.getpass()
else :
print "username: " + user
#print "password: " + pw
print "prompt: " + prompt
oai.connect(user,pw,prompt)
#oai.get_shell()
except :
print 'Fail to connect to the local host'
sys.exit(1)
test = 'test02'
ctime=datetime.datetime.utcnow().strftime("%Y-%m-%d.%Hh%M")
logdir = os.getcwd() + '/PERF';
logfile = logdir+'/'+user+'.'+test+'.'+ctime+'.txt'
oai.send_nowait('mkdir -p -m 755' + logdir + ';')
#print '=================start the ' + test + ' at ' + ctime + '=================\n'
#print 'Results will be reported in log file : ' + logfile
log.writefile(logfile,'====================start'+test+' at ' + ctime + '=======================\n')
log.set_debug_level(debug)
oai.kill(user, pw)
#oai.rm_driver(oai,user,pw)
# start te test cases
case11.execute(oai, user, pw, logfile,logdir)
case12.execute(oai, user, pw, logfile,logdir)
oai.kill(user, pw)
#oai.rm_driver(oai,user,pw)
# perform the stats
log.statistics(logfile)
oai.disconnect()
ctime=datetime.datetime.utcnow().strftime("%Y-%m-%d_%Hh%M")
log.writefile(logfile,'====================end the '+ test + ' at ' + ctime +'====================')
print 'Test results can be found in : ' + logfile
#print '\nThis test took %f minutes\n' % math.ceil((time.time() - start_time)/60)
#print '\n=====================end the '+ test + ' at ' + ctime + '====================='
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