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

updates to test framework + bugfixes

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