Commit adb29da8 authored by Raphael Defosseux's avatar Raphael Defosseux

[CI] python code clean

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent bfeae0a0
...@@ -42,10 +42,8 @@ from multiprocessing import Process, Lock, SimpleQueue ...@@ -42,10 +42,8 @@ from multiprocessing import Process, Lock, SimpleQueue
# OAI Testing modules # OAI Testing modules
#----------------------------------------------------------- #-----------------------------------------------------------
import sshconnection as SSH import sshconnection as SSH
import epc
import helpreadme as HELP import helpreadme as HELP
import constants as CONST import constants as CONST
import html
#----------------------------------------------------------- #-----------------------------------------------------------
# Class Declaration # Class Declaration
...@@ -82,15 +80,12 @@ class Containerize(): ...@@ -82,15 +80,12 @@ class Containerize():
self.flexranCtrlDeployed = False self.flexranCtrlDeployed = False
self.flexranCtrlIpAddress = '' self.flexranCtrlIpAddress = ''
self.htmlObj = None
self.epcObj = None
self.ranObj = None
#----------------------------------------------------------- #-----------------------------------------------------------
# Container management functions # Container management functions
#----------------------------------------------------------- #-----------------------------------------------------------
def BuildImage(self): def BuildImage(self, HTML):
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
...@@ -137,10 +132,7 @@ class Containerize(): ...@@ -137,10 +132,7 @@ class Containerize():
# Workaround for some servers, we need to erase completely the workspace # Workaround for some servers, we need to erase completely the workspace
if self.forcedWorkspaceCleanup: if self.forcedWorkspaceCleanup:
mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf ' + lSourcePath, '\$', 15) mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf ' + lSourcePath, '\$', 15)
if self.htmlObj is not None: self.testCase_id = HTML.testCase_id
self.testCase_id = self.htmlObj.testCase_id
else:
self.testCase_id = '000000'
# on RedHat/CentOS .git extension is mandatory # on RedHat/CentOS .git extension is mandatory
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:
...@@ -239,9 +231,8 @@ class Containerize(): ...@@ -239,9 +231,8 @@ class Containerize():
if not status: if not status:
mySSH.close() mySSH.close()
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m') logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
if self.htmlObj is not None: HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTabFooter(False)
self.htmlObj.CreateHtmlTabFooter(False)
sys.exit(1) sys.exit(1)
# Recover build logs, for the moment only possible when build is successful # Recover build logs, for the moment only possible when build is successful
...@@ -261,10 +252,9 @@ class Containerize(): ...@@ -261,10 +252,9 @@ class Containerize():
mySSH.close() mySSH.close()
logging.info('\u001B[1m Building OAI Image(s) Pass\u001B[0m') logging.info('\u001B[1m Building OAI Image(s) Pass\u001B[0m')
if self.htmlObj is not None: HTML.CreateHtmlTestRow(self.imageKind, 'OK', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow(self.imageKind, 'OK', CONST.ALL_PROCESSES_OK)
def DeployObject(self): def DeployObject(self, HTML, EPC):
if self.eNB_serverId[self.eNB_instance] == '0': if self.eNB_serverId[self.eNB_instance] == '0':
lIpAddr = self.eNBIPAddress lIpAddr = self.eNBIPAddress
lUserName = self.eNBUserName lUserName = self.eNBUserName
...@@ -299,8 +289,7 @@ class Containerize(): ...@@ -299,8 +289,7 @@ class Containerize():
if (self.ranAllowMerge): if (self.ranAllowMerge):
imageTag = 'ci-temp' imageTag = 'ci-temp'
mySSH.command('sed -i -e "s/image: oai-enb:latest/image: oai-enb:' + imageTag + '/" ci-docker-compose.yml', '\$', 2) mySSH.command('sed -i -e "s/image: oai-enb:latest/image: oai-enb:' + imageTag + '/" ci-docker-compose.yml', '\$', 2)
if self.epcObj is not None: localMmeIpAddr = EPC.MmeIPAddress
localMmeIpAddr = self.epcObj.MmeIPAddress
mySSH.command('sed -i -e "s/CI_MME_IP_ADDR/' + localMmeIpAddr + '/" ci-docker-compose.yml', '\$', 2) mySSH.command('sed -i -e "s/CI_MME_IP_ADDR/' + localMmeIpAddr + '/" ci-docker-compose.yml', '\$', 2)
if self.flexranCtrlDeployed: if self.flexranCtrlDeployed:
mySSH.command('sed -i -e \'s/FLEXRAN_ENABLED:.*/FLEXRAN_ENABLED: "yes"/\' ci-docker-compose.yml', '\$', 2) mySSH.command('sed -i -e \'s/FLEXRAN_ENABLED:.*/FLEXRAN_ENABLED: "yes"/\' ci-docker-compose.yml', '\$', 2)
...@@ -356,19 +345,15 @@ class Containerize(): ...@@ -356,19 +345,15 @@ class Containerize():
time.sleep(10) time.sleep(10)
mySSH.close() mySSH.close()
if self.htmlObj is not None: self.testCase_id = HTML.testCase_id
self.testCase_id = self.htmlObj.testCase_id
else:
self.testCase_id = '000000'
self.eNB_logFile[self.eNB_instance] = 'enb_' + self.testCase_id + '.log' self.eNB_logFile[self.eNB_instance] = 'enb_' + self.testCase_id + '.log'
if self.htmlObj is not None:
if status: if status:
self.htmlObj.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
else: else:
self.htmlObj.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK)
def UndeployObject(self): def UndeployObject(self, HTML, RAN):
logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m')
if self.eNB_serverId[self.eNB_instance] == '0': if self.eNB_serverId[self.eNB_instance] == '0':
lIpAddr = self.eNBIPAddress lIpAddr = self.eNBIPAddress
...@@ -410,20 +395,16 @@ class Containerize(): ...@@ -410,20 +395,16 @@ class Containerize():
mySSH.close() mySSH.close()
# Analyzing log file! # Analyzing log file!
if self.ranObj is not None:
copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '.') copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '.')
nodeB_prefix = 'e' nodeB_prefix = 'e'
if (copyin_res == -1): if (copyin_res == -1):
if self.htmlObj is not None: HTML.htmleNBFailureMsg='Could not copy ' + nodeB_prefix + 'NB logfile to analyze it!'
self.htmlObj.htmleNBFailureMsg='Could not copy ' + nodeB_prefix + 'NB logfile to analyze it!' HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
self.htmlObj.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
else: else:
logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance]) logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance])
logStatus = self.ranObj.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance]) logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML)
if (logStatus < 0): if (logStatus < 0):
if self.htmlObj is not None: HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus)
self.htmlObj.CreateHtmlTestRow(self.ranObj.runtime_stats, 'KO', logStatus)
else: else:
if self.htmlObj is not None: HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow(self.ranObj.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
...@@ -558,7 +558,7 @@ class OaiCiTest(): ...@@ -558,7 +558,7 @@ class OaiCiTest():
HTML.htmlUEFailureMsg='nr-uesoftmodem did NOT synced' HTML.htmlUEFailureMsg='nr-uesoftmodem did NOT synced'
HTML.CreateHtmlTestRow(self.air_interface + ' ' + 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(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
def checkDevTTYisUnlocked(self): def checkDevTTYisUnlocked(self):
SSH = sshconnection.SSHConnection() SSH = sshconnection.SSHConnection()
...@@ -636,7 +636,7 @@ class OaiCiTest(): ...@@ -636,7 +636,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
self.checkDevTTYisUnlocked() self.checkDevTTYisUnlocked()
def AttachCatM(self,HTML,RAN,COTS_UE): def AttachCatM(self,HTML,RAN,COTS_UE,EPC):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
...@@ -709,9 +709,9 @@ class OaiCiTest(): ...@@ -709,9 +709,9 @@ class OaiCiTest():
html_cell = '<pre style="background-color:white">CAT-M module Attachment Failed</pre>' html_cell = '<pre style="background-color:white">CAT-M module Attachment Failed</pre>'
html_queue.put(html_cell) html_queue.put(html_cell)
HTML.CreateHtmlTestRowQueue('N/A', 'KO', 1, html_queue) HTML.CreateHtmlTestRowQueue('N/A', 'KO', 1, html_queue)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
def PingCatM(self,HTML,RAN,EPC,COTS_UE): def PingCatM(self,HTML,RAN,EPC,COTS_UE,EPC):
if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
...@@ -720,7 +720,7 @@ class OaiCiTest(): ...@@ -720,7 +720,7 @@ class OaiCiTest():
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
try: try:
statusQueue = SimpleQueue() statusQueue = SimpleQueue()
...@@ -741,7 +741,7 @@ class OaiCiTest(): ...@@ -741,7 +741,7 @@ class OaiCiTest():
moduleIPAddr = result.group('ipaddr') moduleIPAddr = result.group('ipaddr')
else: else:
HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
ping_time = re.findall("-c (\d+)",str(self.ping_args)) ping_time = re.findall("-c (\d+)",str(self.ping_args))
device_id = 'catm' device_id = 'catm'
...@@ -805,7 +805,7 @@ class OaiCiTest(): ...@@ -805,7 +805,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', 1, statusQueue) HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', 1, statusQueue)
else: else:
HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', 1, statusQueue) HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', 1, statusQueue)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
except: except:
os.kill(os.getppid(),signal.SIGUSR1) os.kill(os.getppid(),signal.SIGUSR1)
...@@ -906,7 +906,7 @@ class OaiCiTest(): ...@@ -906,7 +906,7 @@ class OaiCiTest():
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow('N/A', 'KO', pStatus) HTML.CreateHtmlTestRow('N/A', 'KO', pStatus)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
multi_jobs = [] multi_jobs = []
status_queue = SimpleQueue() status_queue = SimpleQueue()
...@@ -925,7 +925,7 @@ class OaiCiTest(): ...@@ -925,7 +925,7 @@ class OaiCiTest():
if (status_queue.empty()): if (status_queue.empty()):
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ALL_PROCESSES_OK)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
else: else:
attach_status = True attach_status = True
...@@ -954,7 +954,7 @@ class OaiCiTest(): ...@@ -954,7 +954,7 @@ class OaiCiTest():
time.sleep(5) time.sleep(5)
else: else:
HTML.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
def DetachUE_common(self, device_id, idx,COTS_UE): def DetachUE_common(self, device_id, idx,COTS_UE):
try: try:
...@@ -987,7 +987,7 @@ class OaiCiTest(): ...@@ -987,7 +987,7 @@ class OaiCiTest():
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow('N/A', 'KO', pStatus) HTML.CreateHtmlTestRow('N/A', 'KO', pStatus)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
multi_jobs = [] multi_jobs = []
cnt = 0 cnt = 0
...@@ -1302,7 +1302,7 @@ class OaiCiTest(): ...@@ -1302,7 +1302,7 @@ class OaiCiTest():
if (status_queue.empty()): if (status_queue.empty()):
HTML.CreateHtmlTestRow(htmlOptions, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(htmlOptions, 'KO', CONST.ALL_PROCESSES_OK)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
else: else:
check_status = True check_status = True
html_queue = SimpleQueue() html_queue = SimpleQueue()
...@@ -1318,7 +1318,7 @@ class OaiCiTest(): ...@@ -1318,7 +1318,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue(htmlOptions, 'OK', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue(htmlOptions, 'OK', len(self.UEDevices), html_queue)
else: else:
HTML.CreateHtmlTestRowQueue(htmlOptions, 'KO', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue(htmlOptions, 'KO', len(self.UEDevices), html_queue)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
def GetAllUEIPAddresses(self): def GetAllUEIPAddresses(self):
SSH = sshconnection.SSHConnection() SSH = sshconnection.SSHConnection()
...@@ -1496,7 +1496,7 @@ class OaiCiTest(): ...@@ -1496,7 +1496,7 @@ class OaiCiTest():
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
ping_from_eNB = re.search('oaitun_enb1', str(self.ping_args)) ping_from_eNB = re.search('oaitun_enb1', str(self.ping_args))
if ping_from_eNB is not None: if ping_from_eNB is not None:
...@@ -1598,12 +1598,12 @@ class OaiCiTest(): ...@@ -1598,12 +1598,12 @@ class OaiCiTest():
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
ueIpStatus = self.GetAllUEIPAddresses() ueIpStatus = self.GetAllUEIPAddresses()
if (ueIpStatus < 0): if (ueIpStatus < 0):
HTML.CreateHtmlTestRow(self.ping_args, 'KO', CONST.UE_IP_ADDRESS_ISSUE) HTML.CreateHtmlTestRow(self.ping_args, 'KO', CONST.UE_IP_ADDRESS_ISSUE)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
multi_jobs = [] multi_jobs = []
i = 0 i = 0
...@@ -1621,7 +1621,7 @@ class OaiCiTest(): ...@@ -1621,7 +1621,7 @@ class OaiCiTest():
if (status_queue.empty()): if (status_queue.empty()):
HTML.CreateHtmlTestRow(self.ping_args, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.ping_args, 'KO', CONST.ALL_PROCESSES_OK)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
else: else:
ping_status = True ping_status = True
html_queue = SimpleQueue() html_queue = SimpleQueue()
...@@ -1638,7 +1638,7 @@ class OaiCiTest(): ...@@ -1638,7 +1638,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue(self.ping_args, 'OK', len(self.UEDevices), html_queue)
else: else:
HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', len(self.UEDevices), html_queue)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
def Iperf_ComputeTime(self): def Iperf_ComputeTime(self):
result = re.search('-t (?P<iperf_time>\d+)', str(self.iperf_args)) result = re.search('-t (?P<iperf_time>\d+)', str(self.iperf_args))
...@@ -2279,7 +2279,7 @@ class OaiCiTest(): ...@@ -2279,7 +2279,7 @@ class OaiCiTest():
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow(self.iperf_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.iperf_args, 'KO', pStatus)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
server_on_enb = re.search('-R', str(self.iperf_args)) server_on_enb = re.search('-R', str(self.iperf_args))
if server_on_enb is not None: if server_on_enb is not None:
...@@ -2377,7 +2377,7 @@ class OaiCiTest(): ...@@ -2377,7 +2377,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue(self.iperf_args, 'OK', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue(self.iperf_args, 'OK', len(self.UEDevices), html_queue)
else: else:
HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', len(self.UEDevices), html_queue)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
def Iperf(self,HTML,RAN,EPC,COTS_UE): def Iperf(self,HTML,RAN,EPC,COTS_UE):
result = re.search('noS1', str(RAN.Initialize_eNB_args)) result = re.search('noS1', str(RAN.Initialize_eNB_args))
...@@ -2395,13 +2395,13 @@ class OaiCiTest(): ...@@ -2395,13 +2395,13 @@ class OaiCiTest():
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow(self.iperf_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.iperf_args, 'KO', pStatus)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
ueIpStatus = self.GetAllUEIPAddresses() ueIpStatus = self.GetAllUEIPAddresses()
if (ueIpStatus < 0): if (ueIpStatus < 0):
logging.debug('going here') logging.debug('going here')
HTML.CreateHtmlTestRow(self.iperf_args, 'KO', CONST.UE_IP_ADDRESS_ISSUE) HTML.CreateHtmlTestRow(self.iperf_args, 'KO', CONST.UE_IP_ADDRESS_ISSUE)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
return return
self.dummyIperfVersion = '2.0.10' self.dummyIperfVersion = '2.0.10'
...@@ -2432,7 +2432,7 @@ class OaiCiTest(): ...@@ -2432,7 +2432,7 @@ class OaiCiTest():
if (status_queue.empty()): if (status_queue.empty()):
HTML.CreateHtmlTestRow(self.iperf_args, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.iperf_args, 'KO', CONST.ALL_PROCESSES_OK)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
else: else:
iperf_status = True iperf_status = True
iperf_noperf = False iperf_noperf = False
...@@ -2454,7 +2454,7 @@ class OaiCiTest(): ...@@ -2454,7 +2454,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRowQueue(self.iperf_args, 'OK', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue(self.iperf_args, 'OK', len(self.UEDevices), html_queue)
else: else:
HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', len(self.UEDevices), html_queue) HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', len(self.UEDevices), html_queue)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
def CheckProcessExist(self, check_eNB, check_OAI_UE,RAN,EPC): def CheckProcessExist(self, check_eNB, check_OAI_UE,RAN,EPC):
multi_jobs = [] multi_jobs = []
...@@ -2915,11 +2915,11 @@ class OaiCiTest(): ...@@ -2915,11 +2915,11 @@ class OaiCiTest():
# 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'):
self.Initialize_OAI_UE_args = '' self.Initialize_OAI_UE_args = ''
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
else: else:
if (logStatus == CONST.OAI_UE_PROCESS_COULD_NOT_SYNC): if (logStatus == CONST.OAI_UE_PROCESS_COULD_NOT_SYNC):
self.Initialize_OAI_UE_args = '' self.Initialize_OAI_UE_args = ''
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC)
else: else:
logging.debug('\u001B[1m' + ueAction + ' Completed \u001B[0m') logging.debug('\u001B[1m' + ueAction + ' Completed \u001B[0m')
HTML.htmlUEFailureMsg='<b>' + ueAction + ' Completed</b>\n' + HTML.htmlUEFailureMsg HTML.htmlUEFailureMsg='<b>' + ueAction + ' Completed</b>\n' + HTML.htmlUEFailureMsg
...@@ -2928,7 +2928,7 @@ class OaiCiTest(): ...@@ -2928,7 +2928,7 @@ class OaiCiTest():
else: else:
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
def AutoTerminateUEandeNB(self,HTML,RAN,COTS_UE): def AutoTerminateUEandeNB(self,HTML,RAN,COTS_UE,EPC):
if (self.ADBIPAddress != 'none'): if (self.ADBIPAddress != 'none'):
self.testCase_id = 'AUTO-KILL-UE' self.testCase_id = 'AUTO-KILL-UE'
HTML.testCase_id=self.testCase_id HTML.testCase_id=self.testCase_id
...@@ -2954,7 +2954,7 @@ class OaiCiTest(): ...@@ -2954,7 +2954,7 @@ class OaiCiTest():
if RAN.air_interface[instance]!='': if RAN.air_interface[instance]!='':
logging.debug('Auto Termination of Instance ' + str(instance) + ' : ' + RAN.air_interface[instance]) logging.debug('Auto Termination of Instance ' + str(instance) + ' : ' + RAN.air_interface[instance])
RAN.eNB_instance=instance RAN.eNB_instance=instance
RAN.TerminateeNB() RAN.TerminateeNB(HTML,EPC)
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'
HTML.testCase_id=self.testCase_id HTML.testCase_id=self.testCase_id
......
...@@ -46,7 +46,6 @@ from multiprocessing import Process, Lock, SimpleQueue ...@@ -46,7 +46,6 @@ from multiprocessing import Process, Lock, SimpleQueue
import sshconnection as SSH import sshconnection as SSH
import helpreadme as HELP import helpreadme as HELP
import constants as CONST import constants as CONST
import html
#----------------------------------------------------------- #-----------------------------------------------------------
# Class Declaration # Class Declaration
...@@ -61,7 +60,6 @@ class EPCManagement(): ...@@ -61,7 +60,6 @@ class EPCManagement():
self.SourceCodePath = '' self.SourceCodePath = ''
self.Type = '' self.Type = ''
self.PcapFileName = '' self.PcapFileName = ''
self.htmlObj = None
self.testCase_id = '' self.testCase_id = ''
self.MmeIPAddress = '' self.MmeIPAddress = ''
self.containerPrefix = 'prod' self.containerPrefix = 'prod'
...@@ -73,7 +71,7 @@ class EPCManagement(): ...@@ -73,7 +71,7 @@ class EPCManagement():
# EPC management functions # EPC management functions
#----------------------------------------------------------- #-----------------------------------------------------------
def InitializeHSS(self): def InitializeHSS(self, HTML):
if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type)
...@@ -115,10 +113,9 @@ class EPCManagement(): ...@@ -115,10 +113,9 @@ class EPCManagement():
else: else:
logging.error('This option should not occur!') logging.error('This option should not occur!')
mySSH.close() mySSH.close()
if self.htmlObj is not None: HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
def InitializeMME(self): def InitializeMME(self, HTML):
if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type)
...@@ -154,8 +151,7 @@ class EPCManagement(): ...@@ -154,8 +151,7 @@ class EPCManagement():
else: else:
logging.error('This option should not occur!') logging.error('This option should not occur!')
mySSH.close() mySSH.close()
if self.htmlObj is not None: HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
def SetMmeIPAddress(self): def SetMmeIPAddress(self):
# Not an error if we don't need an EPC # Not an error if we don't need an EPC
...@@ -176,7 +172,7 @@ class EPCManagement(): ...@@ -176,7 +172,7 @@ class EPCManagement():
else: else:
self.MmeIPAddress = self.IPAddress self.MmeIPAddress = self.IPAddress
def InitializeSPGW(self): def InitializeSPGW(self, HTML):
if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type)
...@@ -213,8 +209,7 @@ class EPCManagement(): ...@@ -213,8 +209,7 @@ class EPCManagement():
else: else:
logging.error('This option should not occur!') logging.error('This option should not occur!')
mySSH.close() mySSH.close()
if self.htmlObj is not None: HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
def CheckHSSProcess(self, status_queue): def CheckHSSProcess(self, status_queue):
try: try:
...@@ -298,7 +293,7 @@ class EPCManagement(): ...@@ -298,7 +293,7 @@ class EPCManagement():
except: except:
os.kill(os.getppid(),signal.SIGUSR1) os.kill(os.getppid(),signal.SIGUSR1)
def TerminateHSS(self): def TerminateHSS(self, HTML):
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.open(self.IPAddress, self.UserName, self.Password)
if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE):
...@@ -331,10 +326,9 @@ class EPCManagement(): ...@@ -331,10 +326,9 @@ class EPCManagement():
else: else:
logging.error('This should not happen!') logging.error('This should not happen!')
mySSH.close() mySSH.close()
if self.htmlObj is not None: HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
def TerminateMME(self): def TerminateMME(self, HTML):
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.open(self.IPAddress, self.UserName, self.Password)
if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE):
...@@ -358,10 +352,9 @@ class EPCManagement(): ...@@ -358,10 +352,9 @@ class EPCManagement():
else: else:
logging.error('This should not happen!') logging.error('This should not happen!')
mySSH.close() mySSH.close()
if self.htmlObj is not None: HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
def TerminateSPGW(self): def TerminateSPGW(self, HTML):
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.open(self.IPAddress, self.UserName, self.Password)
if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE):
...@@ -402,15 +395,13 @@ class EPCManagement(): ...@@ -402,15 +395,13 @@ class EPCManagement():
else: else:
logging.error('This should not happen!') logging.error('This should not happen!')
mySSH.close() mySSH.close()
if self.htmlObj is not None: HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
self.htmlObj.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
def DeployEpc(self): def DeployEpc(self, HTML):
logging.debug('Trying to deploy') logging.debug('Trying to deploy')
if not re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): if not re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE):
if self.htmlObj is not None: HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER)
self.htmlObj.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) HTML.CreateHtmlTabFooter(False)
self.htmlObj.CreateHtmlTabFooter(False)
sys.exit('Deploy not possible with this EPC type: ' + self.Type) sys.exit('Deploy not possible with this EPC type: ' + self.Type)
if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '':
...@@ -423,9 +414,8 @@ class EPCManagement(): ...@@ -423,9 +414,8 @@ class EPCManagement():
result = re.search('docker-compose version 1', mySSH.getBefore()) result = re.search('docker-compose version 1', mySSH.getBefore())
if result is None: if result is None:
mySSH.close() mySSH.close()
if self.htmlObj is not None: HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER)
self.htmlObj.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) HTML.CreateHtmlTabFooter(False)
self.htmlObj.CreateHtmlTabFooter(False)
sys.exit('docker-compose not installed on ' + self.IPAddress) sys.exit('docker-compose not installed on ' + self.IPAddress)
mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5)
...@@ -458,9 +448,8 @@ class EPCManagement(): ...@@ -458,9 +448,8 @@ class EPCManagement():
cnt += 1 cnt += 1
mySSH.command('docker rm -f prod-db-init', '\$', 5) mySSH.command('docker rm -f prod-db-init', '\$', 5)
if not db_init_status: if not db_init_status:
if self.htmlObj is not None: HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER)
self.htmlObj.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) HTML.CreateHtmlTabFooter(False)
self.htmlObj.CreateHtmlTabFooter(False)
sys.exit('Cassandra DB deployment/configuration went wrong!') sys.exit('Cassandra DB deployment/configuration went wrong!')
# deploying EPC cNFs # deploying EPC cNFs
...@@ -503,13 +492,13 @@ class EPCManagement(): ...@@ -503,13 +492,13 @@ class EPCManagement():
mySSH.command('docker exec -d prod-oai-spgwu-tiny /bin/bash -c "nohup tshark -i any -f \'port 8805\' -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 10) mySSH.command('docker exec -d prod-oai-spgwu-tiny /bin/bash -c "nohup tshark -i any -f \'port 8805\' -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 10)
mySSH.close() mySSH.close()
logging.debug('Deployment OK') logging.debug('Deployment OK')
self.htmlObj.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
else: else:
mySSH.close() mySSH.close()
logging.debug('Deployment went wrong') logging.debug('Deployment went wrong')
self.htmlObj.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER)
def UndeployEpc(self): def UndeployEpc(self, HTML):
logging.debug('Trying to undeploy') logging.debug('Trying to undeploy')
# No check down, we suppose everything done before. # No check down, we suppose everything done before.
...@@ -551,10 +540,10 @@ class EPCManagement(): ...@@ -551,10 +540,10 @@ class EPCManagement():
mySSH.close() mySSH.close()
if noMoreContainerNb == nbContainers and noMoreNetworkNb == 2: if noMoreContainerNb == nbContainers and noMoreNetworkNb == 2:
logging.debug('Undeployment OK') logging.debug('Undeployment OK')
self.htmlObj.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK)
else: else:
logging.debug('Undeployment went wrong') logging.debug('Undeployment went wrong')
self.htmlObj.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER)
def LogCollectHSS(self): def LogCollectHSS(self):
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
......
...@@ -379,14 +379,6 @@ RAN = ran.RANManagement() ...@@ -379,14 +379,6 @@ RAN = ran.RANManagement()
HTML = html.HTMLManagement() HTML = html.HTMLManagement()
CONTAINERS = cls_containerize.Containerize() CONTAINERS = cls_containerize.Containerize()
EPC.htmlObj=HTML
RAN.htmlObj=HTML
RAN.epcObj=EPC
CONTAINERS.htmlObj=HTML
CONTAINERS.epcObj=EPC
CONTAINERS.ranObj=RAN
ldpc=cls_physim.PhySim() #create an instance for LDPC test using GPU or CPU build ldpc=cls_physim.PhySim() #create an instance for LDPC test using GPU or CPU build
...@@ -668,17 +660,16 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -668,17 +660,16 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
RAN.prematureExit = True RAN.prematureExit = True
break break
if action == 'Build_eNB': if action == 'Build_eNB':
RAN.BuildeNB() RAN.BuildeNB(HTML)
elif action == 'WaitEndBuild_eNB': elif action == 'WaitEndBuild_eNB':
RAN.WaitBuildeNBisFinished() RAN.WaitBuildeNBisFinished(HTML)
elif action == 'Initialize_eNB': elif action == 'Initialize_eNB':
check_eNB = False check_eNB = False
check_OAI_UE = False check_OAI_UE = False
RAN.pStatus=CiTestObj.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) RAN.pStatus=CiTestObj.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
RAN.InitializeeNB(HTML, EPC)
RAN.InitializeeNB()
elif action == 'Terminate_eNB': elif action == 'Terminate_eNB':
RAN.TerminateeNB() RAN.TerminateeNB(HTML, EPC)
elif action == 'Initialize_UE': elif action == 'Initialize_UE':
CiTestObj.InitializeUE(HTML,COTS_UE) CiTestObj.InitializeUE(HTML,COTS_UE)
elif action == 'Terminate_UE': elif action == 'Terminate_UE':
...@@ -698,17 +689,17 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -698,17 +689,17 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif action == 'Initialize_OAI_UE': elif action == 'Initialize_OAI_UE':
CiTestObj.InitializeOAIUE(HTML,RAN,EPC,COTS_UE) CiTestObj.InitializeOAIUE(HTML,RAN,EPC,COTS_UE)
elif action == 'Terminate_OAI_UE': elif action == 'Terminate_OAI_UE':
CiTestObj.TerminateOAIUE(HTML,RAN,COTS_UE) CiTestObj.TerminateOAIUE(HTML,RAN,COTS_UE,EPC)
elif action == 'Initialize_CatM_module': elif action == 'Initialize_CatM_module':
CiTestObj.InitializeCatM(HTML) CiTestObj.InitializeCatM(HTML)
elif action == 'Terminate_CatM_module': elif action == 'Terminate_CatM_module':
CiTestObj.TerminateCatM(HTML) CiTestObj.TerminateCatM(HTML)
elif action == 'Attach_CatM_module': elif action == 'Attach_CatM_module':
CiTestObj.AttachCatM(HTML,RAN,COTS_UE) CiTestObj.AttachCatM(HTML,RAN,COTS_UE,EPC)
elif action == 'Detach_CatM_module': elif action == 'Detach_CatM_module':
CiTestObj.TerminateCatM(HTML) CiTestObj.TerminateCatM(HTML)
elif action == 'Ping_CatM_module': elif action == 'Ping_CatM_module':
CiTestObj.PingCatM(HTML,RAN,EPC,COTS_UE) CiTestObj.PingCatM(HTML,RAN,EPC,COTS_UE,EPC)
elif action == 'Ping': elif action == 'Ping':
CiTestObj.Ping(HTML,RAN,EPC,COTS_UE) CiTestObj.Ping(HTML,RAN,EPC,COTS_UE)
elif action == 'Iperf': elif action == 'Iperf':
...@@ -716,21 +707,21 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -716,21 +707,21 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif action == 'Reboot_UE': elif action == 'Reboot_UE':
CiTestObj.RebootUE(HTML,RAN,EPC) CiTestObj.RebootUE(HTML,RAN,EPC)
elif action == 'Initialize_HSS': elif action == 'Initialize_HSS':
EPC.InitializeHSS() EPC.InitializeHSS(HTML)
elif action == 'Terminate_HSS': elif action == 'Terminate_HSS':
EPC.TerminateHSS() EPC.TerminateHSS(HTML)
elif action == 'Initialize_MME': elif action == 'Initialize_MME':
EPC.InitializeMME() EPC.InitializeMME(HTML)
elif action == 'Terminate_MME': elif action == 'Terminate_MME':
EPC.TerminateMME() EPC.TerminateMME(HTML)
elif action == 'Initialize_SPGW': elif action == 'Initialize_SPGW':
EPC.InitializeSPGW() EPC.InitializeSPGW(HTML)
elif action == 'Terminate_SPGW': elif action == 'Terminate_SPGW':
EPC.TerminateSPGW() EPC.TerminateSPGW(HTML)
elif action == 'Deploy_EPC': elif action == 'Deploy_EPC':
EPC.DeployEpc() EPC.DeployEpc(HTML)
elif action == 'Undeploy_EPC': elif action == 'Undeploy_EPC':
EPC.UndeployEpc() EPC.UndeployEpc(HTML)
elif action == 'Initialize_FlexranCtrl': elif action == 'Initialize_FlexranCtrl':
CiTestObj.InitializeFlexranCtrl(HTML,RAN,EPC) CiTestObj.InitializeFlexranCtrl(HTML,RAN,EPC)
elif action == 'Terminate_FlexranCtrl': elif action == 'Terminate_FlexranCtrl':
...@@ -745,11 +736,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -745,11 +736,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif action == 'Run_PhySim': elif action == 'Run_PhySim':
HTML=ldpc.Run_PhySim(HTML,CONST,id) HTML=ldpc.Run_PhySim(HTML,CONST,id)
elif action == 'Build_Image': elif action == 'Build_Image':
CONTAINERS.BuildImage() CONTAINERS.BuildImage(HTML)
elif action == 'Deploy_Object': elif action == 'Deploy_Object':
CONTAINERS.DeployObject() CONTAINERS.DeployObject(HTML, EPC)
elif action == 'Undeploy_Object': elif action == 'Undeploy_Object':
CONTAINERS.UndeployObject() CONTAINERS.UndeployObject(HTML, RAN)
else: else:
sys.exit('Invalid class (action) from xml') sys.exit('Invalid class (action) from xml')
if not RAN.prematureExit: if not RAN.prematureExit:
......
This diff is collapsed.
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