diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index 4f283f530e..4d88a69e75 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -1,3 +1,33 @@ +# * 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 +# */ +#--------------------------------------------------------------------- +# Python for CI of OAI-eNB + COTS-UE +# +# Required Python Version +# Python 3.x +# +# Required Python Package +# pexpect +#--------------------------------------------------------------------- + + #----------------------------------------------------------- # Import #----------------------------------------------------------- @@ -14,22 +44,28 @@ from multiprocessing import Process, Lock, SimpleQueue # OAI Testing modules #----------------------------------------------------------- import sshconnection as SSH -#from sshconnection import SSHConnection as SSH import helpreadme as HELP import constants as CONST +import html as HTML #----------------------------------------------------------- # Class Declaration #----------------------------------------------------------- class EPCManagement(): + def __init__(self): - self.EPCIPAddress = '' - self.EPCUserName = '' - self.EPCPassword = '' - self.EPCSourceCodePath = '' - self.EPCType = '' + + self.IPAddress = '' + self.UserName = '' + self.Password = '' + self.SourceCodePath = '' + self.Type = '' self.EPC_PcapFileName = '' +#----------------------------------------------------------- +# Setter and Getters +#----------------------------------------------------------- + def SetIPAddress(self, ipaddress): self.EPCIPAddress = ipaddress def GetIPAddress(self): @@ -55,6 +91,10 @@ class EPCManagement(): def Get_PcapFileName(self): return self.EPC_PcapFileName +#----------------------------------------------------------- +# EPC management functions +#----------------------------------------------------------- + def InitializeHSS(self): if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '' or self.EPCSourceCodePath == '' or self.EPCType == '': HELP.GenericHelp(Version) @@ -91,7 +131,7 @@ class EPCManagement(): else: logging.error('This option should not occur!') mySSH.close() - #self.CreateHtmlTestRow(self.EPCType, 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRow(self.EPCType, 'OK', CONST.ALL_PROCESSES_OK) def InitializeMME(self): if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '' or self.EPCSourceCodePath == '' or self.EPCType == '': @@ -124,7 +164,7 @@ class EPCManagement(): else: logging.error('This option should not occur!') mySSH.close() - #self.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) + HTML.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) def InitializeSPGW(self): if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '' or self.EPCSourceCodePath == '' or self.EPCType == '': @@ -155,7 +195,7 @@ class EPCManagement(): else: logging.error('This option should not occur!') mySSH.close() - #self.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) + HTML.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) def CheckHSSProcess(self, status_queue): @@ -255,7 +295,7 @@ class EPCManagement(): else: logging.error('This should not happen!') mySSH.close() - #self.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) def TerminateMME(self): mySSH = SSH.SSHConnection() @@ -274,7 +314,7 @@ class EPCManagement(): else: logging.error('This should not happen!') mySSH.close() - #self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + HTML.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) def TerminateSPGW(self): mySSH = SSH.SSHConnection() @@ -305,7 +345,7 @@ class EPCManagement(): else: logging.error('This should not happen!') mySSH.close() - #self.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) def LogCollectHSS(self): diff --git a/ci-scripts/helpreadme.py b/ci-scripts/helpreadme.py index 294454e270..307ab4ff31 100644 --- a/ci-scripts/helpreadme.py +++ b/ci-scripts/helpreadme.py @@ -1,3 +1,33 @@ +# * 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 +# */ +#--------------------------------------------------------------------- +# Python for CI of OAI-eNB + COTS-UE +# +# Required Python Version +# Python 3.x +# +# Required Python Package +# pexpect +#--------------------------------------------------------------------- + + #----------------------------------------------------------- # Functions Declaration #----------------------------------------------------------- diff --git a/ci-scripts/html.py b/ci-scripts/html.py index 80ad46f51e..e8930f6e2c 100644 --- a/ci-scripts/html.py +++ b/ci-scripts/html.py @@ -1,3 +1,32 @@ +# * 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 +# */ +#--------------------------------------------------------------------- +# Python for CI of OAI-eNB + COTS-UE +# +# Required Python Version +# Python 3.x +# +# Required Python Package +# pexpect +#--------------------------------------------------------------------- + #----------------------------------------------------------- # Import @@ -10,117 +39,24 @@ import time import subprocess from multiprocessing import Process, Lock, SimpleQueue -#----------------------------------------------------------- -# OAI Testing modules -#----------------------------------------------------------- -#import main_enb -#MAIN = main_enb.OaiCiTest() - - #----------------------------------------------------------- # Class Declaration #----------------------------------------------------------- class HTMLManagement(): + def __init__(self): - # self.FailReportCnt = 0 - # self.prematureExit = False - self.ranRepository = '' - self.ranBranch = '' - self.ranAllowMerge = False - self.ranCommitID = '' - self.ranTargetBranch = '' - #self.eNBIPAddress = '' - #self.eNBUserName = '' - #self.eNBPassword = '' - #self.eNBSourceCodePath = '' - #self.eNB1IPAddress = '' - #self.eNB1UserName = '' - #self.eNB1Password = '' - #self.eNB1SourceCodePath = '' - #self.eNB2IPAddress = '' - #self.eNB2UserName = '' - #self.eNB2Password = '' - #self.eNB2SourceCodePath = '' - #self.ADBIPAddress = '' - #self.ADBUserName = '' - #self.ADBPassword = '' - #self.ADBCentralized = True - #self.testCase_id = '' - self.testXMLfiles = [] - self.nbTestXMLfiles = 0 - #self.desc = '' - #self.Build_eNB_args = '' - #self.backgroundBuild = False - #self.backgroundBuildTestId = ['', '', ''] - #self.Build_eNB_forced_workspace_cleanup = False - #self.Initialize_eNB_args = '' - #self.air_interface = 'lte' - #self.eNB_instance = '' - #self.eNB_serverId = '' - #self.eNBLogFiles = ['', '', ''] - #self.eNBOptions = ['', '', ''] - #self.eNBmbmsEnables = [False, False, False] - #self.eNBstatuses = [-1, -1, -1] - #self.ping_args = '' - #self.ping_packetloss_threshold = '' - #self.iperf_args = '' - #self.iperf_packetloss_threshold = '' - #self.iperf_profile = '' - #self.iperf_options = '' - #self.nbMaxUEtoAttach = -1 - #self.UEDevices = [] - #self.UEDevicesStatus = [] - #self.UEDevicesRemoteServer = [] - #self.UEDevicesRemoteUser = [] - #self.UEDevicesOffCmd = [] - #self.UEDevicesOnCmd = [] - #self.UEDevicesRebootCmd = [] - #self.CatMDevices = [] - #self.UEIPAddresses = [] - self.htmlFile = '' - self.htmlHeaderCreated = False - self.htmlFooterCreated = False - self.htmlUEConnected = -1 - self.htmlNb_Smartphones = 0 - self.htmlNb_CATM_Modules = 0 - self.htmleNBFailureMsg = '' - self.htmlUEFailureMsg = '' - #self.picocom_closure = False - #self.idle_sleep_time = 0 - #self.x2_ho_options = 'network' - #self.x2NbENBs = 0 - #self.x2ENBBsIds = [] - #self.x2ENBConnectedUEs = [] + self.htmlTabRefs = [] self.htmlTabNames = [] self.htmlTabIcons = [] - #self.repeatCounts = [] - #self.finalStatus = False - #self.OsVersion = '' - #self.KernelVersion = '' - #self.UhdVersion = '' - #self.UsrpBoard = '' - #self.CpuNb = '' - #self.CpuModel = '' - #self.CpuMHz = '' - #self.UEIPAddress = '' - #self.UEUserName = '' - #self.UEPassword = '' - #self.UE_instance = '' - #self.UESourceCodePath = '' - #self.UELogFile = '' - #self.Build_OAI_UE_args = '' - #self.Initialize_OAI_UE_args = '' - #self.clean_repository = True - #self.flexranCtrlInstalled = False - #self.flexranCtrlStarted = False - #self.expectedNbOfConnectedUEs = 0 - #self.startTime = 0 - - + self.testXMLfiles = [] #----------------------------------------------------------- -# HTML Reporting.... +# Setters and Getters #----------------------------------------------------------- + def SetreseNB(self,rsenb): + self.reseNB = rsenb + def SetresUE(self,rsue): + self.resUE = rsue def Setdesc(self, dsc): self.desc = dsc @@ -157,11 +93,6 @@ class HTMLManagement(): self.ranTargetBranch = tbranch def GetranTargetBranch(self): return self.ranTargetBranch - -# def SetADBIPAddress(self, adbip): -# self.ADBIPAddress = adbip -# def GetADBIPAddress(self): -# return self.ADBIPAddress def SethtmlUEConnected(self, nbUEs): self.htmlUEConnected = nbUEs @@ -187,6 +118,12 @@ class HTMLManagement(): def SethtmlTabIcons(self, tabIcon): self.htmlTabIcons.append(tabIcon) + +#----------------------------------------------------------- +# HTML structure creation functions +#----------------------------------------------------------- + + def CreateHtmlHeader(self, ADBIPAddress): if (not self.htmlHeaderCreated): logging.debug('\u001B[1m----------------------------------------\u001B[0m') @@ -270,15 +207,9 @@ class HTMLManagement(): self.htmlFile.write(' \n') if (ADBIPAddress != 'none'): - #terminate_ue_flag = True - #MAIN.GetAllUEDevices(terminate_ue_flag) - #self.GetAllCatMDevices(terminate_ue_flag) - #self.htmlUEConnected = len(self.UEDevices) self.htmlFile.write('
| ' + str(machine) + ' Server Characteristics | \n') + self.htmlFile.write('' + str('eNB') + ' Server Characteristics | \n') + self.htmlFile.write('||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OS Version | \n') + self.htmlFile.write('' + self.OsVersion + ' | \n') + self.htmlFile.write('Kernel Version | \n') + self.htmlFile.write('' + self.KernelVersion + ' | \n') + self.htmlFile.write('UHD Version | \n') + self.htmlFile.write('' + self.UhdVersion + ' | \n') + self.htmlFile.write('USRP Board | \n') + self.htmlFile.write('' + self.UsrpBoard + ' | \n') + self.htmlFile.write('||||||||
| Nb CPUs | \n') + self.htmlFile.write('' + self.CpuNb + ' | \n') + self.htmlFile.write('CPU Model Name | \n') + self.htmlFile.write('' + self.CpuModel + ' | \n') + self.htmlFile.write('CPU Frequency | \n') + self.htmlFile.write('' + self.CpuMHz + ' | \n') + self.htmlFile.write('\n') + self.htmlFile.write(' | \n') + self.htmlFile.write(' | ||||||||
| ' + str('UE') + ' Server Characteristics | \n') self.htmlFile.write('|||||||||||||||
| OS Version | \n') @@ -410,8 +360,6 @@ class HTMLManagement(): self.htmlFile.write('|||||||||||||||