Commit 3bf8768d authored by Cedric Roux's avatar Cedric Roux
Browse files

Merge branch 'develop_integration_w50' into 'develop'

Develop integration w50

See merge request !61
parents 01c50449 5ebdbf9f
......@@ -119,6 +119,7 @@ endmacro(add_list_string_option)
####################################################
# compilation flags
#############################################
#set(CMAKE_BUILD_TYPE "Debug")
if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
......@@ -235,6 +236,7 @@ add_boolean_option(DEBUG_OMG False "???")
add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope")
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
add_boolean_option(T_TRACER False "Activate the T tracer, a debugging/monitoring framework" )
add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
......@@ -475,7 +477,7 @@ include_directories ("${X2AP_DIR}")
# Hardware dependant options
###################################
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "2" "Number of antennas in transmission" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
......@@ -1069,11 +1071,14 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c
${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz.c
${OPENAIR1_DIR}/PHY/MODULATION/beamforming.c
${OPENAIR1_DIR}/PHY/MODULATION/compute_bf_weights.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_timefreq.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_est_freq_offset.c
......@@ -1966,7 +1971,7 @@ target_link_libraries (oaisim_nos1 ${T_LIB})
# Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
#####################################
foreach(myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
add_executable(${myExe}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
......@@ -2048,6 +2053,7 @@ if (${T_TRACER})
add_dependencies(oaisim generate_T)
add_dependencies(oaisim_nos1 generate_T)
add_dependencies(dlsim generate_T)
add_dependencies(dlsim_tm7 generate_T)
add_dependencies(ulsim generate_T)
add_dependencies(pbchsim generate_T)
add_dependencies(scansim generate_T)
......
......@@ -75,7 +75,7 @@ class openair(core):
return (stdout, stderr)
def connect(self, username, password, prompt='PEXPECT_OAI'):
max_retries=100
max_retries=10
i=0
while i <= max_retries:
self.prompt1 = prompt
......@@ -97,9 +97,9 @@ class openair(core):
# need to look for twice the string of the prompt
self.oai.prompt()
self.oai.prompt()
self.oai.sendline('uptime')
self.oai.prompt()
print self.oai.before
# self.oai.sendline('uptime')
# self.oai.prompt()
# print self.oai.before
break
except Exception, e:
error=''
......@@ -171,7 +171,7 @@ class openair(core):
sys.exit(1)
def disconnect(self):
print 'disconnecting the ssh connection to ' + self.address + '\n'
# print 'disconnecting the ssh connection to ' + self.address + '\n'
self.oai.send('exit')
# self.cancel()
......
......@@ -20,10 +20,14 @@
# * contact@openairinterface.org
# */
# \author Rohit Gupta
# \author Rohit Gupta - Benoit ROBERT (benoit.robert@syrtem.com)
# \version 0.1
# @ingroup _test
# \Changelog
# 2016-11-18 :
# - Add progess bar during test execution update_progress()
import tempfile
import threading
import sys
......@@ -37,6 +41,8 @@ import math #from time import clock
import xml.etree.ElementTree as ET
import re
#from dict2xml import dict2xml as xmlify
from colorama import Fore, Back, Style
import numpy as np
......@@ -57,6 +63,36 @@ import ssh
from ssh import SSHSession
import argparse
# update_progress() : Displays or updates a console progress bar
## Accepts a float between 0 and 1. Any int will be converted to a float.
## A value under 0 represents a 'halt'.
## A value at 1 or bigger represents 100%
def update_progress(progress, prefix_string):
barLength = 20 # Modify this to change the length of the progress bar
status = ""
#print "progress = "+ str(progress)
if isinstance(progress, int):
progress = float(progress)
if not isinstance(progress, float):
progress = 0
status = "error: progress var must be float\r\n"
if progress < 0:
progress = 0
status = "Halt...\r\n"
if progress >= 1:
progress = 1
status = "Done...\r\n"
block = int(round(barLength*progress))
text = "\r"+prefix_string+" [{0}] {1}% {2}".format( "="*block + " "*(barLength-block), progress*100, status)
sys.stdout.write(text)
sys.stdout.flush()
def exit_prog(exit_val):
print(Style.RESET_ALL),
sys.exit(exit_val)
# \brief write a string to a file
# \param filename name of file
# \param string string to write
......@@ -271,7 +307,7 @@ def update_config_file(oai, config_string, logdirRepo, python_script):
# \param logdir_local_base local directory
# \param operation operation to perform (get_all, put_all) transfers recursively for directories
def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logdir_local_base, operation):
max_tries = 100
max_tries = 10
i=0
while i <= max_tries:
i = i +1
......@@ -306,30 +342,50 @@ def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logd
# \param CleanUpAluLteBox program to terminate AlU Bell Labs LTE Box
# \param ExmimoRfStop String to stop EXMIMO card (specified in test_case_list.xml)
def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop, logdir, logdirOAI5GRepo):
cmd = 'sudo -E killall -s INT -q -r ' + programList + ' ; sleep 5 ; sudo -E killall -9 -q -r ' + programList
cmd = 'killall -9 ' + programList
result = oai.send(cmd, True)
print "Killing old programs..." + result
# print "\t\t > "+cmd
# print "\t\t < "+result
# print "Killing old programs on ..." + result
programArray = programList.split()
programListJoin = '|'.join(programArray)
cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail ; echo \"Current disk space.. \" ; df -h )>& " + logdir + "/oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
result=oai.send_recv(cmd)
# print "\t\t > "+cmd
# print "\t\t < "+result
cmd = cleanupOldProgramsScript + ' ' + '\''+programListJoin+'\''
#result = oai.send_recv(cmd)
#print result
result = oai.send_expect_false(cmd, 'Match found', False)
print "Looking for old programs..." + result
# print "\t\t > "+cmd
# print "\t\t < "+result
# print "Looking for old programs..." + result
res=oai.send_recv(CleanUpAluLteBox, True)
# print "\t\t > "+CleanUpAluLteBox
# print "\t\t < "+res
cmd= " echo \"Starting EXmimoRF Stop... \" >> " + logdir + "/oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync ";
oai.send_recv(cmd)
result = oai.send_recv(cmd)
# print "\t\t > "+cmd
# print "\t\t < "+result
cmd = "( " + "cd " + logdirOAI5GRepo + " ; source oaienv ; " + ExmimoRfStop + " ) >> " + logdir + "/oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync "
print "cleanoldprograms cmd = " + cmd
# print "cleanoldprograms cmd = " + cmd
res=oai.send_recv(cmd, False, timeout=600)
# print "\t\t > "+cmd
# print "\t\t < "+res
cmd= " echo \"Stopping EXmimoRF Stop... \" >> " + logdir + "/oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync ";
oai.send_recv(cmd)
result = oai.send_recv(cmd)
# print "\t\t > "+cmd
# print "\t\t < "+result
#res = oai.send_recv(ExmimoRfStop, False)
cmd = " ( date ;echo \"Finished cleaning old programs.. \" ; dmesg | tail)>> $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
res=oai.send_recv(cmd)
# print "\t\t > "+cmd
# print "\t\t < "+res
# \brief Class thread to launch a generic command on remote machine
# \param threadID number of thread (for book keeping)
......@@ -355,10 +411,10 @@ class oaiThread (threading.Thread):
try:
oai = openair('localdomain',self.machine)
oai.connect(self.username, self.password)
print "Starting " + self.threadname + " on machine " + self.machine
# print "Starting " + self.threadname + " on machine " + self.machine
result = oai.send_recv(self.cmd, self.sudo, self.timeout)
print "result = " + result
print "Exiting " + self.threadname
#print "result = " + result
#print "Exiting " + self.threadname
oai.disconnect()
except Exception, e:
error=''
......@@ -1269,6 +1325,8 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
if testcase_verdict != 'PASS': # if something went wrong to not run test cases
max_ntries=0
indent="\t\t"
runs_results = []
nb_runs = 0
nb_run_pass = 0
......@@ -1288,9 +1346,11 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
#
# RUN initialization
# ----------------------------------------------------
print (Fore.WHITE + indent + "> RUN_"+str(run).zfill(2)+" : " ),
sys.stdout.flush()
prefix_string = Fore.WHITE + indent + "> RUN_"+str(run).zfill(2)+" :"
# print (Fore.WHITE + indent + "> RUN_"+str(run).zfill(2)+" : " ),
# sys.stdout.flush()
run_start_time=datetime.datetime.now()
......@@ -1406,8 +1466,34 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
threads.append(thread_UE)
thread_eNB.start()
thread_UE.start()
run_work_inprogress_flag = True
progress_step = timeout_thread/20
progress_count = 0
while (run_work_inprogress_flag):
update_progress(float(progress_count)/float(timeout_thread),prefix_string)
time.sleep(progress_step)
progress_count += progress_step
# sys.stdout.write ('#')
# sys.stdout.flush()
run_work_inprogress_flag = False
for t in threads:
if t.isAlive():
run_work_inprogress_flag = True
update_progress(1,prefix_string)
for t in threads:
t.join()
t.join()
#
#
......@@ -1422,10 +1508,12 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
fname = logdir_local_run+ '/UE_exec' + '_' + str(run) + '_.log'
cell_synch_status = analyser.check_cell_synchro(fname)
print (Fore.WHITE + indent + "> Check Cell synchro :"),
if cell_synch_status == 'CELL_SYNCH':
print '!!!!!!!!!!!!!! Cell synchronized !!!!!!!!!!!'
print ( Fore.GREEN + cell_synch_status)
else :
print '!!!!!!!!!!!!!! Cell NOT NOT synchronized !!!!!!!!!!!'
print ( Fore.RED + cell_synch_status)
metric_checks_flag = 0
ue_seg_fault_status = analyser.check_exec_seg_fault(fname)
......@@ -1444,6 +1532,9 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
# UE side metrics
metricList=testcase.findall('UE_metric')
for metric in metricList:
metric_verdict = 'PASS'
metric_def = {}
metric_def['id'] = metric.get('id')
metric_def['description'] = metric.get('description')
......@@ -1464,15 +1555,19 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
metric_extracted = analyser.do_extract_metrics(args)
print "\t > Metric "+metric_def['id']+" :"
print "\t\t> min = "+ str( metric_extracted['metric_min'] )
print "\t\t> min_index = "+ str( metric_extracted['metric_min_index'] )
print "\t\t> max = "+ str( metric_extracted['metric_max'] )
print "\t\t> max_index = "+ str( metric_extracted['metric_max_index'] )
print "\t\t> mean = "+ str( metric_extracted['metric_mean'] )
print "\t\t> median = "+ str( metric_extracted['metric_median'] )
print (Fore.WHITE + indent + "> Metric : "+metric_def['id']),
print ("(min="+str( metric_extracted['metric_min'])+", max="+str( metric_extracted['metric_max'])+", mean="+str( metric_extracted['metric_mean'])+", median="+str( metric_extracted['metric_median'])+")")
# print "\t > Metric "+metric_def['id']+" :"
# print "\t\t> min = "+ str( metric_extracted['metric_min'] )
# print "\t\t> min_index = "+ str( metric_extracted['metric_min_index'] )
# print "\t\t> max = "+ str( metric_extracted['metric_max'] )
# print "\t\t> max_index = "+ str( metric_extracted['metric_max_index'] )
# print "\t\t> mean = "+ str( metric_extracted['metric_mean'] )
# print "\t\t> median = "+ str( metric_extracted['metric_median'] )
verdict = analyser.do_check_verdict(metric_def, metric_extracted)
if metric_def['pass_fail_stat'] :
metric_verdict = analyser.do_check_verdict(metric_def, metric_extracted)
metric_fig = logdir_local_run+ '/UE_metric_'+ metric_def['id']+'_' + str(run) + '_.png'
analyser.do_img_metrics(metric_def, metric_extracted, metric_fig)
......@@ -1500,6 +1595,13 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
runs_metrics.append(run_metrics)
if metric_verdict != 'PASS':
verdict = metric_verdict
# End Metrics LOOP
# ---------------------
# Traffic analysis
if UE_traffic_exec != "":
......@@ -1553,9 +1655,9 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
run_stop_time=datetime.datetime.now()
run_duration = run_stop_time-run_start_time
# print (Fore.WHITE + ("duration=" :"),
print (Fore.WHITE + indent + "> RUN duration : "+ str(run_duration) +"s" )
print (Fore.WHITE + indent + "> RUN duration : "+ str(run_duration) +"s" )
print (Fore.WHITE + indent + "> RUN verdict :"),
print (Fore.WHITE + indent + "> RUN verdict :"),
if verdict == 'PASS':
nb_run_pass += 1
......@@ -1585,6 +1687,8 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
# END RUN LOOP
#----------------------------------------------------
indent="\t"
# Test case duration
# ----------------------------------
testcase_time_stop = datetime.datetime.now()
......@@ -1624,11 +1728,9 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
else:
print (Fore.YELLOW+'INCONCLUSIVE')
duration= testcase_time_stop - testcase_time_start
xmlFile = logdir_local_testcase + '/test.' + testcasename + '.xml'
xml="\n<testcase classname=\'"+ testcaseclass + "\' name=\'" + testcasename + "."+tags + "\' Run_result=\'" + test_result_string + "\' time=\'" + str(duration) + " s \' RESULT=\'" + testcase_verdict + "\'></testcase> \n"
write_file(xmlFile, xml, mode="w")
print(Style.RESET_ALL)
duration= testcase_time_stop - testcase_time_start
test_result = dict(testcase_name=testcasename,
testcaseclass=testcaseclass,
......@@ -1647,7 +1749,17 @@ def handle_testcaseclass_softmodem_noS1 (testcase, oldprogramList, logdirOAI5GRe
testcase_eNBMachine =eNBMachine,
testcase_UEMachine =UEMachine,
runs_results = runs_results)
#test_results.append(test_result)
test_results.append(test_result)
xmlFile = logdir_local_testcase + '/test.' + testcasename + '.xml'
xml="\n<testcase classname=\'"+ testcaseclass + "\' name=\'" + testcasename + "."+tags + "\' Run_result=\'" + test_result_string + "\' time=\'" + str(duration) + " s \' RESULT=\'" + testcase_verdict + "\'></testcase> \n"
write_file(xmlFile, xml, mode="w")
# xmlFile_ng = logdir_local_testcase + '/test.' + testcasename + '_ng.xml'
# xml_ng = xmlify(test_result, wrap=testcasename, indent=" ")
# write_file(xmlFile_ng, xml_ng, mode="w")
return testcase_verdict
......@@ -1666,12 +1778,12 @@ def search_test_case_group(testcasename, testcasegroup, test_case_exclude):
if entry.find('+') >=0:
match = re.search(entry, testcasename)
if match:
print "\nSkipping test case as it is found in black list: " + testcasename
#print "\nSkipping test case as it is found in black list: " + testcasename
return False
else:
match = entry.find(testcasename)
if match >=0:
print "\nSkipping test case as it is found in black list: " + testcasename
#print "\nSkipping test case as it is found in black list: " + testcasename
return False
if testcasegroup == '':
return True
......@@ -1759,6 +1871,7 @@ if openairdir_local is None:
print "Environment variable OPENAIR_DIR not set correctly"
sys.exit()
locallogdir = openairdir_local + '/cmake_targets/autotests/log'
reportdir = openairdir_local + '/cmake_targets/autotests/report'
MachineList = ''
MachineListGeneric=''
MachineDescDic={}
......@@ -1767,12 +1880,19 @@ flag_start_testcase=False
nruns_lte_softmodem=''
flag_skip_git_head_check=False
flag_skip_oai_install=False
flag_skip_machine_preparation=False
flag_skip_sanity_check=False
flag_generate_html_report = False
Timeout_cmd=''
xmlInputFile=''
print "Number of arguments argc = " + str(len(sys.argv))
#print "Number of arguments argc = " + str(len(sys.argv))
#for index in range(1,len(sys.argv) ):
# print "argv_" + str(index) + " : " + sys.argv[index]
oai_list = []
i=1
while i < len (sys.argv):
arg=sys.argv[i]
......@@ -1832,9 +1952,15 @@ while i < len (sys.argv):
i = i +1
elif arg == '--skip-oai-install':
flag_skip_oai_install=True
elif arg == '--skip-machine-preparation':
flag_skip_machine_preparation=True
elif arg == '--skip-sanity-check':
flag_skip_sanity_check=True
elif arg == '--test-suite' :
xmlInputFile = sys.argv[i+1]
i = i +1
elif arg == '--generate-html-report':
flag_generate_html_report=True
elif arg == '-h' :
print "-s: This flag *MUST* be set to start the test cases"
print "-r: Remove the log directory in autotests"
......@@ -1852,90 +1978,65 @@ while i < len (sys.argv):
print "--skip-git-head-check: skip checking of GitHead remote/local branch (only for debugging)"
print "--timeout_cmd: Override the default parameter (timeout_cmd) in test_case_list.xml. This parameter is in seconds and should be > 120"
print "--skip-oai-install: Skips the openairinterface5g installer"
print "--skip-machine-preparation: skipp the whole system preparation -> direct to test cases"
print "--skip-sanity-check: skipp the machine sanity checks"
print "--test-suite: Select a XML test-suite file"
print "--generate-html-report: Generate an HTML report of the test campaign (supported only for noS1 testsuite !!)"
sys.exit()
else :
print "Unrecongnized Option: <" + arg + ">. Use -h to see valid options"
sys.exit()
i= i + 1
try:
os.environ["OPENAIR1_DIR"]
except KeyError:
print "Please set the environment variable OPENAIR1_DIR in the .bashrc"
sys.exit(1)
try:
os.environ["OPENAIR2_DIR"]
except KeyError:
print "Please set the environment variable OPENAIR2_DIR in the .bashrc"
sys.exit(1)
try:
os.environ["OPENAIR_TARGETS"]
except KeyError:
print "Please set the environment variable OPENAIR_TARGETS in the .bashrc"
sys.exit(1)
print "Killing zombie ssh sessions from earlier sessions..."
cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"| awk \'{print $2}\' | sudo xargs kill -9 '
os.system(cmd)
logdir = '/tmp/' + 'OAITestFrameWork-' + user + '/'
logdirOAI5GRepo = logdir + 'openairinterface5g/'
logdirOpenaircnRepo = logdir + 'openair-cn/'
patchdir = logdirOAI5GRepo + 'cmake_targets/autotests/patches/'
NFSResultsDir = '/mnt/sradio'
cleanupOldProgramsScript = '$OPENAIR_DIR/cmake_targets/autotests/tools/remove_old_programs.bash'
try:
analyser = __import__("lib_autotest_analyser")
except ImportError as err:
print('Import error: ' + str(err))
exit(0)
#Now we parse the xml file for basic configuration
if xmlInputFile == '':
xmlInputFile=os.environ.get('OPENAIR_DIR')+"/cmake_targets/autotests/test_case_list.xml"
xmlTree = ET.parse(xmlInputFile)
xmlRoot = xmlTree.getroot()
#
# Read test session configuration
# ---------------------------------------------------------------------------------
print (Fore.YELLOW + '\nStep 0.1 - Read test session configuration')
print (Fore.YELLOW + '-------------------------------------------------')
if flag_start_testcase == False:
print "You need to start the testcase by passing option -s. Use -h to see all options. Aborting now..."
sys.exit(1)
test_session_start_time = datetime.datetime.now()
print (Fore.WHITE + ' - start time : '+ str(test_session_start_time))
# get the oai object
host = os.uname()[1]
#oai = openair('localdomain','calisson')
oai_list = []
print (Fore.WHITE + ' - MTC host : '+host)
#start_time = time.time() # datetime.datetime.now()
if user=='':
user = getpass.getuser()
print (Fore.WHITE + ' - user : '+user)
if pw=='':
pw = getpass.getpass()
print (Fore.WHITE + ' - password : '+pw)
print "Killing zombie ssh sessions from earlier sessions..."
cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 '
cmd = cmd + '; ps aux |grep \"/usr/bin/ssh -q -l ' + user + '\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 '
os.system(cmd)
print "host = " + host
print "user = " + user
if xmlInputFile == '':
xmlInputFile=os.environ.get('OPENAIR_DIR')+"/cmake_targets/autotests/test_case_list.xml"
NFSResultsDir = '/mnt/sradio'
cleanupOldProgramsScript = '$OPENAIR_DIR/cmake_targets/autotests/tools/remove_old_programs.bash'
logdir = '/tmp/' + 'OAITestFrameWork-' + user + '/'
logdirOAI5GRepo = logdir + 'openairinterface5g/'
logdirOpenaircnRepo = logdir + 'openair-cn/'
patchdir = logdirOAI5GRepo + 'cmake_targets/autotests/patches/'
if flag_remove_logdir == True:
print "Removing directory: " + locallogdir
os.system(' rm -fr ' + locallogdir + '; mkdir -p ' + locallogdir )
else:
os.system('mkdir -p ' + locallogdir)
paramiko_logfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/log/paramiko.log')
res=os.system(' echo > ' + paramiko_logfile)
paramiko.util.log_to_file(paramiko_logfile)
#pw=getpass.getpass()
print (Fore.WHITE + ' - cmd line flags : ')
print (Fore.WHITE + ' + -s : '+str(flag_start_testcase))
print (Fore.WHITE + ' + -r : '+str(flag_remove_logdir))
print (Fore.WHITE + ' + -c : '+str(cleanUpRemoteMachines))
print (Fore.WHITE + ' + --skip-git-head-check : '+str(flag_skip_git_head_check))
print (Fore.WHITE + ' + --skip-oai-install : '+str(flag_skip_oai_install))
print (Fore.WHITE + ' + --skip-machine-preparation : '+str(flag_skip_machine_preparation))
print (Fore.WHITE + ' + --skip-sanity-check : '+str(flag_skip_sanity_check))
#Now we parse the xml file for basic configuration
xmlTree = ET.parse(xmlInputFile)
xmlRoot = xmlTree.getroot()
print (Fore.WHITE + ' - Test setup basic config : (* -> overwrite by cmd line parameter)')
print (Fore.WHITE + ' + test setup config file : '+str(xmlInputFile))
print (Fore.WHITE + ' + remote setup dir : '+str(logdir))
print (Fore.WHITE + ' + remote OAI5G repo : '+str(logdirOAI5GRepo))
print (Fore.WHITE + ' + remote OpenAirCN repo : '+str(logdirOpenaircnRepo))
if MachineList =='':
......@@ -1948,6 +2049,8 @@ if GitOAI5GRepo == '':
if GitOAI5GRepoBranch == '':
GitOAI5GRepoBranch = xmlRoot.findtext('GitOAI5GRepoBranch',default='')
if GitOAI5GHeadVersion == '':
GitOAI5GHeadVersion = xmlRoot.findtext('GitOAI5GHeadVersion',default='')
GitOpenaircnRepoBranch = xmlRoot.findtext('GitOpenair-cnRepoBranch',default='')
CleanUpOldProgs