Commit 5244b800 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: fix the air_interface support on RAN and OAI-UE sides -- separate member now.

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent d92c6336
This diff is collapsed.
......@@ -77,8 +77,8 @@ class RANManagement():
self.backgroundBuildTestId = ['', '', '']
self.Build_eNB_forced_workspace_cleanup = False
self.Initialize_eNB_args = ''
self.air_interface = '' #changed from 'lte' to '' may lead to side effects in main
self.eNB_instance = ''
self.air_interface = ['', '', ''] #changed from 'lte' to '' may lead to side effects in main
self.eNB_instance = 0
self.eNB_serverId = ''
self.eNBLogFiles = ['', '', '']
self.eNBOptions = ['', '', '']
......@@ -125,13 +125,13 @@ class RANManagement():
# Check if we build an 5G-NR gNB or an LTE eNB or an OCP eNB
result = re.search('--eNBocp', self.Build_eNB_args)
if result is not None:
self.air_interface='ocp-enb'
self.air_interface[self.eNB_instance] = 'ocp-enb'
else:
result = re.search('--gNB', self.Build_eNB_args)
if result is not None:
self.air_interface = 'nr-softmodem'
self.air_interface[self.eNB_instance] = 'nr-softmodem'
else:
self.air_interface = 'lte-softmodem'
self.air_interface[self.eNB_instance] = 'lte-softmodem'
# Worakround for some servers, we need to erase completely the workspace
if self.Build_eNB_forced_workspace_cleanup:
......@@ -205,7 +205,9 @@ class RANManagement():
if self.backgroundBuild:
mySSH.command('echo "./build_oai ' + self.Build_eNB_args + '" > ./my-lte-softmodem-build.sh', '\$', 5)
mySSH.command('chmod 775 ./my-lte-softmodem-build.sh', '\$', 5)
mySSH.command('echo ' + lPassWord + ' | sudo -S -E daemon --inherit --unsafe --name=build_enb_daemon --chdir=' + lSourcePath + '/cmake_targets -o ' + lSourcePath + '/cmake_targets/compile_oai_enb.log ./my-lte-softmodem-build.sh', '\$', 5)
#mySSH.command('echo ' + lPassWord + ' | sudo -S -E daemon --inherit --unsafe --name=build_enb_daemon --chdir=' + lSourcePath + '/cmake_targets -o ' + lSourcePath + '/cmake_targets/compile_oai_enb.log ./my-lte-softmodem-build.sh', '\$', 5)
mySSH.command('echo ' + lPassWord + ' | sudo -S ls', '\$', 5)
mySSH.command('echo $USER; nohup sudo ./my-lte-softmodem-build.sh' + ' > ' + lSourcePath + '/cmake_targets/compile_oai_enb.log ' + ' 2>&1 &', lUserName, 5)
mySSH.close()
if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK)
......@@ -261,7 +263,7 @@ class RANManagement():
#check if we have the build corresponding to the air interface keywords (nr-softmode, lte-softmodem, ocp-enb)
logging.info('CHECK Build with IP='+lIpAddr+' SourcePath='+lSourcePath)
result = re.search(self.air_interface, mySSH.getBefore())
result = re.search(self.air_interface[self.eNB_instance], mySSH.getBefore())
if result is None:
buildStatus = False #if not, build failed
else:
......@@ -304,11 +306,11 @@ class RANManagement():
#generate logging info depending on buildStatus and air interface
if buildStatus:
logging.info('\u001B[1m Building OAI ' + self.air_interface + ' Pass\u001B[0m')
logging.info('\u001B[1m Building OAI ' + self.air_interface[self.eNB_instance] + ' Pass\u001B[0m')
if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK)
else:
logging.error('\u001B[1m Building OAI ' + self.air_interface + ' Failed\u001B[0m')
logging.error('\u001B[1m Building OAI ' + self.air_interface[self.eNB_instance] + ' Failed\u001B[0m')
if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'KO', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTabFooter(False)
......@@ -426,7 +428,8 @@ class RANManagement():
if self.air_interface == 'nr':
mySSH.command('if [ -e rbconfig.raw ]; then echo ' + lPassWord + ' | sudo -S rm rbconfig.raw; fi', '\$', 5)
mySSH.command('if [ -e reconfig.raw ]; then echo ' + lPassWord + ' | sudo -S rm reconfig.raw; fi', '\$', 5)
mySSH.command('echo "ulimit -c unlimited && ./ran_build/build/' + self.air_interface + '-softmodem -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
# NOTE: WE SHALL do a check if the executable is present (in case build went wrong)
mySSH.command('echo "ulimit -c unlimited && ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
mySSH.command('chmod 775 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5)
mySSH.command('hostnamectl','\$', 5)
......@@ -535,8 +538,8 @@ class RANManagement():
lPassWord = self.eNBPassword
mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('stdbuf -o0 ps -aux | grep --color=never ' + self.air_interface + ' | grep -v grep', '\$', 5)
result = re.search(self.air_interface, mySSH.getBefore())
mySSH.command('stdbuf -o0 ps -aux | grep --color=never ' + self.air_interface[self.eNB_instance] + ' | grep -v grep', '\$', 5)
result = re.search(self.air_interface[self.eNB_instance], mySSH.getBefore())
if result is None:
logging.debug('\u001B[1;37;41m eNB Process Not Found! \u001B[0m')
status_queue.put(CONST.ENB_PROCESS_FAILED)
......@@ -568,7 +571,7 @@ class RANManagement():
mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5)
if (self.air_interface == 'lte-softmodem') or (self.air_interface == 'ocp-enb'):
if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'):
nodeB_prefix = 'e'
else:
nodeB_prefix = 'g'
......@@ -831,11 +834,11 @@ class RANManagement():
mbmsRequestMsg += 1
enb_log_file.close()
logging.debug(' File analysis completed')
if (self.air_interface == 'lte-softmodem') or (self.air_interface == 'ocp-enb'):
if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'):
nodeB_prefix = 'e'
else:
nodeB_prefix = 'g'
if self.air_interface == 'nr-softmodem':
if self.air_interface[self.eNB_instance] == 'nr-softmodem':
if ulschReceiveOK > 0:
statMsg = nodeB_prefix + 'NB showed ' + str(ulschReceiveOK) + ' "ULSCH received ok" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
......
......@@ -33,27 +33,29 @@
<testCase id="000001">
<class>Build_eNB</class>
<desc>Build eNB</desc>
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
<Build_eNB_args>-w USRP -c --eNB --ninja</Build_eNB_args>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<backgroundBuild>True</backgroundBuild>
</testCase>
<testCase id="000002">
<testCase id="000004">
<class>WaitEndBuild_eNB</class>
<desc>Wait for end of Build eNB</desc>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="000003">
<testCase id="000002">
<class>Build_eNB</class>
<desc>Build gNB</desc>
<Build_eNB_args>-w USRP -c --gNB</Build_eNB_args>
<Build_eNB_args>-w USRP -c --gNB --ninja</Build_eNB_args>
<eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId>
<backgroundBuild>True</backgroundBuild>
</testCase>
<testCase id="000004">
<testCase id="000003">
<class>WaitEndBuild_eNB</class>
<desc>Wait for end of Build gNB</desc>
<eNB_instance>1</eNB_instance>
......
......@@ -34,7 +34,7 @@
<mode>TesteNB</mode>
<class>Build_eNB</class>
<desc>Build gNB (USRP)</desc>
<Build_eNB_args>--gNB -w USRP</Build_eNB_args>
<Build_eNB_args>--gNB -w USRP --ninja</Build_eNB_args>
<forced_workspace_cleanup>True</forced_workspace_cleanup>
</testCase>
......
......@@ -34,7 +34,7 @@
<mode>TestUE</mode>
<class>Build_OAI_UE</class>
<desc>Build NR UE (USRP)</desc>
<Build_OAI_UE_args>--nrUE -w USRP</Build_OAI_UE_args>
<Build_OAI_UE_args>--nrUE -w USRP --ninja</Build_OAI_UE_args>
<clean_repository>false</clean_repository>
</testCase>
......
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