diff --git a/ci-scripts/args_parse.py b/ci-scripts/args_parse.py index 1249f521728c1e846f7dfb8871185d966292aa40..84b3a84514bf18afa15cdf04fdc38f4c0c1abbbc 100644 --- a/ci-scripts/args_parse.py +++ b/ci-scripts/args_parse.py @@ -34,7 +34,7 @@ import sys # arg import re # reg import yaml - +import constants as CONST #----------------------------------------------------------- # Parsing Command Line Arguements diff --git a/ci-scripts/cls_cots_ue.py b/ci-scripts/cls_cots_ue.py index 6954aa392742f1ca77ee64d46e97b468a2614cff..59c2713b4749a67c526ffd8cb3fab81fed1219bc 100644 --- a/ci-scripts/cls_cots_ue.py +++ b/ci-scripts/cls_cots_ue.py @@ -27,61 +27,111 @@ # pexpect #--------------------------------------------------------------------- +#to use isfile +import os +import sys #to use logging.info() import logging #to create a SSH object locally in the methods import sshconnection #time.sleep import time +#to load cots_ue dictionary +import yaml class CotsUe: - def __init__(self,model,UEIPAddr,UEUserName,UEPassWord): - self.model = model - self.UEIPAddr = UEIPAddr - self.UEUserName = UEUserName - self.UEPassWord = UEPassWord - self.runargs = '' #on of off to toggle airplane mode on/off + def __init__(self,ADBIPAddr,ADBUserName,ADBPassWord): + self.cots_id = '' #cots id from yaml oppo, s10 etc... + self.ADBIPAddr = ADBIPAddr + self.ADBUserName = ADBUserName + self.ADBPassWord = ADBPassWord + self.cots_run_mode = '' #on of off to toggle airplane mode on/off + self.__cots_cde_dict_file = 'cots_ue_ctl.yaml' self.__SetAirplaneRetry = 3 + #-----------------$ #PUBLIC Methods$ #-----------------$ def Check_Airplane(self): mySSH = sshconnection.SSHConnection() - mySSH.open(self.UEIPAddr, self.UEUserName, self.UEPassWord) - status=mySSH.cde_check_value('sudo adb shell settings get global airplane_mode_on ', ['0','1'],5) + mySSH.open(self.ADBIPAddr, self.ADBUserName, self.ADBPassWord) + status=mySSH.cde_check_value('adb shell settings get global airplane_mode_on ', ['0','1'],5) mySSH.close() return status + #simply check if the device id exists in the dictionary + #returns true if it exists, false otherwise + def Check_Exists(self,target_id): + #load cots commands dictionary + if (os.path.isfile(self.__cots_cde_dict_file)): + yaml_file=self.__cots_cde_dict_file + elif (os.path.isfile('ci-scripts/'+self.__cots_cde_dict_file)): + yaml_file='ci-scripts/'+self.__cots_cde_dict_file + else: + logging.error("COTS UE dictionary yaml file cannot be found") + sys.exit("COTS UE dictionary yaml file cannot be found") + + #load cots commands dictionary + with open(yaml_file,'r') as file: + cots_ue_ctl = yaml.load(file,Loader=yaml.FullLoader) + #check if ue id is in the dictionary + if target_id in cots_ue_ctl: + return True + else: + return False + + def Set_Airplane(self, target_id, target_state_str): + #loading cots commands dictionary - def Set_Airplane(self,target_state_str): - mySSH = sshconnection.SSHConnection() - mySSH.open(self.UEIPAddr, self.UEUserName, self.UEPassWord) - mySSH.command('sudo adb start-server','$',5) - logging.info("Toggling COTS UE Airplane mode to : "+target_state_str) - current_state = self.Check_Airplane() - if target_state_str.lower()=="on": - target_state=1 + if (os.path.isfile(self.__cots_cde_dict_file)): + yaml_file=self.__cots_cde_dict_file + elif (os.path.isfile('ci-scripts/'+self.__cots_cde_dict_file)): + yaml_file='ci-scripts/'+self.__cots_cde_dict_file else: - target_state=0 - if current_state != target_state: - #toggle state - retry = 0 - while (current_state!=target_state) and (retry < self.__SetAirplaneRetry): - mySSH.command('sudo adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS', '\$', 5) - mySSH.command('sudo adb shell input keyevent 20', '\$', 5) - mySSH.command('sudo adb shell input tap 968 324', '\$', 5) - time.sleep(1) - current_state = self.Check_Airplane() - retry+=1 + logging.error("COTS UE dictionary yaml file cannot be found") + sys.exit("COTS UE dictionary yaml file cannot be found") + + #load cots commands dictionary + with open(yaml_file,'r') as file: + cots_ue_ctl = yaml.load(file,Loader=yaml.FullLoader) + #check if ue id is in the dictionary + if target_id in cots_ue_ctl: + mySSH = sshconnection.SSHConnection() + mySSH.open(self.ADBIPAddr, self.ADBUserName, self.ADBPassWord) + logging.info(str(self.ADBIPAddr)+' '+str(self.ADBUserName)+' '+str(self.ADBPassWord)) + mySSH.command('adb start-server','\$',5) + mySSH.command('adb devices','\$',5) + logging.info("Toggling COTS UE Airplane mode to : "+target_state_str) + #get current state + current_state = self.Check_Airplane() + if target_state_str.lower()=="on": + target_state=1 + else: + target_state=0 if current_state != target_state: - logging.error("ATTENTION : Could not toggle to : "+target_state_str) - logging.error("Current state is : "+ str(current_state)) + #toggle state + retry = 0 + while (current_state!=target_state) and (retry < self.__SetAirplaneRetry): + #loop over the command list from dictionary for the selected ue, to switch to required state + for i in range (0,len(cots_ue_ctl[target_id])): + mySSH.command(cots_ue_ctl[target_id][i], '\$', 5) + time.sleep(1) + current_state = self.Check_Airplane() + retry+=1 + #could not toggle despite the retry + if current_state != target_state: + logging.error("ATTENTION : Could not toggle to : "+target_state_str) + logging.error("Current state is : "+ str(current_state)) + else: + logging.info("Airplane mode is already "+ target_state_str) + mySSH.command('adb kill-server','\$',5) + mySSH.close() + #ue id is NOT in the dictionary else: - print("Airplane mode is already "+ target_state_str) - mySSH.command('sudo adb kill-server','$',5) - mySSH.close() + logging.error("COTS UE Id from XML could not be found in UE YAML dictionary " + self.__cots_cde_dict_file) + sys.exit("COTS UE Id from XML could not be found in UE YAML dictionary " + self.__cots_cde_dict_file) diff --git a/ci-scripts/cots_ue_ctl.yaml b/ci-scripts/cots_ue_ctl.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c22fca246bf83118f1a84aa61bb7a0843116a7c0 --- /dev/null +++ b/ci-scripts/cots_ue_ctl.yaml @@ -0,0 +1,20 @@ +9d690a12: #oppo + - adb shell input keyevent KEYCODE_POWER + - adb shell input swipe 300 700 300 0 + - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS + - adb shell input keyevent 20 + - adb shell input tap 968 324 +002: #s10 + - adb shell input keyevent KEYCODE_POWER + - adb shell input swipe 200 900 200 300 + - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS + - adb shell input tap 968 324 +003: #s20 + - adb shell input keyevent KEYCODE_POWER + - adb shell input swipe 200 900 200 300 + - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS + - adb shell input tap 968 324 +004: #xperia + - tbd + - tbd + - tbd diff --git a/ci-scripts/main.py b/ci-scripts/main.py index d37f205f4e6a11cb72ebacb3455613b52b21d2f9..86fd9d84df1f23371ca88eb9d3978e80a1e391d4 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -285,21 +285,29 @@ class OaiCiTest(): SSH.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' ' + self.UEDevicesOffCmd[idx], '\$', 60) SSH.close() return - # enable data service - SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "svc data enable"', '\$', 60) - - # The following commands are deprecated since we no longer work on Android 7+ - # SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell settings put global airplane_mode_on 1', '\$', 10) - # SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true', '\$', 60) - # a dedicated script has to be installed inside the UE - # airplane mode on means call /data/local/tmp/off - if device_id == '84B7N16418004022': - SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "su - root -c /data/local/tmp/off"', '\$', 60) + + #RH quick add-on to integrate cots control defined by yaml + #if device_id exists in yaml dictionary, we execute the new procedure defined in cots_ue class + #otherwise we use the legacy procedure + if COTS_UE.Check_Exists(device_id): + #switch device to Airplane mode ON (ie Radio OFF) + COTS_UE.Set_Airplane(device_id, 'ON') else: - SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/off', '\$', 60) - #airplane mode off means call /data/local/tmp/on - logging.debug('\u001B[1mUE (' + device_id + ') Initialize Completed\u001B[0m') - SSH.close() + # enable data service + SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "svc data enable"', '\$', 60) + + # The following commands are deprecated since we no longer work on Android 7+ + # SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell settings put global airplane_mode_on 1', '\$', 10) + # SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true', '\$', 60) + # a dedicated script has to be installed inside the UE + # airplane mode on means call /data/local/tmp/off + if device_id == '84B7N16418004022': + SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "su - root -c /data/local/tmp/off"', '\$', 60) + else: + SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/off', '\$', 60) + #airplane mode off means call /data/local/tmp/on + logging.debug('\u001B[1mUE (' + device_id + ') Initialize Completed\u001B[0m') + SSH.close() except: os.kill(os.getppid(),signal.SIGUSR1) @@ -790,7 +798,13 @@ class OaiCiTest(): try: SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) if self.ADBCentralized: - if device_id == '84B7N16418004022': + #RH quick add on to integrate cots control defined by yaml + #if device Id exists in yaml dictionary, we execute the new procedure defined in cots_ue class + #otherwise we use the legacy procedure + if COTS_UE.Check_Exists(device_id): + #switch device to Airplane mode OFF (ie Radio ON) + COTS_UE.Set_Airplane(device_id, 'OFF') + elif device_id == '84B7N16418004022': SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "su - root -c /data/local/tmp/on"', '\$', 60) else: SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/on', '\$', 60) @@ -827,7 +841,13 @@ class OaiCiTest(): if count == 15 or count == 30: logging.debug('\u001B[1;30;43m Retry UE (' + device_id + ') Flight Mode Off \u001B[0m') if self.ADBCentralized: - if device_id == '84B7N16418004022': + #RH quick add on to intgrate cots control defined by yaml + #if device id exists in yaml dictionary, we execute the new procedure defined in cots_ue class + #otherwise we use the legacy procedure + if COTS_UE.Check_Exists(device_id): + #switch device to Airplane mode ON (ie Radio OFF) + COTS_UE.Set_Airplane(device_id, 'ON') + elif device_id == '84B7N16418004022': SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "su - root -c /data/local/tmp/off"', '\$', 60) else: SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/off', '\$', 60) @@ -835,7 +855,13 @@ class OaiCiTest(): SSH.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' ' + self.UEDevicesOffCmd[idx], '\$', 60) time.sleep(0.5) if self.ADBCentralized: - if device_id == '84B7N16418004022': + #RH quick add on to integrate cots control defined by yaml + #if device id exists in yaml dictionary, we execute the new procedre defined incots_ue class + #otherwise we use the legacy procedure + if COTS_UE.Check_Exists(device_id): + #switch device to Airplane mode OFF (ie Radio ON) + COTS_UE.Set_Airplane(device_id, 'OFF') + elif device_id == '84B7N16418004022': SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "su - root -c /data/local/tmp/on"', '\$', 60) else: SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/on', '\$', 60) @@ -918,7 +944,13 @@ class OaiCiTest(): try: SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) if self.ADBCentralized: - if device_id == '84B7N16418004022': + #RH quick add on to integrate cots control defined by yaml + #if device id exists in yaml dictionary, we execute the new procedure defined in cots_ue class + #otherwise we use the legacy procedure + if COTS_UE.Check_Exists(device_id): + #switch device to Airplane mode ON (ie Radio OFF) + COTS_UE.Set_Airplane(device_id,'ON') + elif device_id == '84B7N16418004022': SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "su - root -c /data/local/tmp/off"', '\$', 60) else: SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/off', '\$', 60) @@ -2697,7 +2729,13 @@ class OaiCiTest(): SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) # back in airplane mode on (ie radio off) if self.ADBCentralized: - if device_id == '84B7N16418004022': + #RH quick add on to intgrate cots control defined by yaml + #if device Id exists in yaml dictionary, we execute the new procedure defined in cots_ue class + #otherwise we use the legacy procedure + if COTS_UE.Check_Exists(device_id): + #switch device to Airplane mode ON (ie Radio OFF) + COTS_UE.Set_Airplane(device_id, 'ON') + elif device_id == '84B7N16418004022': SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell "su - root -c /data/local/tmp/off"', '\$', 60) else: SSH.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/off', '\$', 60) @@ -3133,7 +3171,7 @@ def GetParametersFromXML(action): else: RAN.backgroundBuild=False - if action == 'WaitEndBuild_eNB': + elif action == 'WaitEndBuild_eNB': RAN.Build_eNB_args=test.findtext('Build_eNB_args') eNB_instance=test.findtext('eNB_instance') if (eNB_instance is None): @@ -3144,7 +3182,7 @@ def GetParametersFromXML(action): if (RAN.eNB_serverId is None): RAN.eNB_serverId='0' - if action == 'Initialize_eNB': + elif action == 'Initialize_eNB': RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args') eNB_instance=test.findtext('eNB_instance') if (eNB_instance is None): @@ -3164,7 +3202,7 @@ def GetParametersFromXML(action): else : RAN.air_interface[RAN.eNB_instance] = 'ocp-enb' - if action == 'Terminate_eNB': + elif action == 'Terminate_eNB': eNB_instance=test.findtext('eNB_instance') if (eNB_instance is None): RAN.eNB_instance=0 @@ -3183,21 +3221,21 @@ def GetParametersFromXML(action): else : RAN.air_interface[RAN.eNB_instance] = 'ocp-enb' - if action == 'Attach_UE': + elif action == 'Attach_UE': nbMaxUEtoAttach = test.findtext('nbMaxUEtoAttach') if (nbMaxUEtoAttach is None): CiTestObj.nbMaxUEtoAttach = -1 else: CiTestObj.nbMaxUEtoAttach = int(nbMaxUEtoAttach) - if action == 'CheckStatusUE': + elif action == 'CheckStatusUE': expectedNBUE = test.findtext('expectedNbOfConnectedUEs') if (expectedNBUE is None): CiTestObj.expectedNbOfConnectedUEs = -1 else: CiTestObj.expectedNbOfConnectedUEs = int(expectedNBUE) - if action == 'Build_OAI_UE': + elif action == 'Build_OAI_UE': CiTestObj.Build_OAI_UE_args = test.findtext('Build_OAI_UE_args') CiTestObj.clean_repository = test.findtext('clean_repository') if (CiTestObj.clean_repository == 'false'): @@ -3205,7 +3243,7 @@ def GetParametersFromXML(action): else: CiTestObj.clean_repository = True - if action == 'Initialize_OAI_UE': + elif action == 'Initialize_OAI_UE': CiTestObj.Initialize_OAI_UE_args = test.findtext('Initialize_OAI_UE_args') UE_instance = test.findtext('UE_instance') if (UE_instance is None): @@ -3223,7 +3261,7 @@ def GetParametersFromXML(action): #CiTestObj.air_interface = 'ocp-enb' logging.error('OCP UE -- NOT SUPPORTED') - if action == 'Terminate_OAI_UE': + elif action == 'Terminate_OAI_UE': UE_instance=test.findtext('UE_instance') if (UE_instance is None): CiTestObj.UE_instance = '0' @@ -3240,11 +3278,11 @@ def GetParametersFromXML(action): #CiTestObj.air_interface = 'ocp-enb' logging.error('OCP UE -- NOT SUPPORTED') - if action == 'Ping' or action == 'Ping_CatM_module': + elif (action == 'Ping') or (action == 'Ping_CatM_module'): CiTestObj.ping_args = test.findtext('ping_args') CiTestObj.ping_packetloss_threshold = test.findtext('ping_packetloss_threshold') - if action == 'Iperf': + elif action == 'Iperf': CiTestObj.iperf_args = test.findtext('iperf_args') CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold') CiTestObj.iperf_profile = test.findtext('iperf_profile') @@ -3262,14 +3300,14 @@ def GetParametersFromXML(action): logging.debug('ERROR: test-case has wrong option ' + CiTestObj.iperf_options) CiTestObj.iperf_options = 'check' - if action == 'IdleSleep': + elif action == 'IdleSleep': string_field = test.findtext('idle_sleep_time_in_sec') if (string_field is None): CiTestObj.idle_sleep_time = 5 else: CiTestObj.idle_sleep_time = int(string_field) - if action == 'Perform_X2_Handover': + elif action == 'Perform_X2_Handover': string_field = test.findtext('x2_ho_options') if (string_field is None): CiTestObj.x2_ho_options = 'network' @@ -3280,7 +3318,7 @@ def GetParametersFromXML(action): else: CiTestObj.x2_ho_options = string_field - if action == 'Build_PhySim': + elif action == 'Build_PhySim': ldpc.buildargs = test.findtext('physim_build_args') forced_workspace_cleanup = test.findtext('forced_workspace_cleanup') if (forced_workspace_cleanup is None): @@ -3291,11 +3329,9 @@ def GetParametersFromXML(action): else: ldpc.forced_workspace_cleanup=False - if action == 'Run_PhySim': + else: # ie action == 'Run_PhySim': ldpc.runargs = test.findtext('physim_run_args') - if action == 'COTS_UE_Airplane': - COTS_UE.runargs = test.findtext('cots_ue_airplane_args') #check if given test is in list #it is in list if one of the strings in 'list' is at the beginning of 'test' @@ -3320,15 +3356,21 @@ def receive_signal(signum, frame): #loading xml action list from yaml import yaml -xml_class_list_file='' -if (os.path.isfile('xml_class_list.yml')): - xml_class_list_file='xml_class_list.yml' -if (os.path.isfile('ci-scripts/xml_class_list.yml')): - xml_class_list_file='ci-scripts/xml_class_list.yml' -with open(xml_class_list_file,'r') as file: - # The FullLoader parameter handles the conversion from YAML - # scalar values to Python the dictionary format - xml_class_list = yaml.load(file,Loader=yaml.FullLoader) +xml_class_list_file='xml_class_list.yml' +if (os.path.isfile(xml_class_list_file)): + yaml_file=xml_class_list_file +elif (os.path.isfile('ci-scripts/'+xml_class_list_file)): + yaml_file='ci-scripts/'+xml_class_list_file +else: + logging.error("XML action list yaml file cannot be found") + sys.exit("XML action list yaml file cannot be found") + +with open(yaml_file,'r') as f: + # The FullLoader parameter handles the conversion-$ + #from YAML scalar values to Python dictionary format$ + xml_class_list = yaml.load(f,Loader=yaml.FullLoader) + + mode = '' @@ -3375,8 +3417,9 @@ if py_param_file_present == True: #----------------------------------------------------------- # COTS UE instanciation #----------------------------------------------------------- -#COTS_UE instanciation can only be done here for the moment, due to code architecture -COTS_UE=cls_cots_ue.CotsUe('oppo', CiTestObj.UEIPAddress, CiTestObj.UEUserName,CiTestObj.UEPassword) +#COTS_UE instanciation and ADB server init +#ue id and ue mode are retrieved from xml +COTS_UE=cls_cots_ue.CotsUe(CiTestObj.ADBIPAddress, CiTestObj.ADBUserName,CiTestObj.ADBPassword) #----------------------------------------------------------- @@ -3613,7 +3656,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re GetParametersFromXML(action) if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE' or action == 'DataDisable_UE' or action == 'DataEnable_UE' or action == 'CheckStatusUE': if (CiTestObj.ADBIPAddress != 'none'): - terminate_ue_flag = False + #in these cases, having no devices is critical, GetAllUEDevices function has to manage it as a critical error, reason why terminate_ue_flag is set to True + terminate_ue_flag = True CiTestObj.GetAllUEDevices(terminate_ue_flag) if action == 'Build_eNB': RAN.BuildeNB() @@ -3688,8 +3732,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if ldpc.exitStatus==1:sys.exit() elif action == 'Run_PhySim': HTML=ldpc.Run_PhySim(HTML,CONST,id) - elif action == 'COTS_UE_Airplane': - COTS_UE.Set_Airplane(COTS_UE.runargs) else: sys.exit('Invalid class (action) from xml') CiTestObj.FailReportCnt += 1 diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 96f28e21fe3f58e19d56510c3fcac22645a2df05..d5906e9567ab7f29969f5df0b54c3fc262fb53fb 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -90,6 +90,7 @@ class RANManagement(): self.epcPcapFile = '' self.htmlObj = None self.epcObj = None + self.runtime_stats= '' @@ -614,7 +615,7 @@ class RANManagement(): logging.debug('\u001B[1m Analyzing eNB replay logfile \u001B[0m') logStatus = self.AnalyzeLogFile_eNB(extracted_log_file) if self.htmlObj is not None: - self.htmlObj.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + self.htmlObj.CreateHtmlTestRow(self.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) self.eNBLogFiles[int(self.eNB_instance)] = '' else: analyzeFile = False @@ -643,10 +644,10 @@ class RANManagement(): return else: if self.htmlObj is not None: - self.htmlObj.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + self.htmlObj.CreateHtmlTestRow(self.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) else: if self.htmlObj is not None: - self.htmlObj.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + self.htmlObj.CreateHtmlTestRow(self.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) self.eNBmbmsEnables[int(self.eNB_instance)] = False self.eNBstatuses[int(self.eNB_instance)] = -1 @@ -712,16 +713,20 @@ class RANManagement(): if runTime != '': result = re.search('Time executing user inst', str(line)) if result is not None: - userTime = 'to be decoded - 1' + fields=line.split(':') + userTime = 'userTime : ' + fields[1].replace('\n','') result = re.search('Time executing system inst', str(line)) if result is not None: - systemTime = 'to be decoded - 2' + fields=line.split(':') + systemTime = 'systemTime : ' + fields[1].replace('\n','') result = re.search('Max. Phy. memory usage:', str(line)) if result is not None: - maxPhyMemUsage = 'to be decoded - 3' + fields=line.split(':') + maxPhyMemUsage = 'maxPhyMemUsage : ' + fields[1].replace('\n','') result = re.search('Number of context switch.*process origin', str(line)) if result is not None: - nbContextSwitches = 'to be decoded - 4' + fields=line.split(':') + nbContextSwitches = 'nbContextSwitches : ' + fields[1].replace('\n','') if X2HO_state == CONST.X2_HO_REQ_STATE__IDLE: result = re.search('target eNB Receives X2 HO Req X2AP_HANDOVER_REQ', str(line)) if result is not None: @@ -978,11 +983,12 @@ class RANManagement(): global_status = CONST.ENB_PROCESS_REALTIME_ISSUE if self.htmlObj is not None: self.htmlObj.htmleNBFailureMsg=htmleNBFailureMsg - # Runtime statistics + # Runtime statistics for console output and HTML if runTime != '': logging.debug(runTime) - logging.debug('Time executing user inst : ' + userTime) - logging.debug('Time executing system inst : ' + systemTime) - logging.debug('Max Physical Memory Usage : ' + maxPhyMemUsage) - logging.debug('Nb Context Switches : ' + nbContextSwitches) + logging.debug(userTime) + logging.debug(systemTime) + logging.debug(maxPhyMemUsage) + logging.debug(nbContextSwitches) + self.runtime_stats='<pre>'+runTime + '\n'+ userTime + '\n' + systemTime + '\n' + maxPhyMemUsage + '\n' + nbContextSwitches+'</pre>' return global_status diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index e80063a120ad9e163a7ef549f296da0f677241fc..2c20988851e7e6565f99d553b27455be53f62e85 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -1,4 +1,3 @@ - - COTS_UE_Airplane - Build_PhySim - Run_PhySim - Build_eNB diff --git a/ci-scripts/xml_files/fr1_toggle_cots_ue.xml b/ci-scripts/xml_files/fr1_epc_closure.xml similarity index 72% rename from ci-scripts/xml_files/fr1_toggle_cots_ue.xml rename to ci-scripts/xml_files/fr1_epc_closure.xml index b2267efc77dcc514bcf07eda0c2223be3ed5b46a..2fd80319364b8cf12e5ae10d18ed8da8fce80fa3 100644 --- a/ci-scripts/xml_files/fr1_toggle_cots_ue.xml +++ b/ci-scripts/xml_files/fr1_epc_closure.xml @@ -21,19 +21,27 @@ --> <testCaseList> - <htmlTabRef>test-airplane-mode</htmlTabRef> - <htmlTabName>AirplaneToggle</htmlTabName> - <htmlTabIcon>tasks</htmlTabIcon> + <htmlTabRef>epc-closure</htmlTabRef> + <htmlTabName>EPC-Closure</htmlTabName> + <htmlTabIcon>log-out</htmlTabIcon> <TestCaseRequestedList> - 010000 +060000 060001 060002 </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> - <testCase id="010000"> - <class>COTS_UE_Airplane</class> - <desc>Toggle COTS Airplane mode ON</desc> - <cots_ue_airplane_args>ON</cots_ue_airplane_args> + <testCase id="060000"> + <class>Terminate_HSS</class> + <desc>Terminate HSS</desc> </testCase> + <testCase id="060001"> + <class>Terminate_MME</class> + <desc>Terminate MME</desc> + </testCase> + + <testCase id="060002"> + <class>Terminate_SPGW</class> + <desc>Terminate SPGW</desc> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/fr1_multi_node_terminate.xml b/ci-scripts/xml_files/fr1_epc_start.xml similarity index 70% rename from ci-scripts/xml_files/fr1_multi_node_terminate.xml rename to ci-scripts/xml_files/fr1_epc_start.xml index cbaaf8ba9975a8e464424e0ff258e64a5b3aabac..5cef2b5a6a0d5b5d855ad8e9948ce5d98b499865 100644 --- a/ci-scripts/xml_files/fr1_multi_node_terminate.xml +++ b/ci-scripts/xml_files/fr1_epc_start.xml @@ -21,30 +21,28 @@ --> <testCaseList> - <htmlTabRef>test-fr1-tm1</htmlTabRef> - <htmlTabName>Test-FR1-TM1</htmlTabName> - <htmlTabIcon>tasks</htmlTabIcon> - <repeatCount>1</repeatCount> + <htmlTabRef>epc-start-tab</htmlTabRef> + <htmlTabName>EPC-Start</htmlTabName> + <htmlTabIcon>log-in</htmlTabIcon> <TestCaseRequestedList> - 070001 - 070000 + 000100 000101 000102 </TestCaseRequestedList> <TestCaseExclusionList> </TestCaseExclusionList> - <testCase id="070000"> - <class>Terminate_eNB</class> - <desc>Terminate eNB</desc> - <eNB_instance>0</eNB_instance> - <eNB_serverId>0</eNB_serverId> + <testCase id="000100"> + <class>Initialize_HSS</class> + <desc>Initialize HSS</desc> </testCase> - <testCase id="070001"> - <class>Terminate_eNB</class> - <desc>Terminate gNB</desc> - <eNB_instance>1</eNB_instance> - <eNB_serverId>1</eNB_serverId> + <testCase id="000101"> + <class>Initialize_MME</class> + <desc>Initialize MME</desc> </testCase> -</testCaseList> + <testCase id="000102"> + <class>Initialize_SPGW</class> + <desc>Initialize SPGW</desc> + </testCase> +</testCaseList> diff --git a/ci-scripts/xml_files/fr1_ran_ue_proc.xml b/ci-scripts/xml_files/fr1_ran_ue_proc.xml new file mode 100644 index 0000000000000000000000000000000000000000..e86a36d2db4386f637b3158a45ecb70df39c4792 --- /dev/null +++ b/ci-scripts/xml_files/fr1_ran_ue_proc.xml @@ -0,0 +1,117 @@ +<!-- + + Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The OpenAirInterface Software Alliance licenses this file to You under + the OAI Public License, Version 1.1 (the "License"); you may not use this file + except in compliance with the License. + You may obtain a copy of the License at + + http://www.openairinterface.org/?page_id=698 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + For more information about the OpenAirInterface (OAI) Software Alliance: + contact@openairinterface.org + +--> +<testCaseList> + <htmlTabRef>TEST-FR1-TM1</htmlTabRef> + <htmlTabName>FR1</htmlTabName> + <htmlTabIcon>tasks</htmlTabIcon> + <TestCaseRequestedList> + 010000 + 030000 + 040000 + 010001 + 000001 + 050000 + 050001 + 070001 + 070000 + 010002 + 010003 + </TestCaseRequestedList> + <TestCaseExclusionList></TestCaseExclusionList> + + <testCase id="010000"> + <class>Initialize_UE</class> + <desc>Initialize UE</desc> + </testCase> + + <testCase id="010003"> + <class>Terminate_UE</class> + <desc>Terminate UE</desc> + </testCase> + + <testCase id="010001"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="010002"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + + <testCase id="030000"> + <class>Initialize_eNB</class> + <desc>Initialize eNB</desc> + <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf</Initialize_eNB_args> + <eNB_instance>0</eNB_instance> + <eNB_serverId>0</eNB_serverId> + <air_interface>lte</air_interface> + </testCase> + + + <testCase id="040000"> + <class>Initialize_eNB</class> + <desc>Initialize gNB</desc> + <Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E</Initialize_eNB_args> + <eNB_instance>1</eNB_instance> + <eNB_serverId>1</eNB_serverId> + <air_interface>nr</air_interface> + </testCase> + + <testCase id="000001"> + <class>IdleSleep</class> + <desc>Sleep</desc> + <idle_sleep_time_in_sec>20</idle_sleep_time_in_sec> + </testCase> + + <testCase id="050000"> + <class>Ping</class> + <desc>Ping: 20pings in 20sec</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>0</ping_packetloss_threshold> + </testCase> + + <testCase id="050001"> + <class>Ping</class> + <desc>Ping: 5pings in 1sec</desc> + <ping_args>-c 5 -i 0.2</ping_args> + <ping_packetloss_threshold>0</ping_packetloss_threshold> + </testCase> + + <testCase id="070000"> + <class>Terminate_eNB</class> + <desc>Terminate eNB</desc> + <eNB_instance>0</eNB_instance> + <eNB_serverId>0</eNB_serverId> + </testCase> + + <testCase id="070001"> + <class>Terminate_eNB</class> + <desc>Terminate gNB</desc> + <eNB_instance>1</eNB_instance> + <eNB_serverId>1</eNB_serverId> + </testCase> + +</testCaseList> + diff --git a/doc/BUILD.md b/doc/BUILD.md index a15083dc323bf57b0f74bfd27133a54d47ffb83e..ba5db55cab38822d97d0a41710c6ca2a0e2cab17 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -16,6 +16,7 @@ This page is valid on tags starting from **`2019.w09`**. # Soft Modem Build Script +The OAI EPC is developed in a distinct project with it's own [documentation](https://github.com/OPENAIRINTERFACE/openair-epc-fed/wiki) , it is not described here. OAI softmodem sources, which aim to implement 3GPP compliant UEs, eNodeB and gNodeB can be downloaded from the Eurecom [gitlab repository](./GET_SOURCES.md). diff --git a/doc/GET_SOURCES.md b/doc/GET_SOURCES.md index e27e9dbb74bca76987335081fd9acea8f7a01145..854ff3b504c2aca273dfb7490408eb9cd7f8b31c 100644 --- a/doc/GET_SOURCES.md +++ b/doc/GET_SOURCES.md @@ -33,12 +33,8 @@ holds the source code for (eNB RAN + UE RAN). For legal issues (licenses), the core network (EPC) source code is now moved away from the above openairinterface5g git repository. -* A very old version of the EPC is located under the same GitLab Eurecom server (splitted into 2 Git repos): - * [openair-cn](https://gitlab.eurecom.fr/oai/openair-cn.git) with apache license - * [xtables-addons-oai](https://gitlab.eurecom.fr/oai/xtables-addons-oai.git) with GPL license - * **These repositories are no more maintained.** * A more recent version is available under our GitHub domain: - * [OAI GitHub openair-cn](https://github.com/OPENAIRINTERFACE/openair-cn) + * [OAI GitHub openair-cn domain](https://github.com/OPENAIRINTERFACE) * Check its wiki pages for more details Configure git with your name/email address (only important if you are developer and want to contribute/push code to Git Repository): @@ -80,8 +76,6 @@ you do not have account on gitlab.eurecom.fr, please register yourself to gitlab * `git clone git@gitlab.eurecom.fr:oai/openairinterface5g.git` * Clone with user name/password prompt: * `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/openairinterface5g.git` - * `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/openair-cn.git` - * `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/xtables-addons-oai.git` (optional, openair-cn build script can do it for you) # Which branch to checkout? diff --git a/doc/TESTBenches.md b/doc/TESTBenches.md new file mode 100644 index 0000000000000000000000000000000000000000..7365bc0f4c7df220fdf4a026b4cb8abecb89946f --- /dev/null +++ b/doc/TESTBenches.md @@ -0,0 +1,45 @@ +## Table of Contents ## + +1. [Legacy 1 Bench](#legacy-1-bench) +2. [Legacy 2 Bench](#legacy-2-bench) +3. [Next Bench for DEV](#next-bench-for-dev) +4. [Next Bench for CI](#next-bench-for-ci) +5. [Indoor Live Network Bench](#indoor-live-network-bench) +6. [Outdoor Live Network Bench](#outdoor-live-network-bench) + + +## Legacy 1 Bench + +**Purpose** : FDD Band 7 and Band 13, LTE-M +**Note** : Legacy1 and Legacy2 are duplicated so that they can run in parallel, thus avoiding a CI bottleneck +**Note** : Faraday Cages 1 and 2 are physically the same cage + + + +## Legacy 2 Bench + +**Purpose** : TDD Band 40, TM2 2xTX 2xRX +**Note** : CN can run in a container, could also run on Massive + + + +## Next Bench for DEV + +**Note** : Benetel CI can also run on this bench at night + + + + +## Next Bench for CI + +**Note** : The current test running on Caracal could run on this bench with a N300/N300 setup + + + +## Indoor Live Network Bench + + + +## Outdoor Live Network Bench + + diff --git a/doc/TESTING_GNB_W_COTS_UE.md b/doc/TESTING_GNB_W_COTS_UE.md index b1afb0c798bde7d9235117a30e8839f74d3eee53..198f6bb115c1265969f5fb2f7e797fbe2ede3d1b 100644 --- a/doc/TESTING_GNB_W_COTS_UE.md +++ b/doc/TESTING_GNB_W_COTS_UE.md @@ -220,17 +220,16 @@ Execute: - **gNB** (on the gNB host) +**ATTENTION** : for the gNB execution, +The **-E** option is required to enable the tri-quarter sampling rate when using a B2xx serie USRP +The **-E** option is **NOT supported** when using a a N300 USRP + Execute: ``` ~/openairinterface5g/cmake_targets/ran_build/build$ sudo ./nr-softmodem -O **YOUR_GNB_CONF_FILE** -E | tee **YOUR_LOG_FILE** ``` -**ATTENTION** : for the gNB execution, -The -E option is required to enable the tri-quarter sampling rate when using a B2xx serie USRP -The -E opton is not needed when using a a N300 USRP - - ## Test Case diff --git a/doc/testbenches_doc_resources/benches.vsdx b/doc/testbenches_doc_resources/benches.vsdx new file mode 100755 index 0000000000000000000000000000000000000000..6ad3a5b57654b5824405a55d7814002bba1c5865 Binary files /dev/null and b/doc/testbenches_doc_resources/benches.vsdx differ diff --git a/doc/testbenches_doc_resources/indoor_live.jpg b/doc/testbenches_doc_resources/indoor_live.jpg new file mode 100755 index 0000000000000000000000000000000000000000..ce8b9cda4817796abf6fb87da43befe6090469be Binary files /dev/null and b/doc/testbenches_doc_resources/indoor_live.jpg differ diff --git a/doc/testbenches_doc_resources/legacy1.jpg b/doc/testbenches_doc_resources/legacy1.jpg new file mode 100755 index 0000000000000000000000000000000000000000..c3579df3e4a56521eff8f23df1dbca9ba9fd3a59 Binary files /dev/null and b/doc/testbenches_doc_resources/legacy1.jpg differ diff --git a/doc/testbenches_doc_resources/legacy2.jpg b/doc/testbenches_doc_resources/legacy2.jpg new file mode 100755 index 0000000000000000000000000000000000000000..f40d167a2db2626f4be2a47fb82528cc9df5abae Binary files /dev/null and b/doc/testbenches_doc_resources/legacy2.jpg differ diff --git a/doc/testbenches_doc_resources/next_ci.jpg b/doc/testbenches_doc_resources/next_ci.jpg new file mode 100755 index 0000000000000000000000000000000000000000..2d4111510c061b5d18ed1ae3097e3c6cc0040437 Binary files /dev/null and b/doc/testbenches_doc_resources/next_ci.jpg differ diff --git a/doc/testbenches_doc_resources/next_dev.jpg b/doc/testbenches_doc_resources/next_dev.jpg new file mode 100755 index 0000000000000000000000000000000000000000..72e9f63bf91cdb7fd47a44780126b7269bf0475f Binary files /dev/null and b/doc/testbenches_doc_resources/next_dev.jpg differ diff --git a/doc/testbenches_doc_resources/outdoor_live.jpg b/doc/testbenches_doc_resources/outdoor_live.jpg new file mode 100755 index 0000000000000000000000000000000000000000..eba44a3c00e7456c7d2d0cc12ea1e77db31ae10a Binary files /dev/null and b/doc/testbenches_doc_resources/outdoor_live.jpg differ diff --git a/docker/Dockerfile.enb.rhel7.oc4-4 b/docker/Dockerfile.enb.rhel7.oc4-4 new file mode 100644 index 0000000000000000000000000000000000000000..12d9a196400e06a0d0dffc5b9f5562f863765e39 --- /dev/null +++ b/docker/Dockerfile.enb.rhel7.oc4-4 @@ -0,0 +1,92 @@ +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ +#--------------------------------------------------------------------- +# +# Dockerfile for the Open-Air-Interface eNB service +# Valid for RHEL7 in the OpenShift context (v4.4) +# +#--------------------------------------------------------------------- + + +ARG REGISTRY=localhost +FROM $REGISTRY/oai-build-base:latest.el7 AS builder + +ARG GIT_TAG=v1.1.1 + +WORKDIR /root + +RUN if [ "$EURECOM_PROXY" == true ]; then git config --global http.proxy http://:@proxy.eurecom.fr:8080; fi + +RUN git clone --depth=1 --branch=$GIT_TAG https://gitlab.eurecom.fr/oai/openairinterface5g.git +COPY patches patches/ +RUN patch -p1 -d openairinterface5g < patches/disable_building_nasmesh_and_rbtool.patch \ + && patch -p1 -d openairinterface5g < patches/disable_sched_fifo_fail_exits.patch +RUN cd openairinterface5g/cmake_targets \ + && ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \ + && ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \ + && ./build_oai -c --eNB -w USRP --verbose-compile + + +FROM registry.redhat.io/ubi7/ubi +LABEL name="oai-enb" \ + version="$GIT_TAG" \ + maintainer="Frank A. Zdarsky <fzdarsky@redhat.com>" \ + io.k8s.description="openairinterface5g eNB $GIT_TAG." \ + io.openshift.tags="oai,enb" \ + io.openshift.non-scalable="true" + +RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ + && REPOLIST="rhel-7-server-optional-rpms" \ + && PKGLIST="boost libconfig lksctp-tools protobuf-c iproute iputils procps-ng bind-utils xforms nettle libyaml libusb" \ + # && yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important && \ + && yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} \ + && yum -y clean all \ + && rm -rf /var/cache/yum + +ENV APP_ROOT=/opt/oai-enb +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} +COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/lte-softmodem ${APP_ROOT}/bin/ +COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/*.so* /lib64 +COPY --from=builder /usr/local/lib64 /lib64 +COPY --from=builder /usr/local/bin/uhd_* /usr/local/bin +COPY --from=builder /usr/local/share/uhd /usr/local/share/uhd +RUN cd /lib64 \ + && ln -sf liboai_eth_transpro.so liboai_transpro.so \ + && ln -sf liboai_usrpdevif.so liboai_device.so \ + && ln -sf libuhd.so.3.13 libuhd.so.3 \ + && ln -sf libuhd.so.3 libuhd.so +COPY scripts ${APP_ROOT}/bin/ +COPY configs ${APP_ROOT}/etc/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +USER 10001 +WORKDIR ${APP_ROOT} + +EXPOSE 2152/udp # S1U, GTP/UDP +EXPOSE 22100/tcp # ? +EXPOSE 36412/udp # S1C, SCTP/UDP +EXPOSE 36422/udp # X2C, SCTP/UDP +EXPOSE 50000/udp # IF5 / ORI (control) +EXPOSE 50001/udp # IF5 / ECPRI (data) + +CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"] +ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]