Commit 68b44452 authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'feature-34-test_framework' into develop

parents e3a8e68e 854d183d
......@@ -97,27 +97,45 @@ Obj.# Case# Test# Description
01 51 06 mbmssim (TBD)
01 55 lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 1TX/2RX, 2TX/1RX 2TX/2RX
01 55 lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX, 2TX/2RX
01 55 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
01 55 00 Band 7 FDD 10MHz UL Throughput for 60 sec
01 55 00 Band 7 FDD 20MHz UL Throughput for 60 sec
01 55 00 Band 7 FDD 5MHz DL Throughput for 60 sec
01 55 00 Band 7 FDD 10MHz DL Throughput for 60 sec
01 55 00 Band 7 FDD 20MHz DL Throughput for 60 sec
01 55 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
01 55 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
01 55 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
01 55 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
01 55 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
01 55 06 Band 7 FDD 5MHz UL Throughput for 60 sec for 2TX/2RX
01 55 07 Band 7 FDD 10MHz UL Throughput for 60 sec for 2TX/2RX
01 55 08 Band 7 FDD 20MHz UL Throughput for 60 sec for 2TX/2RX
01 55 09 Band 7 FDD 5MHz DL Throughput for 60 sec for 2TX/2RX
01 55 10 Band 7 FDD 10MHz DL Throughput for 60 sec for 2TX/2RX
01 55 11 Band 7 FDD 20MHz DL Throughput for 60 sec for 2TX/2RX
01 56 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
01 57 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
01 58 lte-softmodem tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 1TX/2RX, 2TX/1RX 2TX/2RX
01 58 lte-softmodem tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX
01 58 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
01 58 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
01 58 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
01 58 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
01 58 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
01 58 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
01 59 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
01 61 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
01 61 lte-softmodem tests with EXMIMO RF as eNB and ALU EPC w/ Bandrich COTS UE
01 61 lte-softmodem tests with EXMIMO RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX
01 61 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
01 61 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
01 61 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
01 61 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
01 61 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
01 61 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
01 62 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
01 63 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
......
......@@ -400,12 +400,13 @@ else
fi
tmpfile=`mktemp`
echo \'$passwd\' | sudo echo $HOME >& $tmpfile
echo \'$passwd\' | $SUDO echo $HOME >& $tmpfile
tstsudo=`cat $tmpfile`
if [ "$tstsudo" != "$HOME" ]; then
echo "User might not have sudo privileges. Exiting"
echo "tstsudo = $tstsudo"
echo "$USER might not have sudo privileges. Exiting"
exit
else
echo "$USER has sudo privileges"
fi
echo "tstsudo = $tstsudo"
rm -fr $tmpfile
......@@ -495,6 +496,7 @@ for search_expr in "${test_case_array[@]}"
if [ "$class" == "compilation" ]; then
test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags"
elif [ "$class" == "execution" ]; then
$SUDO killall -q oaisim_nos1
test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword"
else
echo "Unexpected class of test case...Skipping the test case $name ...."
......
......@@ -81,8 +81,8 @@ def write_file(filename, string, mode="w"):
#$5 minimum duration of throughput
#The throughput values found in file must be higher than values from from 2,3,4,5
#The function returns True if throughput conditions are saisfied else it returns fails
def tput_test(filename, min_tput, max_tput, average, min_duration):
if os.path.exists(filename):
with open (filename, "r") as myfile:
data=myfile.read()
......@@ -98,13 +98,13 @@ def tput_test(filename, min_tput, max_tput, average, min_duration):
min_list = 0
max_list = 0
average_list=0
tput_string=' ( '+ "min=%0.2f" % min_list + ' Mbps / ' + "max=%0.2f" % max_list + ' Mbps / ' + "avg=%0.2f" % average_list + ' Mbps / ' + "dur=%0.2f" % duration + ' s) '
if (min_list >= min_tput and max_list >= max_tput and average_list >= average and duration >= min_duration):
return True
return True , tput_string
else:
return False
return False , tput_string
else:
return False
return False , tput_string
def try_convert_to_float(string, fail=None):
......@@ -115,6 +115,7 @@ def try_convert_to_float(string, fail=None):
def tput_test_search_expr (search_expr, logfile_traffic):
result=0
tput_string=''
if search_expr !='':
if search_expr.find('throughput_test')!= -1 :
p= re.compile('min\s*=\s*(\d*.\d*)\s*Mbits/sec')
......@@ -151,9 +152,11 @@ def tput_test_search_expr (search_expr, logfile_traffic):
duration = try_convert_to_float(duration)
if (min_tput != None and max_tput != None and avg_tput != None and duration != None ):
result = tput_test(logfile_traffic, min_tput, max_tput, avg_tput, duration)
return result
result, tput_string = tput_test(logfile_traffic, min_tput, max_tput, avg_tput, duration)
else:
result=1
return result, tput_string
def sftp_module (username, password, hostname, ports, paramList,logfile):
......@@ -372,7 +375,7 @@ class testCaseThread_generic (threading.Thread):
except Exception, e:
error=''
error = error + ' In Class = testCaseThread_generic, function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + '\n threadID = ' + str(self.threadID) + '\n threadName = ' + self.name + '\n testcasename = ' + self.testcasename + '\n machine = ' + self.machine + '\n logdirOAI5GRepo = ' + self.logdirOAI5GRepo + '\n' + '\n timeout = ' + str(timeout)
error = error + '\n threadID = ' + str(self.threadID) + '\n threadName = ' + self.name + '\n testcasename = ' + self.testcasename + '\n machine = ' + self.machine + '\n logdirOAI5GRepo = ' + self.logdirOAI5GRepo + '\n' + '\n timeout = ' + str(self.timeout)
error = error + traceback.format_exc()
print error
sys.exit()
......@@ -492,6 +495,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
UE_traffic_exec_args = testcase.findtext('UE_traffic_exec_args',default='')
UE_terminate_missing_procs = testcase.findtext('UE_terminate_missing_procs',default='True')
UE_search_expr_true = testcase.findtext('UE_search_expr_true','')
UE_stop_script = testcase.findtext('UE_stop_script','')
EPCMachine = testcase.findtext('EPC',default='')
EPC_config_file = testcase.findtext('EPC_config_file',default='')
......@@ -573,6 +577,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
logfile_task_eNB_compile = logdir_local_testcase + '/eNB_task_compile' + '_' + str(run) + '_.log'
logfile_task_eNB_out = logdir_eNB + '/eNB_task_out' + '_' + str(run) + '_.log'
logfile_task_eNB = logdir_local_testcase + '/eNB_task' + '_' + str(run) + '_.log'
logfile_local_traffic_eNB_out = logdir_local_testcase + '/eNB_traffic' + '_' + str(run) + '_.log'
task_eNB_compile = ' ( uname -a ; date \n'
task_eNB_compile = task_eNB_compile + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
......@@ -613,6 +618,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
logfile_task_UE = logdir_local_testcase + '/UE_task' + '_' + str(run) + '_.log'
logfile_task_UE_compile_out = logdir_UE + '/UE_task_compile_out' + '_' + str(run) + '_.log'
logfile_task_UE_compile = logdir_local_testcase + '/UE_task_compile' + '_' + str(run) + '_.log'
logfile_local_traffic_UE_out = logdir_local_testcase + '/UE_traffic' + '_' + str(run) + '_.log'
task_UE_compile = ' ( uname -a ; date \n'
task_UE_compile = task_UE_compile + 'array_exec_pid=()' + '\n'
......@@ -660,6 +666,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
logfile_task_EPC = logdir_local_testcase + '/EPC_task' + '_' + str(run) + '_.log'
logfile_task_EPC_compile_out = logdir_EPC + '/EPC_task_compile_out' + '_' + str(run) + '_.log'
logfile_task_EPC_compile = logdir_local_testcase + '/EPC_task_compile' + '_' + str(run) + '_.log'
logfile_local_traffic_EPC_out = logdir_local_testcase + '/EPC_traffic' + '_' + str(run) + '_.log'
task_EPC_compile = ' ( uname -a ; date \n'
task_EPC_compile = task_EPC_compile + 'array_exec_pid=()' + '\n'
......@@ -737,6 +744,20 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox)
cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox)
cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox)
logfile_UE_stop_script_out = logdir_UE + '/UE_stop_script_out' + '_' + str(run) + '_.log'
logfile_UE_stop_script = logdir_local_testcase + '/UE_stop_script' + '_' + str(run) + '_.log'
if UE_stop_script != "":
cmd = ' ( uname -a ; date \n'
cmd = cmd + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
cmd = cmd + 'env |grep OPENAIR \n' + 'array_exec_pid=() \n'
cmd = cmd + UE_stop_script + '\n'
cmd = cmd + ') > ' + logfile_UE_stop_script_out + ' 2>&1 '
write_file(logfile_UE_stop_script , cmd, mode="w")
thread_UE = oaiThread(4, "UE_thread", UEMachine, user, password , cmd, False, timeout_thread)
thread_UE.start()
thread_UE.join()
print "Copying files from EPCMachine : " + EPCMachine + "logdir_EPC = " + logdir_EPC
ssh = SSHSession(EPCMachine , username=user, key_file=None, password=password)
......@@ -751,17 +772,23 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
ssh.get_all(logdir_UE , logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
#Currently we only perform throughput tests
result = tput_test_search_expr(eNB_search_expr_true, logfile_traffic_eNB)
tput_run_string=''
result, tput_string = tput_test_search_expr(eNB_search_expr_true, logfile_local_traffic_eNB_out)
tput_run_string = tput_run_string + tput_string
run_result=run_result&result
result = tput_test_search_expr(EPC_search_expr_true, logfile_traffic_EPC)
result, tput_string = tput_test_search_expr(EPC_search_expr_true, logfile_local_traffic_EPC_out)
run_result=run_result&result
result = tput_test_search_expr(UE_search_expr_true, logfile_traffic_UE)
tput_run_string = tput_run_string + tput_string
result, tput_string = tput_test_search_expr(UE_search_expr_true, logfile_local_traffic_UE_out)
run_result=run_result&result
tput_run_string = tput_run_string + tput_string
if run_result == 1:
run_result_string = 'RUN_'+str(run) + ' = PASS'
run_result_string = ' RUN_'+str(run) + ' = PASS'
else:
run_result_string = 'RUN_'+str(run) + ' = FAIL'
run_result_string = ' RUN_'+str(run) + ' = FAIL'
run_result_string = run_result_string + tput_run_string
test_result=test_result & run_result
test_result_string=test_result_string + run_result_string
......@@ -775,12 +802,12 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
#Now we finalize the xml file of the test case
end_time=time.time()
duration= end_time - start_time
xmlFile = logdir_local + '/cmake_targets/autotests/log/'+ testcasename + 'test.' + testcasename + '.xml'
xmlFile = logdir_local + '/cmake_targets/autotests/log/'+ testcasename + '/test.' + testcasename + '.xml'
if test_result ==0:
result='FAIL'
else:
result = 'PASS'
xml="<testcase classname=\'"+ testcaseclass + "\' name=\'" + testcasename + "."+tags + "\' Run_result=\'" + test_result_string + "\' time=\'" + duration + "\'s RESULT=\'" +result + "\'></testcase>"
xml="\n<testcase classname=\'"+ testcaseclass + "\' name=\'" + testcasename + "."+tags + "\' Run_result=\'" + test_result_string + "\' time=\'" + str(duration) + " s \' RESULT=\'" + result + "\'></testcase> \n"
write_file(xmlFile, xml, mode="w")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -127,7 +127,7 @@ def start_ue () :
ip = IPRoute()
idx = ip.link_lookup(ifname=iface)[0]
os.system ('route add 192.172.0.1 ppp0')
os.system ('ping 192.172.0.1')
os.system ('ping -c 5 192.172.0.1')
break
except Exception, e:
error = ' Interface ' + iface + 'does not exist...'
......
......@@ -555,17 +555,22 @@ function main() {
#####################
if [ "$OAI_TEST" = "1" ]; then
echo_info "10. Running OAI pre commit tests (pre-ci) ..."
read -s -p "Enter Password: " mypassword
echo -e "\n"
echo_error "These scripts ASSUME that user is in /etc/sudoers and can execute commands without PASSWORD prompt"
echo_error "Add the following lines in /etc/sudoers file to make your __user_name__ sudo without password prompt"
echo_error " __your_user_name__ ALL = (ALL:ALL) NOPASSWD: ALL"
echo_error " __your_user_name__ ALL = (ALL) NOPASSWD: ALL "
echo_info "The log file for the autotest script for debugging is located here: $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log "
echo_info "The results of autotests results is located here: $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml "
echo_info "You can hit CTRL-C any time to terminate the autotests..."
echo "Current User Name: $USER"
read -s -p "Enter Password: " mypassword
echo -e "\n"
rm -fr $OPENAIR_DIR/cmake_targets/autotests/log
mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
if [ "$RUN_GROUP" -eq "1" ]; then
echo '$mypassword' | $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" -p '$mypassword' >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
else
echo '$mypassword' | $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -p '$mypassword' >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
fi
wait
else
......
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