Commit a055962b authored by Navid Nikaein's avatar Navid Nikaein

* update the oai test 02 for performance benchmarking


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5329 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent eda87e60
...@@ -45,7 +45,7 @@ makerr2 = 'Error 1' ...@@ -45,7 +45,7 @@ makerr2 = 'Error 1'
def execute(oai, user, pw, logfile,logdir,debug): def execute(oai, user, pw, logfile,logdir,debug):
case = '101' case = '101'
rv = 1;
oai.send('cd $OPENAIR1_DIR;') oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;') oai.send('cd SIMULATION/LTE_PHY;')
...@@ -62,6 +62,7 @@ def execute(oai, user, pw, logfile,logdir,debug): ...@@ -62,6 +62,7 @@ def execute(oai, user, pw, logfile,logdir,debug):
oai.send('cp ./dlsim ./dlsim.rel8;') oai.send('cp ./dlsim ./dlsim.rel8;')
except log.err, e: except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace) log.fail(case, test, name, conf, e.value, diag, logfile,trace)
rv =0
else: else:
log.ok(case, test, name, conf, '', logfile) log.ok(case, test, name, conf, '', logfile)
...@@ -78,7 +79,8 @@ def execute(oai, user, pw, logfile,logdir,debug): ...@@ -78,7 +79,8 @@ def execute(oai, user, pw, logfile,logdir,debug):
oai.send('cp ./ulsim ./ulsim.rel8;') oai.send('cp ./ulsim ./ulsim.rel8;')
except log.err, e: except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace) log.fail(case, test, name, conf, e.value, diag, logfile,trace)
rv = 0
else: else:
log.ok(case, test, name, conf, '', logfile) log.ok(case, test, name, conf, '', logfile)
return rv
...@@ -49,15 +49,15 @@ NUM_eNB=1 ...@@ -49,15 +49,15 @@ NUM_eNB=1
NUM_TRIALS=3 NUM_TRIALS=3
PRB=[25]#,50,75,100] PRB=[25]#,50,75,100]
MCS=[4,5]#,7,9,12,15,18,21,24,27] MCS=[4,5,7,9,12,15,18,21,24,27]
ANT_TX=2 # 2 ANT_TX=2 # 2
ANT_RX=2 # 2 ANT_RX=2 # 2
PDCCH=2 #, 2, 3, 4 PDCCH=2 #, 2, 3, 4
CHANNEL=["N"] # A,B,C,D,E,F, CHANNEL=["N"] # A,B,C,D,E,F,
TX_MODE=2 # 2, TX_MODE=2 # 2,
MIN_SNR=2 MIN_SNR=2
MAX_SNR=18 MAX_SNR=34
PERF=80 PERF=75
OPT="-L" OPT="-L"
FRAME=500 FRAME=500
...@@ -94,7 +94,7 @@ def execute(oai, user, pw, logfile,logdir,debug): ...@@ -94,7 +94,7 @@ def execute(oai, user, pw, logfile,logdir,debug):
try: try:
test = 1 test = 1
MIN_SNR = 2 MIN_SNR = 2
name = 'Run oai.dlsim.perf.70%' name = 'Run oai.dlsim.perf.'+str(PERF)+'%'
diag = 'no diagnostic is available, check the log file' diag = 'no diagnostic is available, check the log file'
for i in range(len(PRB)): for i in range(len(PRB)):
for j in range(len(MCS)): for j in range(len(MCS)):
...@@ -106,20 +106,23 @@ def execute(oai, user, pw, logfile,logdir,debug): ...@@ -106,20 +106,23 @@ def execute(oai, user, pw, logfile,logdir,debug):
for q in range(MIN_SNR,MAX_SNR): for q in range(MIN_SNR,MAX_SNR):
#if if PRB[i] : #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 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 -P -n'+str(FRAME)+' -O'+str(PERF) #+' '+ 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'
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 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ 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' 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 tee = ' 2>&1 | tee ' + trace
match = oai.send_expect_re('./dlsim.rel8 ' + conf + tee, 'passed', 0, 1000) match = oai.send_expect_re('./dlsim.rel8 ' + conf + tee, 'passed', 0, 1000)
if debug : if debug :
print conf print conf
if match : if match :
log.ok(case, str(test), name, conf, '', logfile) log.ok(case, str(test), name, conf, '', logfile)
MIN_SNR = q # just to speed up the test MIN_SNR = q -1 # just to speed up the test
test+=1 test+=1
break; # found the smallest snr break # found the smallest snr
else : else :
if q == MAX_SNR -1 :
log.skip(case,str(test), name, conf,'','',logfile)
test+=1
break # do not remove the last log file
try: try:
if os.path.isfile(trace) : if os.path.isfile(trace) :
os.remove(trace) os.remove(trace)
...@@ -127,6 +130,9 @@ def execute(oai, user, pw, logfile,logdir,debug): ...@@ -127,6 +130,9 @@ def execute(oai, user, pw, logfile,logdir,debug):
except OSError, e: ## if failed, report it back to the user ## except OSError, e: ## if failed, report it back to the user ##
print ("Error: %s - %s." % (e.filename,e.strerror)) print ("Error: %s - %s." % (e.filename,e.strerror))
except log.err, e: except log.err, e:
log.fail(case, str(test), name, conf, e.value, diag, logfile,trace) log.fail(case, str(test), name, conf, e.value, diag, logfile,trace)
#else: #else:
......
...@@ -56,7 +56,7 @@ CHANNEL=["N"] # A,B,C,D,E,F, ...@@ -56,7 +56,7 @@ CHANNEL=["N"] # A,B,C,D,E,F,
TX_MODE=2 # 2, TX_MODE=2 # 2,
MIN_SNR=2 MIN_SNR=2
MAX_SNR=34 MAX_SNR=34
PERF=80 PERF=75
OPT="-L" OPT="-L"
FRAME=500 FRAME=500
#OPT="-L -d" # 8bit decoder , activate dci decoding at UE #OPT="-L -d" # 8bit decoder , activate dci decoding at UE
...@@ -102,27 +102,31 @@ def execute(oai, user, pw, logfile,logdir,debug): ...@@ -102,27 +102,31 @@ def execute(oai, user, pw, logfile,logdir,debug):
for q in range(MIN_SNR,MAX_SNR): for q in range(MIN_SNR,MAX_SNR):
#if if PRB[i] : #if if PRB[i] :
conf = '-B' + str(PRB[i]) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT conf = '-B' + str(PRB[i]) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF) #+' '+ OPT
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+'_mcs'+ str(MCS[j])+ '_antrx' + str(m) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log' trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+'_mcs'+ str(MCS[j])+ '_antrx' + str(m) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
tee = ' 2>&1 | tee ' + trace tee = ' 2>&1 | tee ' + trace
match = oai.send_expect_re('./ulsim.rel8 ' + conf + tee, 'passed', 0, 1000) match = oai.send_expect_re('./ulsim.rel8 ' + conf + tee, 'passed', 0, 1000)
if debug : if debug :
print conf print conf
if q == MAX_SNR :
log.skip(case,str(test), name, conf,'','',logfile)
if match : if match :
log.ok(case, str(test), name, conf, '', logfile) log.ok(case, str(test), name, conf, '', logfile)
MIN_SNR = q # just to speed up the test MIN_SNR = q - 1 # just to speed up the test
test+=1 test+=1
break; # found the smallest snr break # found the smallest snr
else : else :
if q == MAX_SNR -1 :
log.skip(case,str(test), name, conf,'','',logfile)
test+=1
break
try: try:
if os.path.isfile(trace) : if os.path.isfile(trace) :
os.remove(trace) os.remove(trace)
except OSError, e: ## if failed, report it back to the user ## except OSError, e: ## if failed, report it back to the user ##
print ("Error: %s - %s." % (e.filename,e.strerror)) print ("Error: %s - %s." % (e.filename,e.strerror))
except log.err, e: except log.err, e:
log.fail(case, str(test), name, conf, e.value, diag, logfile,trace) log.fail(case, str(test), name, conf, e.value, diag, logfile,trace)
#else: #else:
......
...@@ -170,3 +170,17 @@ class openair(core): ...@@ -170,3 +170,17 @@ class openair(core):
oai.send_nowait('cd '+ pwd) oai.send_nowait('cd '+ pwd)
except Error, val: except Error, val:
print "Error inserting oai network driver module:", val print "Error inserting oai network driver module:", val
def cleandir (self, logdir,debug) :
for filename in os.listdir(logdir):
filepath = os.path.join(logdir, filename)
if debug == 2 :
print 'logdir is ' + logdir
print 'filepath is ' + filepath
try:
shutil.rmtree(filepath)
except OSError:
os.remove(filepath)
#print 'Could not remove the filepath'+ filepath + ' with error ' + OSError
...@@ -55,6 +55,8 @@ debug = 0 ...@@ -55,6 +55,8 @@ debug = 0
prompt = '$' prompt = '$'
pw ='' pw =''
i = 0 i = 0
clean = 0
start_case = 0
for arg in sys.argv: for arg in sys.argv:
if arg == '-d': if arg == '-d':
debug = 1 debug = 1
...@@ -64,11 +66,16 @@ for arg in sys.argv: ...@@ -64,11 +66,16 @@ for arg in sys.argv:
prompt = sys.argv[i+1] prompt = sys.argv[i+1]
elif arg == '-w' : elif arg == '-w' :
pw = sys.argv[i+1] pw = sys.argv[i+1]
elif arg == '-c' :
clean = 1
elif arg == '-s' :
start_case = sys.argv[i+1]
elif arg == '-h' : elif arg == '-h' :
print "-d: low debug level" print "-d: low debug level"
print "-dd: high debug level" print "-dd: high debug level"
print "-p: set the prompt" print "-p: set the prompt"
print "-w: set the password for ssh to localhost" print "-w: set the password for ssh to localhost"
print "-c: clean the log directory "
sys.exit() sys.exit()
i= i + 1 i= i + 1
...@@ -107,13 +114,19 @@ log.writefile(logfile,'====================start'+test+' at ' + ctime + '======= ...@@ -107,13 +114,19 @@ log.writefile(logfile,'====================start'+test+' at ' + ctime + '=======
log.set_debug_level(debug) log.set_debug_level(debug)
oai.kill(user, pw) oai.kill(user, pw)
if clean == 1 :
oai.cleandir(logdir,debug)
#oai.rm_driver(oai,user,pw) #oai.rm_driver(oai,user,pw)
# start te test cases # start te test cases
#case11.execute(oai, user, pw, logfile,logdir,debug) #compile
#case12.execute(oai, user, pw, logfile,logdir,debug) rv=case11.execute(oai, user, pw, logfile,logdir,debug)
case13.execute(oai, user, pw, logfile,logdir,debug) if rv != 0 :
case12.execute(oai, user, pw, logfile,logdir,debug)
case13.execute(oai, user, pw, logfile,logdir,debug)
else :
print 'Compilation error: skip case 12 and 13'
oai.kill(user, pw) oai.kill(user, pw)
#oai.rm_driver(oai,user,pw) #oai.rm_driver(oai,user,pw)
......
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