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
...@@ -119,6 +119,7 @@ class OaiCiTest(): ...@@ -119,6 +119,7 @@ class OaiCiTest():
self.Build_OAI_UE_args = '' self.Build_OAI_UE_args = ''
self.Initialize_OAI_UE_args = '' self.Initialize_OAI_UE_args = ''
self.clean_repository = True self.clean_repository = True
self.air_interface=''
self.expectedNbOfConnectedUEs = 0 self.expectedNbOfConnectedUEs = 0
def BuildOAIUE(self): def BuildOAIUE(self):
...@@ -128,10 +129,10 @@ class OaiCiTest(): ...@@ -128,10 +129,10 @@ class OaiCiTest():
SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword) SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword)
result = re.search('--nrUE', self.Build_OAI_UE_args) result = re.search('--nrUE', self.Build_OAI_UE_args)
if result is not None: if result is not None:
RAN.air_interface='nr' self.air_interface='nr-uesoftmodem'
ue_prefix = 'NR ' ue_prefix = 'NR '
else: else:
RAN.air_interface='lte' self.air_interface='lte-uesoftmodem'
ue_prefix = '' ue_prefix = ''
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository) result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
if result is not None: if result is not None:
...@@ -171,7 +172,7 @@ class OaiCiTest(): ...@@ -171,7 +172,7 @@ class OaiCiTest():
mismatch = True mismatch = True
if not mismatch: if not mismatch:
SSH.close() SSH.close()
HTML.CreateHtmlTestRow(RAN.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.Build_OAI_UE_args, 'OK', CONST.ALL_PROCESSES_OK)
return return
SSH.command('echo ' + self.UEPassword + ' | sudo -S git clean -x -d -ff', '\$', 30) SSH.command('echo ' + self.UEPassword + ' | sudo -S git clean -x -d -ff', '\$', 30)
...@@ -197,7 +198,7 @@ class OaiCiTest(): ...@@ -197,7 +198,7 @@ class OaiCiTest():
SSH.command('ls ran_build/build', '\$', 3) SSH.command('ls ran_build/build', '\$', 3)
SSH.command('ls ran_build/build', '\$', 3) SSH.command('ls ran_build/build', '\$', 3)
buildStatus = True buildStatus = True
result = re.search(RAN.air_interface + '-uesoftmodem', SSH.getBefore()) result = re.search(self.air_interface, SSH.getBefore())
if result is None: if result is None:
buildStatus = False buildStatus = False
SSH.command('mkdir -p build_log_' + self.testCase_id, '\$', 5) SSH.command('mkdir -p build_log_' + self.testCase_id, '\$', 5)
...@@ -322,7 +323,7 @@ class OaiCiTest(): ...@@ -322,7 +323,7 @@ class OaiCiTest():
if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if RAN.air_interface == 'lte': if self.air_interface == 'lte-uesoftmodem':
result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args))
if result is None: if result is None:
check_eNB = True check_eNB = True
...@@ -351,7 +352,7 @@ class OaiCiTest(): ...@@ -351,7 +352,7 @@ class OaiCiTest():
# Initialize_OAI_UE_args usually start with -C and followed by the location in repository # Initialize_OAI_UE_args usually start with -C and followed by the location in repository
SSH.command('source oaienv', '\$', 5) SSH.command('source oaienv', '\$', 5)
SSH.command('cd cmake_targets/ran_build/build', '\$', 5) SSH.command('cd cmake_targets/ran_build/build', '\$', 5)
if RAN.air_interface == 'lte': if self.air_interface == 'lte-uesoftmodem':
result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args))
# We may have to regenerate the .u* files # We may have to regenerate the .u* files
if result is None: if result is None:
...@@ -373,7 +374,7 @@ class OaiCiTest(): ...@@ -373,7 +374,7 @@ class OaiCiTest():
copyin_res = SSH.copyin(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, RAN.eNBSourceCodePath + '/cmake_targets/reconfig.raw', '.') copyin_res = SSH.copyin(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, RAN.eNBSourceCodePath + '/cmake_targets/reconfig.raw', '.')
if (copyin_res == 0): if (copyin_res == 0):
SSH.copyout(self.UEIPAddress, self.UEUserName, self.UEPassword, './reconfig.raw', self.UESourceCodePath + '/cmake_targets/ran_build/build') SSH.copyout(self.UEIPAddress, self.UEUserName, self.UEPassword, './reconfig.raw', self.UESourceCodePath + '/cmake_targets/ran_build/build')
SSH.command('echo "ulimit -c unlimited && ./'+ RAN.air_interface +'-uesoftmodem ' + self.Initialize_OAI_UE_args + '" > ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) SSH.command('echo "ulimit -c unlimited && ./'+ self.air_interface +' ' + self.Initialize_OAI_UE_args + '" > ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5)
SSH.command('chmod 775 ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) SSH.command('chmod 775 ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5)
SSH.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5) SSH.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5)
self.UELogFile = 'ue_' + self.testCase_id + '.log' self.UELogFile = 'ue_' + self.testCase_id + '.log'
...@@ -404,7 +405,7 @@ class OaiCiTest(): ...@@ -404,7 +405,7 @@ class OaiCiTest():
doLoop = False doLoop = False
continue continue
SSH.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4) SSH.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4)
if RAN.air_interface == 'nr': if self.air_interface == 'nr-uesoftmodem':
result = re.search('Starting sync detection', SSH.getBefore()) result = re.search('Starting sync detection', SSH.getBefore())
else: else:
result = re.search('got sync', SSH.getBefore()) result = re.search('got sync', SSH.getBefore())
...@@ -429,7 +430,7 @@ class OaiCiTest(): ...@@ -429,7 +430,7 @@ class OaiCiTest():
# That is the case for LTE # That is the case for LTE
# In NR case, it's a positive message that will show if synchronization occurs # In NR case, it's a positive message that will show if synchronization occurs
doLoop = True doLoop = True
if RAN.air_interface == 'nr': if self.air_interface == 'nr-uesoftmodem':
loopCounter = 10 loopCounter = 10
else: else:
# We are now checking if sync w/ eNB DOES NOT OCCUR # We are now checking if sync w/ eNB DOES NOT OCCUR
...@@ -438,7 +439,7 @@ class OaiCiTest(): ...@@ -438,7 +439,7 @@ class OaiCiTest():
while (doLoop): while (doLoop):
loopCounter = loopCounter - 1 loopCounter = loopCounter - 1
if (loopCounter == 0): if (loopCounter == 0):
if RAN.air_interface == 'nr': if self.air_interface == 'nr-uesoftmodem':
# Here we do have great chances that UE did NOT cell-sync w/ gNB # Here we do have great chances that UE did NOT cell-sync w/ gNB
doLoop = False doLoop = False
fullSyncStatus = False fullSyncStatus = False
...@@ -457,7 +458,7 @@ class OaiCiTest(): ...@@ -457,7 +458,7 @@ class OaiCiTest():
fullSyncStatus = True fullSyncStatus = True
continue continue
SSH.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync|Frequency"', '\$', 4) SSH.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync|Frequency"', '\$', 4)
if RAN.air_interface == 'nr': if self.air_interface == 'nr-uesoftmodem':
# Positive messaging --> # Positive messaging -->
result = re.search('Measured Carrier Frequency', SSH.getBefore()) result = re.search('Measured Carrier Frequency', SSH.getBefore())
if result is not None: if result is not None:
...@@ -486,12 +487,12 @@ class OaiCiTest(): ...@@ -486,12 +487,12 @@ class OaiCiTest():
if fullSyncStatus and gotSyncStatus: if fullSyncStatus and gotSyncStatus:
doInterfaceCheck = False doInterfaceCheck = False
if RAN.air_interface == 'lte': if self.air_interface == 'lte-uesoftmodem':
result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args))
if result is None: if result is None:
doInterfaceCheck = True doInterfaceCheck = True
# For the moment, only in explicit noS1 without kernel module (ie w/ tunnel interface) # For the moment, only in explicit noS1 without kernel module (ie w/ tunnel interface)
if RAN.air_interface == 'nr': if self.air_interface == 'nr-uesoftmodem':
result = re.search('--noS1 --nokrnmod 1', str(self.Initialize_OAI_UE_args)) result = re.search('--noS1 --nokrnmod 1', str(self.Initialize_OAI_UE_args))
if result is not None: if result is not None:
doInterfaceCheck = True doInterfaceCheck = True
...@@ -531,7 +532,7 @@ class OaiCiTest(): ...@@ -531,7 +532,7 @@ class OaiCiTest():
self.UEDevicesStatus = [] self.UEDevicesStatus = []
self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED) self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED)
else: else:
if RAN.air_interface == 'lte': if self.air_interface == 'lte-uesoftmodem':
if RAN.eNBmbmsEnables[0]: if RAN.eNBmbmsEnables[0]:
HTML.htmlUEFailureMsg='oaitun_ue1/oaitun_uem1 interfaces are either NOT mounted or NOT configured' HTML.htmlUEFailureMsg='oaitun_ue1/oaitun_uem1 interfaces are either NOT mounted or NOT configured'
else: else:
...@@ -1086,7 +1087,10 @@ class OaiCiTest(): ...@@ -1086,7 +1087,10 @@ class OaiCiTest():
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
if self.ADBCentralized: if self.ADBCentralized:
SSH.command('adb devices', '\$', 15) if self.ADBIPAddress == '192.168.18.196':
SSH.command('/home/oaici/remi/android-sdk-linux/platform-tools/adb devices', '\$', 15)
else:
SSH.command('adb devices', '\$', 15)
#self.UEDevices = re.findall("\\\\r\\\\n([A-Za-z0-9]+)\\\\tdevice",SSH.getBefore()) #self.UEDevices = re.findall("\\\\r\\\\n([A-Za-z0-9]+)\\\\tdevice",SSH.getBefore())
self.UEDevices = re.findall("\\\\r\\\\n([A-Za-z0-9]+)\\\\tdevice",SSH.getBefore()) self.UEDevices = re.findall("\\\\r\\\\n([A-Za-z0-9]+)\\\\tdevice",SSH.getBefore())
SSH.close() SSH.close()
...@@ -2414,8 +2418,8 @@ class OaiCiTest(): ...@@ -2414,8 +2418,8 @@ class OaiCiTest():
def CheckOAIUEProcess(self, status_queue): def CheckOAIUEProcess(self, status_queue):
try: try:
SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword) SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword)
SSH.command('stdbuf -o0 ps -aux | grep --color=never ' + RAN.air_interface + '-uesoftmodem | grep -v grep', '\$', 5) SSH.command('stdbuf -o0 ps -aux | grep --color=never ' + self.air_interface + ' | grep -v grep', '\$', 5)
result = re.search(RAN.air_interface + '-uesoftmodem', SSH.getBefore()) result = re.search(self.air_interface, SSH.getBefore())
if result is None: if result is None:
logging.debug('\u001B[1;37;41m OAI UE Process Not Found! \u001B[0m') logging.debug('\u001B[1;37;41m OAI UE Process Not Found! \u001B[0m')
status_queue.put(CONST.OAI_UE_PROCESS_FAILED) status_queue.put(CONST.OAI_UE_PROCESS_FAILED)
...@@ -2772,7 +2776,7 @@ class OaiCiTest(): ...@@ -2772,7 +2776,7 @@ class OaiCiTest():
logging.debug('\u001B[1m' + ueAction + ' Failed \u001B[0m') logging.debug('\u001B[1m' + ueAction + ' Failed \u001B[0m')
HTML.htmlUEFailureMsg='<b>' + ueAction + ' Failed</b>\n' + HTML.htmlUEFailureMsg HTML.htmlUEFailureMsg='<b>' + ueAction + ' Failed</b>\n' + HTML.htmlUEFailureMsg
HTML.CreateHtmlTestRow('N/A', 'KO', logStatus, 'UE') HTML.CreateHtmlTestRow('N/A', 'KO', logStatus, 'UE')
if RAN.air_interface == 'lte': if self.air_interface == 'lte-uesoftmodem':
# In case of sniffing on commercial eNBs we have random results # In case of sniffing on commercial eNBs we have random results
# Not an error then # Not an error then
if (logStatus != CONST.OAI_UE_PROCESS_COULD_NOT_SYNC) or (ueAction != 'Sniffing'): if (logStatus != CONST.OAI_UE_PROCESS_COULD_NOT_SYNC) or (ueAction != 'Sniffing'):
...@@ -2811,7 +2815,7 @@ class OaiCiTest(): ...@@ -2811,7 +2815,7 @@ class OaiCiTest():
self.desc = 'Automatic Termination of eNB' self.desc = 'Automatic Termination of eNB'
HTML.desc='Automatic Termination of eNB' HTML.desc='Automatic Termination of eNB'
self.ShowTestID() self.ShowTestID()
RAN.eNB_instance='0' RAN.eNB_instance=0
RAN.TerminateeNB() RAN.TerminateeNB()
if RAN.flexranCtrlInstalled and RAN.flexranCtrlStarted: if RAN.flexranCtrlInstalled and RAN.flexranCtrlStarted:
self.testCase_id = 'AUTO-KILL-flexran-ctl' self.testCase_id = 'AUTO-KILL-flexran-ctl'
...@@ -3118,9 +3122,11 @@ def GetParametersFromXML(action): ...@@ -3118,9 +3122,11 @@ def GetParametersFromXML(action):
RAN.Build_eNB_forced_workspace_cleanup=True RAN.Build_eNB_forced_workspace_cleanup=True
else: else:
RAN.Build_eNB_forced_workspace_cleanup=False RAN.Build_eNB_forced_workspace_cleanup=False
RAN.eNB_instance=test.findtext('eNB_instance') eNB_instance=test.findtext('eNB_instance')
if (RAN.eNB_instance is None): if (eNB_instance is None):
RAN.eNB_instance='0' RAN.eNB_instance=0
else:
RAN.eNB_instance=int(eNB_instance)
RAN.eNB_serverId=test.findtext('eNB_serverId') RAN.eNB_serverId=test.findtext('eNB_serverId')
if (RAN.eNB_serverId is None): if (RAN.eNB_serverId is None):
RAN.eNB_serverId='0' RAN.eNB_serverId='0'
...@@ -3135,18 +3141,22 @@ def GetParametersFromXML(action): ...@@ -3135,18 +3141,22 @@ def GetParametersFromXML(action):
if action == 'WaitEndBuild_eNB': if action == 'WaitEndBuild_eNB':
RAN.Build_eNB_args=test.findtext('Build_eNB_args') RAN.Build_eNB_args=test.findtext('Build_eNB_args')
RAN.eNB_instance=test.findtext('eNB_instance') eNB_instance=test.findtext('eNB_instance')
if (RAN.eNB_instance is None): if (eNB_instance is None):
RAN.eNB_instance='0' RAN.eNB_instance='0'
else:
RAN.eNB_instance=int(eNB_instance)
RAN.eNB_serverId=test.findtext('eNB_serverId') RAN.eNB_serverId=test.findtext('eNB_serverId')
if (RAN.eNB_serverId is None): if (RAN.eNB_serverId is None):
RAN.eNB_serverId='0' RAN.eNB_serverId='0'
if action == 'Initialize_eNB': if action == 'Initialize_eNB':
RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args') RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args')
RAN.eNB_instance=test.findtext('eNB_instance') eNB_instance=test.findtext('eNB_instance')
if (RAN.eNB_instance is None): if (eNB_instance is None):
RAN.eNB_instance='0' RAN.eNB_instance=0
else:
RAN.eNB_instance=int(eNB_instance)
RAN.eNB_serverId=test.findtext('eNB_serverId') RAN.eNB_serverId=test.findtext('eNB_serverId')
if (RAN.eNB_serverId is None): if (RAN.eNB_serverId is None):
RAN.eNB_serverId='0' RAN.eNB_serverId='0'
...@@ -3154,17 +3164,18 @@ def GetParametersFromXML(action): ...@@ -3154,17 +3164,18 @@ def GetParametersFromXML(action):
#local variable air_interface #local variable air_interface
air_interface = test.findtext('air_interface') air_interface = test.findtext('air_interface')
if (air_interface is None) or (air_interface.lower() not in ['nr','lte','ocp']): if (air_interface is None) or (air_interface.lower() not in ['nr','lte','ocp']):
CiTestObj.air_interface = 'lte-softmodem' RAN.air_interface[RAN.eNB_instance] = 'lte-softmodem'
elif (air_interface.lower() in ['nr','lte']): elif (air_interface.lower() in ['nr','lte']):
CiTestObj.air_interface = air_interface.lower() +'-softmodem' RAN.air_interface[RAN.eNB_instance] = air_interface.lower() +'-softmodem'
else : else :
CiTestObj.air_interface = 'ocp-enb' RAN.air_interface[RAN.eNB_instance] = 'ocp-enb'
RAN.air_interface=CiTestObj.air_interface
if action == 'Terminate_eNB': if action == 'Terminate_eNB':
RAN.eNB_instance=test.findtext('eNB_instance') eNB_instance=test.findtext('eNB_instance')
if (RAN.eNB_instance is None): if (RAN.eNB_instance is None):
RAN.eNB_instance='0' RAN.eNB_instance=0
else:
RAN.eNB_instance=int(eNB_instance)
RAN.eNB_serverId=test.findtext('eNB_serverId') RAN.eNB_serverId=test.findtext('eNB_serverId')
if (RAN.eNB_serverId is None): if (RAN.eNB_serverId is None):
RAN.eNB_serverId='0' RAN.eNB_serverId='0'
...@@ -3172,12 +3183,11 @@ def GetParametersFromXML(action): ...@@ -3172,12 +3183,11 @@ def GetParametersFromXML(action):
#local variable air_interface #local variable air_interface
air_interface = test.findtext('air_interface') air_interface = test.findtext('air_interface')
if (air_interface is None) or (air_interface.lower() not in ['nr','lte','ocp']): if (air_interface is None) or (air_interface.lower() not in ['nr','lte','ocp']):
CiTestObj.air_interface = 'lte-softmodem' RAN.air_interface[RAN.eNB_instance] = 'lte-softmodem'
elif (air_interface.lower() in ['nr','lte']): elif (air_interface.lower() in ['nr','lte']):
CiTestObj.air_interface = air_interface.lower() +'-softmodem' RAN.air_interface[RAN.eNB_instance] = air_interface.lower() +'-softmodem'
else : else :
CiTestObj.air_interface = 'ocp-enb' RAN.air_interface[RAN.eNB_instance] = 'ocp-enb'
RAN.air_interface=CiTestObj.air_interface
if action == 'Attach_UE': if action == 'Attach_UE':
nbMaxUEtoAttach = test.findtext('nbMaxUEtoAttach') nbMaxUEtoAttach = test.findtext('nbMaxUEtoAttach')
...@@ -3210,17 +3220,27 @@ def GetParametersFromXML(action): ...@@ -3210,17 +3220,27 @@ def GetParametersFromXML(action):
#local variable air_interface #local variable air_interface
air_interface = test.findtext('air_interface') air_interface = test.findtext('air_interface')
if (air_interface is None) or (air_interface.lower() not in ['nr','lte','ocp']): if (air_interface is None) or (air_interface.lower() not in ['nr','lte','ocp']):
CiTestObj.air_interface = 'lte-softmodem' CiTestObj.air_interface = 'lte-uesoftmodem'
elif (air_interface.lower() in ['nr','lte']): elif (air_interface.lower() in ['nr','lte']):
CiTestObj.air_interface = air_interface.lower() +'-softmodem' CiTestObj.air_interface = air_interface.lower() +'-uesoftmodem'
else : else :
CiTestObj.air_interface = 'ocp-enb' #CiTestObj.air_interface = 'ocp-enb'
RAN.air_interface=CiTestObj.air_interface logging.error('OCP UE -- NOT SUPPORTED')
if action == 'Terminate_OAI_UE': if action == 'Terminate_OAI_UE':
RAN.eNB_instance=test.findtext('UE_instance') RAN.eNB_instance=test.findtext('UE_instance')
if (CiTestObj.UE_instance is None): if (CiTestObj.UE_instance is None):
CiTestObj.UE_instance = '0' CiTestObj.UE_instance = '0'
#local variable air_interface
air_interface = test.findtext('air_interface')
if (air_interface is None) or (air_interface.lower() not in ['nr','lte','ocp']):
CiTestObj.air_interface = 'lte-uesoftmodem'
elif (air_interface.lower() in ['nr','lte']):
CiTestObj.air_interface = air_interface.lower() +'-uesoftmodem'
else :
#CiTestObj.air_interface = 'ocp-enb'
logging.error('OCP UE -- NOT SUPPORTED')
if action == 'Ping' or action == 'Ping_CatM_module': if action == 'Ping' or action == 'Ping_CatM_module':
CiTestObj.ping_args = test.findtext('ping_args') CiTestObj.ping_args = test.findtext('ping_args')
......
...@@ -77,8 +77,8 @@ class RANManagement(): ...@@ -77,8 +77,8 @@ class RANManagement():
self.backgroundBuildTestId = ['', '', ''] self.backgroundBuildTestId = ['', '', '']
self.Build_eNB_forced_workspace_cleanup = False self.Build_eNB_forced_workspace_cleanup = False
self.Initialize_eNB_args = '' self.Initialize_eNB_args = ''
self.air_interface = '' #changed from 'lte' to '' may lead to side effects in main self.air_interface = ['', '', ''] #changed from 'lte' to '' may lead to side effects in main
self.eNB_instance = '' self.eNB_instance = 0
self.eNB_serverId = '' self.eNB_serverId = ''
self.eNBLogFiles = ['', '', ''] self.eNBLogFiles = ['', '', '']
self.eNBOptions = ['', '', ''] self.eNBOptions = ['', '', '']
...@@ -125,13 +125,13 @@ class RANManagement(): ...@@ -125,13 +125,13 @@ class RANManagement():
# Check if we build an 5G-NR gNB or an LTE eNB or an OCP eNB # Check if we build an 5G-NR gNB or an LTE eNB or an OCP eNB
result = re.search('--eNBocp', self.Build_eNB_args) result = re.search('--eNBocp', self.Build_eNB_args)
if result is not None: if result is not None:
self.air_interface='ocp-enb' self.air_interface[self.eNB_instance] = 'ocp-enb'
else: else:
result = re.search('--gNB', self.Build_eNB_args) result = re.search('--gNB', self.Build_eNB_args)
if result is not None: if result is not None:
self.air_interface = 'nr-softmodem' self.air_interface[self.eNB_instance] = 'nr-softmodem'
else: 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 # Worakround for some servers, we need to erase completely the workspace
if self.Build_eNB_forced_workspace_cleanup: if self.Build_eNB_forced_workspace_cleanup:
...@@ -205,7 +205,9 @@ class RANManagement(): ...@@ -205,7 +205,9 @@ class RANManagement():
if self.backgroundBuild: if self.backgroundBuild:
mySSH.command('echo "./build_oai ' + self.Build_eNB_args + '" > ./my-lte-softmodem-build.sh', '\$', 5) 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('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() mySSH.close()
if self.htmlObj is not None: if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK)
...@@ -261,7 +263,7 @@ class RANManagement(): ...@@ -261,7 +263,7 @@ class RANManagement():
#check if we have the build corresponding to the air interface keywords (nr-softmode, lte-softmodem, ocp-enb) #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) 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: if result is None:
buildStatus = False #if not, build failed buildStatus = False #if not, build failed
else: else:
...@@ -304,11 +306,11 @@ class RANManagement(): ...@@ -304,11 +306,11 @@ class RANManagement():
#generate logging info depending on buildStatus and air interface #generate logging info depending on buildStatus and air interface
if buildStatus: 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: if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK)
else: 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: if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'KO', CONST.ALL_PROCESSES_OK) self.htmlObj.CreateHtmlTestRow(self.Build_eNB_args, 'KO', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTabFooter(False) self.htmlObj.CreateHtmlTabFooter(False)
...@@ -426,7 +428,8 @@ class RANManagement(): ...@@ -426,7 +428,8 @@ class RANManagement():
if self.air_interface == 'nr': 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 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('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('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('echo ' + lPassWord + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5)
mySSH.command('hostnamectl','\$', 5) mySSH.command('hostnamectl','\$', 5)
...@@ -535,8 +538,8 @@ class RANManagement(): ...@@ -535,8 +538,8 @@ class RANManagement():
lPassWord = self.eNBPassword lPassWord = self.eNBPassword
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('stdbuf -o0 ps -aux | grep --color=never ' + self.air_interface + ' | grep -v grep', '\$', 5) 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, mySSH.getBefore()) result = re.search(self.air_interface[self.eNB_instance], mySSH.getBefore())
if result is None: if result is None:
logging.debug('\u001B[1;37;41m eNB Process Not Found! \u001B[0m') logging.debug('\u001B[1;37;41m eNB Process Not Found! \u001B[0m')
status_queue.put(CONST.ENB_PROCESS_FAILED) status_queue.put(CONST.ENB_PROCESS_FAILED)
...@@ -568,7 +571,7 @@ class RANManagement(): ...@@ -568,7 +571,7 @@ class RANManagement():
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5) 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' nodeB_prefix = 'e'
else: else:
nodeB_prefix = 'g' nodeB_prefix = 'g'
...@@ -831,11 +834,11 @@ class RANManagement(): ...@@ -831,11 +834,11 @@ class RANManagement():
mbmsRequestMsg += 1 mbmsRequestMsg += 1
enb_log_file.close() enb_log_file.close()
logging.debug(' File analysis completed') 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' nodeB_prefix = 'e'
else: else:
nodeB_prefix = 'g' nodeB_prefix = 'g'
if self.air_interface == 'nr-softmodem': if self.air_interface[self.eNB_instance] == 'nr-softmodem':
if ulschReceiveOK > 0: if ulschReceiveOK > 0:
statMsg = nodeB_prefix + 'NB showed ' + str(ulschReceiveOK) + ' "ULSCH received ok" message(s)' statMsg = nodeB_prefix + 'NB showed ' + str(ulschReceiveOK) + ' "ULSCH received ok" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
......
...@@ -33,27 +33,29 @@ ...@@ -33,27 +33,29 @@
<testCase id="000001"> <testCase id="000001">
<class>Build_eNB</class> <class>Build_eNB</class>
<desc>Build eNB</desc> <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_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId> <eNB_serverId>0</eNB_serverId>
<backgroundBuild>True</backgroundBuild>
</testCase> </testCase>
<testCase id="000002"> <testCase id="000004">
<class>WaitEndBuild_eNB</class> <class>WaitEndBuild_eNB</class>
<desc>Wait for end of Build eNB</desc> <desc>Wait for end of Build eNB</desc>
<eNB_instance>0</eNB_instance> <eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId> <eNB_serverId>0</eNB_serverId>
</testCase> </testCase>
<testCase id="000003"> <testCase id="000002">
<class>Build_eNB</class> <class>Build_eNB</class>
<desc>Build gNB</desc> <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_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId> <eNB_serverId>1</eNB_serverId>
<backgroundBuild>True</backgroundBuild>
</testCase> </testCase>
<testCase id="000004"> <testCase id="000003">
<class>WaitEndBuild_eNB</class> <class>WaitEndBuild_eNB</class>
<desc>Wait for end of Build gNB</desc> <desc>Wait for end of Build gNB</desc>
<eNB_instance>1</eNB_instance> <eNB_instance>1</eNB_instance>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<mode>TesteNB</mode> <mode>TesteNB</mode>
<class>Build_eNB</class> <class>Build_eNB</class>
<desc>Build gNB (USRP)</desc> <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> <forced_workspace_cleanup>True</forced_workspace_cleanup>
</testCase> </testCase>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<mode>TestUE</mode> <mode>TestUE</mode>
<class>Build_OAI_UE</class> <class>Build_OAI_UE</class>
<desc>Build NR UE (USRP)</desc> <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> <clean_repository>false</clean_repository>
</testCase> </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