Commit 0aeb77ce authored by Rohit Gupta's avatar Rohit Gupta

updates to test framework + bugfixes

parent 6e1e41db
...@@ -41,6 +41,8 @@ import os ...@@ -41,6 +41,8 @@ import os
import array import array
import shutil import shutil
import subprocess import subprocess
import sys
import traceback
# import call # import call
from core import * from core import *
...@@ -102,8 +104,12 @@ class openair(core): ...@@ -102,8 +104,12 @@ class openair(core):
self.oai.prompt() self.oai.prompt()
print self.oai.before print self.oai.before
except Error, val : except Exception, e:
print "Error: can't connect to"+username+"@"+self.address error=''
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
sys.exit(1)
def connect2(self, username, password, prompt='$'): def connect2(self, username, password, prompt='$'):
self.prompt1 = prompt self.prompt1 = prompt
...@@ -133,9 +139,12 @@ class openair(core): ...@@ -133,9 +139,12 @@ class openair(core):
sys.exit(1) sys.exit(1)
return 'Ok' return 'Ok'
except Exception, val: except Exception, e:
time.sleep(5) error=''
print "Error:", val error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
sys.exit(1)
def connect_localshell(self, prompt='$'): def connect_localshell(self, prompt='$'):
self.prompt1 = prompt self.prompt1 = prompt
...@@ -152,9 +161,12 @@ class openair(core): ...@@ -152,9 +161,12 @@ class openair(core):
else : else :
sys.exit(1) sys.exit(1)
except Exception, val: except Exception, e:
time.sleep(5) error=''
print "Error:", val error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
sys.exit(1)
def disconnect(self): def disconnect(self):
print 'disconnecting the ssh connection to ' + self.address + '\n' print 'disconnecting the ssh connection to ' + self.address + '\n'
...@@ -173,8 +185,12 @@ class openair(core): ...@@ -173,8 +185,12 @@ class openair(core):
os.system('echo '+pw+' | sudo -S pkill cc1') os.system('echo '+pw+' | sudo -S pkill cc1')
time.sleep(1) time.sleep(1)
os.system('echo '+pw+' | sudo -S pkill oaisim oaisim_nos1') os.system('echo '+pw+' | sudo -S pkill oaisim oaisim_nos1')
except Error, val: except Exception, e:
print "Error:", val error=''
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
sys.exit(1)
def rm_driver(self,oai,user, pw): def rm_driver(self,oai,user, pw):
try: try:
...@@ -184,8 +200,12 @@ class openair(core): ...@@ -184,8 +200,12 @@ class openair(core):
else : else :
oai.send_nowait('echo '+pw+ ' | sudo -S rmmod nasmesh;') oai.send_nowait('echo '+pw+ ' | sudo -S rmmod nasmesh;')
#os.system('echo '+pw+ ' | sudo -S rmmod nasmesh;') #os.system('echo '+pw+ ' | sudo -S rmmod nasmesh;')
except Error, val: except Exception, e:
print "Error removing oai network driver module:", val error=''
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
sys.exit(1)
def driver(self,oai,user,pw): def driver(self,oai,user,pw):
#pwd = oai.send_recv('pwd') #pwd = oai.send_recv('pwd')
...@@ -197,8 +217,12 @@ class openair(core): ...@@ -197,8 +217,12 @@ class openair(core):
else : else :
oai.send('echo '+pw+ ' | sudo -S insmod ./nasmesh.ko;') oai.send('echo '+pw+ ' | sudo -S insmod ./nasmesh.ko;')
except Error, val: except Exception, e:
print "Error inserting oai network driver module:", val error=''
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
sys.exit(1)
def cleandir (self, logdir,debug) : def cleandir (self, logdir,debug) :
...@@ -209,8 +233,12 @@ class openair(core): ...@@ -209,8 +233,12 @@ class openair(core):
print 'filepath is ' + filepath print 'filepath is ' + filepath
try: try:
shutil.rmtree(filepath) shutil.rmtree(filepath)
except OSError: except Exception, e:
os.remove(filepath) error=''
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
sys.exit(1)
#print 'Could not remove the filepath'+ filepath + ' with error ' + OSError #print 'Could not remove the filepath'+ filepath + ' with error ' + OSError
def create_dir(self,dirname,debug) : def create_dir(self,dirname,debug) :
......
...@@ -107,6 +107,7 @@ function test_compile() { ...@@ -107,6 +107,7 @@ function test_compile() {
#mkdir -p $build_dir #mkdir -p $build_dir
cd $log_dir cd $log_dir
{ {
uname -a
compile_log_dir=`eval echo \"$OPENAIR_DIR/cmake_targets/log/\"` compile_log_dir=`eval echo \"$OPENAIR_DIR/cmake_targets/log/\"`
echo "Removing compilation log files in $compile_log_dir" echo "Removing compilation log files in $compile_log_dir"
rm -frv $compile_log_dir rm -frv $compile_log_dir
...@@ -236,6 +237,7 @@ function test_compile_and_run() { ...@@ -236,6 +237,7 @@ function test_compile_and_run() {
cd $log_dir cd $log_dir
{ {
uname -a
#eval $pre_compile_prog #eval $pre_compile_prog
#cmake .. #cmake ..
#rm -fv $exec_file #rm -fv $exec_file
...@@ -272,7 +274,7 @@ function test_compile_and_run() { ...@@ -272,7 +274,7 @@ function test_compile_and_run() {
fi fi
echo "Executing $main_exec $main_exec_args_array_index " echo "Executing $main_exec $main_exec_args_array_index "
echo "Executing $main_exec $main_exec_args_array_index " >> $temp_exec_log echo "Executing $main_exec $main_exec_args_array_index " >> $temp_exec_log
{ eval "$main_exec $main_exec_args_array_index" ;} >> $temp_exec_log 2>&1 { uname -a ; eval "$main_exec $main_exec_args_array_index" ;} >> $temp_exec_log 2>&1
echo "</EXECUTION LOG Test Case = $test_case_name.${tags_array[$tags_array_index]}, Run = $run_index >" >> $temp_exec_log 2>&1 echo "</EXECUTION LOG Test Case = $test_case_name.${tags_array[$tags_array_index]}, Run = $run_index >" >> $temp_exec_log 2>&1
cat $temp_exec_log >> $log_file 2>&1 cat $temp_exec_log >> $log_file 2>&1
...@@ -504,6 +506,8 @@ for search_expr in "${test_case_array[@]}" ...@@ -504,6 +506,8 @@ for search_expr in "${test_case_array[@]}"
} }
uname -a
main "$@" main "$@"
xUnit_write "$results_file" xUnit_write "$results_file"
......
<testCaseList> <testCaseList>
<MachineList>amerique stevens calisson nano</MachineList> <MachineList>stevens calisson mozart nano amerique</MachineList>
<NFSResultsShare>/mnt/sradio/TEST_RESULTS</NFSResultsShare> <NFSResultsShare>/mnt/sradio/TEST_RESULTS</NFSResultsShare>
<GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo> <GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo>
<GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo> <GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo>
<GitOAI5GRepoBranch>feature-34-test_framework</GitOAI5GRepoBranch> <GitOAI5GRepoBranch>feature-34-test_framework</GitOAI5GRepoBranch>
<GitOpenair-cnRepoBranch>feature-17-test_framework</GitOpenair-cnRepoBranch> <GitOpenair-cnRepoBranch>feature-17-test_framework</GitOpenair-cnRepoBranch>
<CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* hss hss_sim configure_cots_bandrich_ue* wvdial* </CleanUpOldProgs> <CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* hss hss_sim configure_cots_bandrich_ue* wvdial* run_exec_autotests*</CleanUpOldProgs>
<CleanUpAluLteBox>/opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox> <CleanUpAluLteBox>/opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox>
<Timeout_execution>1800</Timeout_execution> <Timeout_execution>1800</Timeout_execution>
<MachineListGeneric>calisson stevens mozart nano amerique</MachineListGeneric>
<testCase id="010101" > <testCase id="010101" >
<class>compilation</class> <class>compilation</class>
<desc>Build oaisim.Rel8</desc> <desc>Build oaisim.Rel8</desc>
......
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