Commit 613d6032 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: few fixes and improvements

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 571d0947
...@@ -50,8 +50,7 @@ class CotsUe: ...@@ -50,8 +50,7 @@ class CotsUe:
def Check_Airplane(self): def Check_Airplane(self):
mySSH = sshconnection.SSHConnection() mySSH = sshconnection.SSHConnection()
mySSH.open(self.UEIPAddr, self.UEUserName, self.UEPassWord) mySSH.open(self.UEIPAddr, self.UEUserName, self.UEPassWord)
mySSH.command('cd /home/oaici/remi/android-sdk-linux/platform-tools', '\$', 5) status=mySSH.cde_check_value('sudo adb shell settings get global airplane_mode_on ', ['0','1'],5)
status=mySSH.cde_check_value('sudo ./adb shell settings get global airplane_mode_on ', ['0','1'],5)
mySSH.close() mySSH.close()
return status return status
...@@ -59,8 +58,7 @@ class CotsUe: ...@@ -59,8 +58,7 @@ class CotsUe:
def Set_Airplane(self,target_state_str): def Set_Airplane(self,target_state_str):
mySSH = sshconnection.SSHConnection() mySSH = sshconnection.SSHConnection()
mySSH.open(self.UEIPAddr, self.UEUserName, self.UEPassWord) mySSH.open(self.UEIPAddr, self.UEUserName, self.UEPassWord)
mySSH.command('cd /home/oaici/remi/android-sdk-linux/platform-tools', '\$', 5) mySSH.command('sudo adb start-server','$',5)
mySSH.command('sudo ./adb start-server','$',5)
logging.info("Toggling COTS UE Airplane mode to : "+target_state_str) logging.info("Toggling COTS UE Airplane mode to : "+target_state_str)
current_state = self.Check_Airplane() current_state = self.Check_Airplane()
if target_state_str.lower()=="on": if target_state_str.lower()=="on":
...@@ -71,9 +69,9 @@ class CotsUe: ...@@ -71,9 +69,9 @@ class CotsUe:
#toggle state #toggle state
retry = 0 retry = 0
while (current_state!=target_state) and (retry < self.__SetAirplaneRetry): 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 am start -a android.settings.AIRPLANE_MODE_SETTINGS', '\$', 5)
mySSH.command('sudo ./adb shell input keyevent 20', '\$', 5) mySSH.command('sudo adb shell input keyevent 20', '\$', 5)
mySSH.command('sudo ./adb shell input tap 968 324', '\$', 5) mySSH.command('sudo adb shell input tap 968 324', '\$', 5)
time.sleep(1) time.sleep(1)
current_state = self.Check_Airplane() current_state = self.Check_Airplane()
retry+=1 retry+=1
...@@ -82,7 +80,7 @@ class CotsUe: ...@@ -82,7 +80,7 @@ class CotsUe:
logging.error("Current state is : "+ str(current_state)) logging.error("Current state is : "+ str(current_state))
else: else:
print("Airplane mode is already "+ target_state_str) print("Airplane mode is already "+ target_state_str)
mySSH.command('sudo ./adb kill-server','$',5) mySSH.command('sudo adb kill-server','$',5)
mySSH.close() mySSH.close()
......
...@@ -330,7 +330,7 @@ class OaiCiTest(): ...@@ -330,7 +330,7 @@ class OaiCiTest():
check_OAI_UE = False check_OAI_UE = False
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE) pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE)
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.air_interface + ' ' + self.Initialize_OAI_UE_args, 'KO', pStatus)
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) sys.exit(1)
UE_prefix = '' UE_prefix = ''
...@@ -522,7 +522,7 @@ class OaiCiTest(): ...@@ -522,7 +522,7 @@ class OaiCiTest():
SSH.close() SSH.close()
if fullSyncStatus and gotSyncStatus and tunnelInterfaceStatus: if fullSyncStatus and gotSyncStatus and tunnelInterfaceStatus:
HTML.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'OK', CONST.ALL_PROCESSES_OK, 'OAI UE') HTML.CreateHtmlTestRow(self.air_interface + ' ' + self.Initialize_OAI_UE_args, 'OK', CONST.ALL_PROCESSES_OK, 'OAI UE')
logging.debug('\u001B[1m Initialize OAI UE Completed\u001B[0m') logging.debug('\u001B[1m Initialize OAI UE Completed\u001B[0m')
if (self.ADBIPAddress != 'none'): if (self.ADBIPAddress != 'none'):
self.UEDevices = [] self.UEDevices = []
...@@ -535,10 +535,10 @@ class OaiCiTest(): ...@@ -535,10 +535,10 @@ class OaiCiTest():
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:
HTML.htmlUEFailureMsg='oaitun_ue1 interface is either NOT mounted or NOT configured' HTML.htmlUEFailureMsg='oaitun_ue1 interface is either NOT mounted or NOT configured'
HTML.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'KO', CONST.OAI_UE_PROCESS_NO_TUNNEL_INTERFACE, 'OAI UE') HTML.CreateHtmlTestRow(self.air_interface + ' ' + self.Initialize_OAI_UE_args, 'KO', CONST.OAI_UE_PROCESS_NO_TUNNEL_INTERFACE, 'OAI UE')
else: else:
HTML.htmlUEFailureMsg='nr-uesoftmodem did NOT synced' HTML.htmlUEFailureMsg='nr-uesoftmodem did NOT synced'
HTML.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'KO', CONST.OAI_UE_PROCESS_COULD_NOT_SYNC, 'OAI UE') HTML.CreateHtmlTestRow(self.air_interface + ' ' + self.Initialize_OAI_UE_args, 'KO', CONST.OAI_UE_PROCESS_COULD_NOT_SYNC, 'OAI UE')
logging.error('\033[91mInitialize OAI UE Failed! \033[0m') logging.error('\033[91mInitialize OAI UE Failed! \033[0m')
self.AutoTerminateUEandeNB() self.AutoTerminateUEandeNB()
...@@ -1085,11 +1085,7 @@ class OaiCiTest(): ...@@ -1085,11 +1085,7 @@ 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:
if self.ADBIPAddress == '192.168.18.196': SSH.command('adb devices', '\$', 15)
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())
SSH.close() SSH.close()
else: else:
...@@ -2584,7 +2580,7 @@ class OaiCiTest(): ...@@ -2584,7 +2580,7 @@ class OaiCiTest():
freq = result.group('carrier_frequency') freq = result.group('carrier_frequency')
new_freq = re.sub('/[0-9]+','',freq) new_freq = re.sub('/[0-9]+','',freq)
float_freq = float(new_freq) / 1000000 float_freq = float(new_freq) / 1000000
HTML.SethtmlUEFailureMsg(HTML.GethtmlUEFailureMsg() + 'DL Freq: ' + ('%.1f' % float_freq) + ' MHz') HTML.htmlUEFailureMsg=HTML.htmlUEFailureMsg + 'DL Freq: ' + ('%.1f' % float_freq) + ' MHz'
logging.debug('\033[94m' + " DL Carrier Frequency is: " + str(freq) + '\033[0m') logging.debug('\033[94m' + " DL Carrier Frequency is: " + str(freq) + '\033[0m')
except Exception as e: except Exception as e:
logging.error('\033[91m' + " DL Carrier Frequency not found" + '\033[0m') logging.error('\033[91m' + " DL Carrier Frequency not found" + '\033[0m')
......
...@@ -343,7 +343,7 @@ class RANManagement(): ...@@ -343,7 +343,7 @@ class RANManagement():
if (self.pStatus < 0): if (self.pStatus < 0):
if self.htmlObj is not None: if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow(self.Initialize_eNB_args, 'KO', self.pStatus) self.htmlObj.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' ' + self.Initialize_eNB_args, 'KO', self.pStatus)
self.htmlObj.CreateHtmlTabFooter(False) self.htmlObj.CreateHtmlTabFooter(False)
sys.exit(1) sys.exit(1)
# If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB # If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB
...@@ -450,9 +450,9 @@ class RANManagement(): ...@@ -450,9 +450,9 @@ class RANManagement():
mySSH.command('killall --signal SIGKILL record', '\$', 5) mySSH.command('killall --signal SIGKILL record', '\$', 5)
mySSH.close() mySSH.close()
doLoop = False doLoop = False
logging.error('\u001B[1;37;41m eNB logging system did not show got sync! \u001B[0m') logging.error('\u001B[1;37;41m eNB/gNB/ocp-eNB logging system did not show got sync! \u001B[0m')
if self.htmlObj is not None: if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow('-O ' + config_file + extra_options, 'KO', CONST.ALL_PROCESSES_OK) self.htmlObj.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' -O ' + config_file + extra_options, 'KO', CONST.ALL_PROCESSES_OK)
# In case of T tracer recording, we need to kill tshark on EPC side # In case of T tracer recording, we need to kill tshark on EPC side
result = re.search('T_stdout', str(self.Initialize_eNB_args)) result = re.search('T_stdout', str(self.Initialize_eNB_args))
if (result is not None) and (self.epcObj is not None): if (result is not None) and (self.epcObj is not None):
...@@ -510,8 +510,8 @@ class RANManagement(): ...@@ -510,8 +510,8 @@ class RANManagement():
mySSH.close() mySSH.close()
if self.htmlObj is not None: if self.htmlObj is not None:
self.htmlObj.CreateHtmlTestRow('-O ' + config_file + extra_options, 'OK', CONST.ALL_PROCESSES_OK) self.htmlObj.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' -O ' + config_file + extra_options, 'OK', CONST.ALL_PROCESSES_OK)
logging.debug('\u001B[1m Initialize eNB Completed\u001B[0m') logging.debug('\u001B[1m Initialize eNB/gNB/ocp-eNB Completed\u001B[0m')
def CheckeNBProcess(self, status_queue): def CheckeNBProcess(self, status_queue):
try: try:
......
...@@ -34,14 +34,14 @@ ...@@ -34,14 +34,14 @@
<testCase id="030101"> <testCase id="030101">
<class>Initialize_eNB</class> <class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band7/5MHz)</desc> <desc>Initialize OCP-eNB (FDD/Band7/5MHz)</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args> <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args>
<air_interface>ocp</air_interface> <air_interface>ocp</air_interface>
</testCase> </testCase>
<testCase id="030201"> <testCase id="030201">
<class>Terminate_eNB</class> <class>Terminate_eNB</class>
<desc>Terminate eNB</desc> <desc>Terminate OCP-eNB</desc>
<air_interface>ocp</air_interface> <air_interface>ocp</air_interface>
</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