Commit a0cf4077 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: final fixes on help functions

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 1e6e780a
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#----------------------------------------------------------- #-----------------------------------------------------------
# Version # Version
#----------------------------------------------------------- #-----------------------------------------------------------
Version = '0.1' Version = '0.2'
#----------------------------------------------------------- #-----------------------------------------------------------
# Constants # Constants
......
...@@ -96,7 +96,7 @@ class EPCManagement(): ...@@ -96,7 +96,7 @@ class EPCManagement():
def InitializeHSS(self): def InitializeHSS(self):
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(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)
sys.exit('Insufficient EPC Parameters') sys.exit('Insufficient EPC Parameters')
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
...@@ -134,7 +134,7 @@ class EPCManagement(): ...@@ -134,7 +134,7 @@ class EPCManagement():
def InitializeMME(self): def InitializeMME(self):
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(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)
sys.exit('Insufficient EPC Parameters') sys.exit('Insufficient EPC Parameters')
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
...@@ -168,7 +168,7 @@ class EPCManagement(): ...@@ -168,7 +168,7 @@ class EPCManagement():
def InitializeSPGW(self): def InitializeSPGW(self):
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(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)
sys.exit('Insufficient EPC Parameters') sys.exit('Insufficient EPC Parameters')
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
......
...@@ -363,8 +363,8 @@ class HTMLManagement(): ...@@ -363,8 +363,8 @@ class HTMLManagement():
def CreateHtmlRetrySeparator(self, cntnumfails): def CreateHtmlRetrySeparator(self, cntnumfails):
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)):
self.htmlFile = open('test_results.html', 'a') self.htmlFile = open('test_results.html', 'a')
self.htmlFile.write(' <tr bgcolor = "#33CCFF" >\n') self.htmlFile.write(' <tr bgcolor = "#F0F0F0" >\n')
self.htmlFile.write(' <td colspan=' + str(5+self.htmlUEConnected) + '>Try Run #' + str(cntnumfails) + '</td>\n') self.htmlFile.write(' <td colspan=' + str(5+self.htmlUEConnected) + '><b> ---- Try Run #' + str(cntnumfails) + ' ---- </b></td>\n')
self.htmlFile.write(' </tr>\n') self.htmlFile.write(' </tr>\n')
self.htmlFile.close() self.htmlFile.close()
......
...@@ -30,11 +30,6 @@ ...@@ -30,11 +30,6 @@
import constants as CONST import constants as CONST
#-----------------------------------------------------------
# Version
#-----------------------------------------------------------
Version = '0.1'
#----------------------------------------------------------- #-----------------------------------------------------------
# Import # Import
#----------------------------------------------------------- #-----------------------------------------------------------
...@@ -61,6 +56,12 @@ logging.basicConfig( ...@@ -61,6 +56,12 @@ logging.basicConfig(
class OaiCiTest(): class OaiCiTest():
def __init__(self): def __init__(self):
self.ranRepository = ''
self.ranBranch = ''
self.ranCommitID = ''
self.ranAllowMerge = False
self.ranTargetBranch = ''
self.FailReportCnt = 0 self.FailReportCnt = 0
self.ADBIPAddress = '' self.ADBIPAddress = ''
self.ADBUserName = '' self.ADBUserName = ''
...@@ -105,8 +106,8 @@ class OaiCiTest(): ...@@ -105,8 +106,8 @@ class OaiCiTest():
self.expectedNbOfConnectedUEs = 0 self.expectedNbOfConnectedUEs = 0
def BuildOAIUE(self): def BuildOAIUE(self):
if self.UEIPAddress == '' or RAN.GetranRepository() == '' or RAN.GetranBranch() == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': if self.UEIPAddress == '' or self.ranRepository == '' or self.ranBranch == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword) SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword)
result = re.search('--nrUE', self.Build_OAI_UE_args) result = re.search('--nrUE', self.Build_OAI_UE_args)
...@@ -116,11 +117,11 @@ class OaiCiTest(): ...@@ -116,11 +117,11 @@ class OaiCiTest():
else: else:
RAN.Setair_interface('lte') RAN.Setair_interface('lte')
ue_prefix = '' ue_prefix = ''
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', RAN.GetranRepository()) result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
if result is not None: if result is not None:
full_ran_repo_name = RAN.GetranRepository() full_ran_repo_name = self.ranRepository
else: else:
full_ran_repo_name = RAN.GetranRepository() + '.git' full_ran_repo_name = self.ranRepository + '.git'
SSH.command('mkdir -p ' + self.UESourceCodePath, '\$', 5) SSH.command('mkdir -p ' + self.UESourceCodePath, '\$', 5)
SSH.command('cd ' + self.UESourceCodePath, '\$', 5) SSH.command('cd ' + self.UESourceCodePath, '\$', 5)
SSH.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + full_ran_repo_name + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600) SSH.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + full_ran_repo_name + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600)
...@@ -133,19 +134,19 @@ class OaiCiTest(): ...@@ -133,19 +134,19 @@ class OaiCiTest():
if result is not None: if result is not None:
mismatch = False mismatch = False
SSH.command('grep SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2) SSH.command('grep SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2)
result = re.search(RAN.GetranCommitID(), SSH.getBefore()) result = re.search(self.ranCommitID, SSH.getBefore())
if result is None: if result is None:
mismatch = True mismatch = True
SSH.command('grep MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) SSH.command('grep MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2)
if (RAN.GetranAllowMerge()): if self.ranAllowMerge:
result = re.search('YES', SSH.getBefore()) result = re.search('YES', SSH.getBefore())
if result is None: if result is None:
mismatch = True mismatch = True
SSH.command('grep TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) SSH.command('grep TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2)
if RAN.GetranTargetBranch() == '': if self.ranTargetBranch == '':
result = re.search('develop', SSH.getBefore()) result = re.search('develop', SSH.getBefore())
else: else:
result = re.search(RAN.GetranTargetBranch(), SSH.getBefore()) result = re.search(self.ranTargetBranch, SSH.getBefore())
if result is None: if result is None:
mismatch = True mismatch = True
else: else:
...@@ -160,17 +161,17 @@ class OaiCiTest(): ...@@ -160,17 +161,17 @@ class OaiCiTest():
SSH.command('echo ' + self.UEPassword + ' | sudo -S git clean -x -d -ff', '\$', 30) SSH.command('echo ' + self.UEPassword + ' | sudo -S git clean -x -d -ff', '\$', 30)
# if the commit ID is provided use it to point to it # if the commit ID is provided use it to point to it
if RAN.GetranCommitID() != '': if self.ranCommitID != '':
SSH.command('git checkout -f ' + RAN.GetranCommitID(), '\$', 5) SSH.command('git checkout -f ' + self.ranCommitID, '\$', 5)
# if the branch is not develop, then it is a merge request and we need to do # if the branch is not develop, then it is a merge request and we need to do
# the potential merge. Note that merge conflicts should already been checked earlier # the potential merge. Note that merge conflicts should already been checked earlier
if (RAN.GetranAllowMerge()): if self.ranAllowMerge:
if RAN.GetranTargetBranch() == '': if self.ranTargetBranch == '':
if (RAN.GetranBranch() != 'develop') and (RAN.GetranBranch() != 'origin/develop'): if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'):
SSH.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 5) SSH.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 5)
else: else:
logging.debug('Merging with the target branch: ' + RAN.GetranTargetBranch()) logging.debug('Merging with the target branch: ' + self.ranTargetBranch)
SSH.command('git merge --ff origin/' + RAN.GetranTargetBranch() + ' -m "Temporary merge for CI"', '\$', 5) SSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 5)
SSH.command('source oaienv', '\$', 5) SSH.command('source oaienv', '\$', 5)
SSH.command('cd cmake_targets', '\$', 5) SSH.command('cd cmake_targets', '\$', 5)
SSH.command('mkdir -p log', '\$', 5) SSH.command('mkdir -p log', '\$', 5)
...@@ -188,14 +189,14 @@ class OaiCiTest(): ...@@ -188,14 +189,14 @@ class OaiCiTest():
SSH.command('mv compile_oai_ue.log ' + 'build_log_' + self.testCase_id, '\$', 5) SSH.command('mv compile_oai_ue.log ' + 'build_log_' + self.testCase_id, '\$', 5)
if buildStatus: if buildStatus:
# Generating a BUILD INFO file # Generating a BUILD INFO file
SSH.command('echo "SRC_BRANCH: ' + RAN.GetranBranch() + '" > ../LAST_BUILD_INFO.txt', '\$', 2) SSH.command('echo "SRC_BRANCH: ' + self.ranBranch + '" > ../LAST_BUILD_INFO.txt', '\$', 2)
SSH.command('echo "SRC_COMMIT: ' + RAN.GetranCommitID() + '" >> ../LAST_BUILD_INFO.txt', '\$', 2) SSH.command('echo "SRC_COMMIT: ' + self.ranCommitID + '" >> ../LAST_BUILD_INFO.txt', '\$', 2)
if (RAN.GetranAllowMerge()): if self.ranAllowMerge:
SSH.command('echo "MERGED_W_TGT_BRANCH: YES" >> ../LAST_BUILD_INFO.txt', '\$', 2) SSH.command('echo "MERGED_W_TGT_BRANCH: YES" >> ../LAST_BUILD_INFO.txt', '\$', 2)
if RAN.GetranTargetBranch() == '': if self.ranTargetBranch == '':
SSH.command('echo "TGT_BRANCH: develop" >> ../LAST_BUILD_INFO.txt', '\$', 2) SSH.command('echo "TGT_BRANCH: develop" >> ../LAST_BUILD_INFO.txt', '\$', 2)
else: else:
SSH.command('echo "TGT_BRANCH: ' + RAN.GetranTargetBranch() + '" >> ../LAST_BUILD_INFO.txt', '\$', 2) SSH.command('echo "TGT_BRANCH: ' + self.ranTargetBranch + '" >> ../LAST_BUILD_INFO.txt', '\$', 2)
else: else:
SSH.command('echo "MERGED_W_TGT_BRANCH: NO" >> ../LAST_BUILD_INFO.txt', '\$', 2) SSH.command('echo "MERGED_W_TGT_BRANCH: NO" >> ../LAST_BUILD_INFO.txt', '\$', 2)
SSH.close() SSH.close()
...@@ -222,7 +223,7 @@ class OaiCiTest(): ...@@ -222,7 +223,7 @@ class OaiCiTest():
if RAN.GetflexranCtrlInstalled() == False: if RAN.GetflexranCtrlInstalled() == False:
return return
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.open(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword()) SSH.open(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword())
SSH.command('cd /opt/flexran_rtc', '\$', 5) SSH.command('cd /opt/flexran_rtc', '\$', 5)
...@@ -287,7 +288,7 @@ class OaiCiTest(): ...@@ -287,7 +288,7 @@ class OaiCiTest():
def InitializeUE(self): def InitializeUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
multi_jobs = [] multi_jobs = []
i = 0 i = 0
...@@ -303,7 +304,7 @@ class OaiCiTest(): ...@@ -303,7 +304,7 @@ class OaiCiTest():
def InitializeOAIUE(self): def InitializeOAIUE(self):
if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if RAN.Getair_interface() == 'lte': if RAN.Getair_interface() == 'lte':
result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args))
...@@ -501,7 +502,7 @@ class OaiCiTest(): ...@@ -501,7 +502,7 @@ class OaiCiTest():
def InitializeCatM(self): def InitializeCatM(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.enablePicocomClosure() SSH.enablePicocomClosure()
SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
...@@ -540,7 +541,7 @@ class OaiCiTest(): ...@@ -540,7 +541,7 @@ class OaiCiTest():
def TerminateCatM(self): def TerminateCatM(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.enablePicocomClosure() SSH.enablePicocomClosure()
SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
...@@ -561,7 +562,7 @@ class OaiCiTest(): ...@@ -561,7 +562,7 @@ class OaiCiTest():
def AttachCatM(self): def AttachCatM(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.enablePicocomClosure() SSH.enablePicocomClosure()
SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
...@@ -635,7 +636,7 @@ class OaiCiTest(): ...@@ -635,7 +636,7 @@ class OaiCiTest():
def PingCatM(self): def PingCatM(self):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
check_eNB = True check_eNB = True
check_OAI_UE = False check_OAI_UE = False
...@@ -801,7 +802,7 @@ class OaiCiTest(): ...@@ -801,7 +802,7 @@ class OaiCiTest():
def AttachUE(self): def AttachUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
check_eNB = True check_eNB = True
check_OAI_UE = False check_OAI_UE = False
...@@ -875,7 +876,7 @@ class OaiCiTest(): ...@@ -875,7 +876,7 @@ class OaiCiTest():
def DetachUE(self): def DetachUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
check_eNB = True check_eNB = True
check_OAI_UE = False check_OAI_UE = False
...@@ -946,7 +947,7 @@ class OaiCiTest(): ...@@ -946,7 +947,7 @@ class OaiCiTest():
def RebootUE(self): def RebootUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
check_eNB = True check_eNB = True
check_OAI_UE = False check_OAI_UE = False
...@@ -980,7 +981,7 @@ class OaiCiTest(): ...@@ -980,7 +981,7 @@ class OaiCiTest():
def DataDisableUE(self): def DataDisableUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
multi_jobs = [] multi_jobs = []
i = 0 i = 0
...@@ -1009,7 +1010,7 @@ class OaiCiTest(): ...@@ -1009,7 +1010,7 @@ class OaiCiTest():
def DataEnableUE(self): def DataEnableUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
multi_jobs = [] multi_jobs = []
i = 0 i = 0
...@@ -1025,7 +1026,7 @@ class OaiCiTest(): ...@@ -1025,7 +1026,7 @@ class OaiCiTest():
def GetAllUEDevices(self, terminate_ue_flag): def GetAllUEDevices(self, terminate_ue_flag):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
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:
...@@ -1069,7 +1070,7 @@ class OaiCiTest(): ...@@ -1069,7 +1070,7 @@ class OaiCiTest():
def GetAllCatMDevices(self, terminate_ue_flag): def GetAllCatMDevices(self, terminate_ue_flag):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
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:
...@@ -1141,7 +1142,7 @@ class OaiCiTest(): ...@@ -1141,7 +1142,7 @@ class OaiCiTest():
def CheckStatusUE(self): def CheckStatusUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
check_eNB = True check_eNB = True
check_OAI_UE = False check_OAI_UE = False
...@@ -1205,13 +1206,13 @@ class OaiCiTest(): ...@@ -1205,13 +1206,13 @@ class OaiCiTest():
def GetAllUEIPAddresses(self): def GetAllUEIPAddresses(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
ue_ip_status = 0 ue_ip_status = 0
self.UEIPAddresses = [] self.UEIPAddresses = []
if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'): if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'):
if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword) SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword)
SSH.command('ifconfig oaitun_ue1', '\$', 4) SSH.command('ifconfig oaitun_ue1', '\$', 4)
...@@ -1373,11 +1374,11 @@ class OaiCiTest(): ...@@ -1373,11 +1374,11 @@ class OaiCiTest():
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:
if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '': if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
else: else:
if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '': if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
try: try:
if ping_from_eNB is not None: if ping_from_eNB is not None:
...@@ -1460,7 +1461,7 @@ class OaiCiTest(): ...@@ -1460,7 +1461,7 @@ class OaiCiTest():
self.PingNoS1() self.PingNoS1()
return return
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
check_eNB = True check_eNB = True
if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'): if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'):
...@@ -2087,7 +2088,7 @@ class OaiCiTest(): ...@@ -2087,7 +2088,7 @@ class OaiCiTest():
def IperfNoS1(self): def IperfNoS1(self):
if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '': if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
check_eNB = True check_eNB = True
check_OAI_UE = True check_OAI_UE = True
...@@ -2200,7 +2201,7 @@ class OaiCiTest(): ...@@ -2200,7 +2201,7 @@ class OaiCiTest():
self.IperfNoS1() self.IperfNoS1()
return return
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '' or self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '' or self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
check_eNB = True check_eNB = True
if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'): if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'):
...@@ -2625,7 +2626,7 @@ class OaiCiTest(): ...@@ -2625,7 +2626,7 @@ class OaiCiTest():
if RAN.GetflexranCtrlInstalled() == False or RAN.GetflexranCtrlStarted() == False: if RAN.GetflexranCtrlInstalled() == False or RAN.GetflexranCtrlStarted() == False:
return return
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
SSH.open(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword()) SSH.open(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword())
SSH.command('echo ' + EPC.GetPassword() + ' | sudo -S daemon --name=flexran_rtc_daemon --stop', '\$', 5) SSH.command('echo ' + EPC.GetPassword() + ' | sudo -S daemon --name=flexran_rtc_daemon --stop', '\$', 5)
...@@ -2737,18 +2738,21 @@ class OaiCiTest(): ...@@ -2737,18 +2738,21 @@ class OaiCiTest():
self.testCase_id = 'AUTO-KILL-UE' self.testCase_id = 'AUTO-KILL-UE'
HTML.SettestCase_id(self.testCase_id) HTML.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of UE' self.desc = 'Automatic Termination of UE'
HTML.Setdesc('Automatic Termination of UE')
self.ShowTestID() self.ShowTestID()
self.TerminateUE() self.TerminateUE()
if (self.Initialize_OAI_UE_args != ''): if (self.Initialize_OAI_UE_args != ''):
self.testCase_id = 'AUTO-KILL-UE' self.testCase_id = 'AUTO-KILL-OAI-UE'
HTML.SettestCase_id(self.testCase_id) HTML.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of UE' self.desc = 'Automatic Termination of OAI-UE'
HTML.Setdesc('Automatic Termination of OAI-UE')
self.ShowTestID() self.ShowTestID()
self.TerminateOAIUE() self.TerminateOAIUE()
if (RAN.GetInitialize_eNB_args() != ''): if (RAN.GetInitialize_eNB_args() != ''):
self.testCase_id = 'AUTO-KILL-eNB' self.testCase_id = 'AUTO-KILL-eNB'
HTML.SettestCase_id(self.testCase_id) HTML.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of eNB' self.desc = 'Automatic Termination of eNB'
HTML.Setdesc('Automatic Termination of eNB')
self.ShowTestID() self.ShowTestID()
RAN.SeteNB_instance('0') RAN.SeteNB_instance('0')
RAN.TerminateeNB() RAN.TerminateeNB()
...@@ -2756,6 +2760,7 @@ class OaiCiTest(): ...@@ -2756,6 +2760,7 @@ class OaiCiTest():
self.testCase_id = 'AUTO-KILL-flexran-ctl' self.testCase_id = 'AUTO-KILL-flexran-ctl'
HTML.SettestCase_id(self.testCase_id) HTML.SettestCase_id(self.testCase_id)
self.desc = 'Automatic Termination of FlexRan CTL' self.desc = 'Automatic Termination of FlexRan CTL'
HTML.Setdesc('Automatic Termination of FlexRan CTL')
self.ShowTestID() self.ShowTestID()
self.TerminateFlexranCtrl() self.TerminateFlexranCtrl()
RAN.SetprematureExit(True) RAN.SetprematureExit(True)
...@@ -3189,7 +3194,7 @@ CiTestObj = OaiCiTest() ...@@ -3189,7 +3194,7 @@ CiTestObj = OaiCiTest()
import sshconnection import sshconnection
import epc import epc
import helpreadme import helpreadme as HELP
import ran import ran
import html import html
import constants import constants
...@@ -3211,7 +3216,7 @@ while len(argvs) > 1: ...@@ -3211,7 +3216,7 @@ while len(argvs) > 1:
myArgv = argvs.pop(1) # 0th is this file's name myArgv = argvs.pop(1) # 0th is this file's name
if re.match('^\-\-help$', myArgv, re.IGNORECASE): if re.match('^\-\-help$', myArgv, re.IGNORECASE):
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit(0) sys.exit(0)
elif re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE)
...@@ -3221,6 +3226,7 @@ while len(argvs) > 1: ...@@ -3221,6 +3226,7 @@ while len(argvs) > 1:
matchReg = re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE)
else: else:
matchReg = re.match('^\-\-ranRepository=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-ranRepository=(.+)$', myArgv, re.IGNORECASE)
CiTestObj.ranRepository = matchReg.group(1)
RAN.SetranRepository(matchReg.group(1)) RAN.SetranRepository(matchReg.group(1))
HTML.SetranRepository(matchReg.group(1)) HTML.SetranRepository(matchReg.group(1))
elif re.match('^\-\-eNB_AllowMerge=(.+)$|^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-eNB_AllowMerge=(.+)$|^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE):
...@@ -3230,6 +3236,7 @@ while len(argvs) > 1: ...@@ -3230,6 +3236,7 @@ while len(argvs) > 1:
matchReg = re.match('^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE)
doMerge = matchReg.group(1) doMerge = matchReg.group(1)
if ((doMerge == 'true') or (doMerge == 'True')): if ((doMerge == 'true') or (doMerge == 'True')):
CiTestObj.ranAllowMerge = True
RAN.SetranAllowMerge(True) RAN.SetranAllowMerge(True)
HTML.SetranAllowMerge(True) HTML.SetranAllowMerge(True)
elif re.match('^\-\-eNBBranch=(.+)$|^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-eNBBranch=(.+)$|^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE):
...@@ -3237,6 +3244,7 @@ while len(argvs) > 1: ...@@ -3237,6 +3244,7 @@ while len(argvs) > 1:
matchReg = re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE)
else: else:
matchReg = re.match('^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE)
CiTestObj.ranBranch = matchReg.group(1)
RAN.SetranBranch(matchReg.group(1)) RAN.SetranBranch(matchReg.group(1))
HTML.SetranBranch(matchReg.group(1)) HTML.SetranBranch(matchReg.group(1))
elif re.match('^\-\-eNBCommitID=(.*)$|^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE): elif re.match('^\-\-eNBCommitID=(.*)$|^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE):
...@@ -3244,6 +3252,7 @@ while len(argvs) > 1: ...@@ -3244,6 +3252,7 @@ while len(argvs) > 1:
matchReg = re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE)
else: else:
matchReg = re.match('^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE)
CiTestObj.ranCommitID = matchReg.group(1)
RAN.SetranCommitID(matchReg.group(1)) RAN.SetranCommitID(matchReg.group(1))
HTML.SetranCommitID(matchReg.group(1)) HTML.SetranCommitID(matchReg.group(1))
elif re.match('^\-\-eNBTargetBranch=(.*)$|^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE): elif re.match('^\-\-eNBTargetBranch=(.*)$|^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE):
...@@ -3251,6 +3260,7 @@ while len(argvs) > 1: ...@@ -3251,6 +3260,7 @@ while len(argvs) > 1:
matchReg = re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE)
else: else:
matchReg = re.match('^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE)
CiTestObj.ranTargetBranch = matchReg.group(1)
RAN.SetranTargetBranch(matchReg.group(1)) RAN.SetranTargetBranch(matchReg.group(1))
HTML.SetranTargetBranch(matchReg.group(1)) HTML.SetranTargetBranch(matchReg.group(1))
elif re.match('^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$', myArgv, re.IGNORECASE):
...@@ -3352,12 +3362,12 @@ while len(argvs) > 1: ...@@ -3352,12 +3362,12 @@ while len(argvs) > 1:
if ((finalStatus == 'true') or (finalStatus == 'True')): if ((finalStatus == 'true') or (finalStatus == 'True')):
CiTestObj.finalStatus = True CiTestObj.finalStatus = True
else: else:
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Invalid Parameter: ' + myArgv) sys.exit('Invalid Parameter: ' + myArgv)
if re.match('^TerminateeNB$', mode, re.IGNORECASE): if re.match('^TerminateeNB$', mode, re.IGNORECASE):
if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '': if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
RAN.SeteNB_serverId('0') RAN.SeteNB_serverId('0')
RAN.SeteNB_instance('0') RAN.SeteNB_instance('0')
...@@ -3365,74 +3375,74 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE): ...@@ -3365,74 +3375,74 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE):
RAN.TerminateeNB() RAN.TerminateeNB()
elif re.match('^TerminateUE$', mode, re.IGNORECASE): elif re.match('^TerminateUE$', mode, re.IGNORECASE):
if (CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == ''): if (CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == ''):
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
signal.signal(signal.SIGUSR1, receive_signal) signal.signal(signal.SIGUSR1, receive_signal)
CiTestObj.TerminateUE() CiTestObj.TerminateUE()
elif re.match('^TerminateOAIUE$', mode, re.IGNORECASE): elif re.match('^TerminateOAIUE$', mode, re.IGNORECASE):
if CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '': if CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
signal.signal(signal.SIGUSR1, receive_signal) signal.signal(signal.SIGUSR1, receive_signal)
CiTestObj.TerminateOAIUE() CiTestObj.TerminateOAIUE()
elif re.match('^TerminateHSS$', mode, re.IGNORECASE): elif re.match('^TerminateHSS$', mode, re.IGNORECASE):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
EPC.TerminateHSS() EPC.TerminateHSS()
elif re.match('^TerminateMME$', mode, re.IGNORECASE): elif re.match('^TerminateMME$', mode, re.IGNORECASE):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
EPC.TerminateMME() EPC.TerminateMME()
elif re.match('^TerminateSPGW$', mode, re.IGNORECASE): elif re.match('^TerminateSPGW$', mode, re.IGNORECASE):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
EPC.TerminateSPGW() EPC.TerminateSPGW()
elif re.match('^LogCollectBuild$', mode, re.IGNORECASE): elif re.match('^LogCollectBuild$', mode, re.IGNORECASE):
if (RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or RAN.GeteNBSourceCodePath() == '') and (CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == ''): if (RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or RAN.GeteNBSourceCodePath() == '') and (CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == ''):
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
CiTestObj.LogCollectBuild() CiTestObj.LogCollectBuild()
elif re.match('^LogCollecteNB$', mode, re.IGNORECASE): elif re.match('^LogCollecteNB$', mode, re.IGNORECASE):
if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or RAN.GeteNBSourceCodePath() == '': if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or RAN.GeteNBSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
RAN.LogCollecteNB() RAN.LogCollecteNB()
elif re.match('^LogCollectHSS$', mode, re.IGNORECASE): elif re.match('^LogCollectHSS$', mode, re.IGNORECASE):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
EPC.LogCollectHSS() EPC.LogCollectHSS()
elif re.match('^LogCollectMME$', mode, re.IGNORECASE): elif re.match('^LogCollectMME$', mode, re.IGNORECASE):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
EPC.LogCollectMME() EPC.LogCollectMME()
elif re.match('^LogCollectSPGW$', mode, re.IGNORECASE): elif re.match('^LogCollectSPGW$', mode, re.IGNORECASE):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
EPC.LogCollectSPGW() EPC.LogCollectSPGW()
elif re.match('^LogCollectPing$', mode, re.IGNORECASE): elif re.match('^LogCollectPing$', mode, re.IGNORECASE):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
CiTestObj.LogCollectPing() CiTestObj.LogCollectPing()
elif re.match('^LogCollectIperf$', mode, re.IGNORECASE): elif re.match('^LogCollectIperf$', mode, re.IGNORECASE):
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
CiTestObj.LogCollectIperf() CiTestObj.LogCollectIperf()
elif re.match('^LogCollectOAIUE$', mode, re.IGNORECASE): elif re.match('^LogCollectOAIUE$', mode, re.IGNORECASE):
if CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == '': if CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
CiTestObj.LogCollectOAIUE() CiTestObj.LogCollectOAIUE()
elif re.match('^InitiateHtml$', mode, re.IGNORECASE): elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
if (CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == ''): if (CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == ''):
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
count = 0 count = 0
foundCount = 0 foundCount = 0
...@@ -3472,21 +3482,21 @@ elif re.match('^FinalizeHtml$', mode, re.IGNORECASE): ...@@ -3472,21 +3482,21 @@ elif re.match('^FinalizeHtml$', mode, re.IGNORECASE):
elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re.IGNORECASE): elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re.IGNORECASE):
if re.match('^TesteNB$', mode, re.IGNORECASE): if re.match('^TesteNB$', mode, re.IGNORECASE):
if RAN.GeteNBIPAddress() == '' or RAN.GetranRepository() == '' or RAN.GetranBranch() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or RAN.GeteNBSourceCodePath() == '' or EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '' or CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == '': if RAN.GeteNBIPAddress() == '' or RAN.GetranRepository() == '' or RAN.GetranBranch() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or RAN.GeteNBSourceCodePath() == '' or EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetType() == '' or EPC.GetSourceCodePath() == '' or CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '' or EPC.GetType() == '': if EPC.GetIPAddress() == '' or EPC.GetUserName() == '' or EPC.GetPassword() == '' or EPC.GetSourceCodePath() == '' or EPC.GetType() == '':
EPCSrvHelp(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword(), EPC.GetSourceCodePath(), EPC.GetType()) HELP.EPCSrvHelp(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword(), EPC.GetSourceCodePath(), EPC.GetType())
if RAN.GetranRepository() == '': if RAN.GetranRepository() == '':
GitSrvHelp(RAN.GetranRepository(),RAN.GetranBranch(),RAN.GetranCommitID(),RAN.GetranAllowMerge(),RAN.GetranTargetBranch()) HELP.GitSrvHelp(RAN.GetranRepository(), RAN.GetranBranch(), RAN.GetranCommitID(), RAN.GetranAllowMerge(), RAN.GetranTargetBranch())
if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or RAN.GeteNBSourceCodePath() == '': if RAN.GeteNBIPAddress() == '' or RAN.GeteNBUserName() == '' or RAN.GeteNBPassword() == '' or RAN.GeteNBSourceCodePath() == '':
eNBSrvHelp(RAN.GeteNBIPAddress(), RAN.GeteNBUserName(), RAN.GeteNBPassword(), RAN.GeteNBSourceCodePath()) HELP.eNBSrvHelp(RAN.GeteNBIPAddress(), RAN.GeteNBUserName(), RAN.GeteNBPassword(), RAN.GeteNBSourceCodePath())
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if (EPC.GetIPAddress() != '') and (EPC.GetIPAddress() != 'none'): if (EPC.GetIPAddress() != '') and (EPC.GetIPAddress() != 'none'):
SSH.copyout(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword(), cwd + "/tcp_iperf_stats.awk", "/tmp") SSH.copyout(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword(), cwd + "/tcp_iperf_stats.awk", "/tmp")
SSH.copyout(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword(), cwd + "/active_net_interfaces.awk", "/tmp") SSH.copyout(EPC.GetIPAddress(), EPC.GetUserName(), EPC.GetPassword(), cwd + "/active_net_interfaces.awk", "/tmp")
else: else:
if CiTestObj.UEIPAddress == '' or RAN.GetranRepository() == '' or RAN.GetranBranch() == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == '': if CiTestObj.UEIPAddress == '' or CiTestObj.ranRepository == '' or CiTestObj.ranBranch == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('UE: Insufficient Parameter') sys.exit('UE: Insufficient Parameter')
#read test_case_list.xml file #read test_case_list.xml file
...@@ -3663,6 +3673,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -3663,6 +3673,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
logging.info('Testsuite passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)') logging.info('Testsuite passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)')
HTML.CreateHtmlTabFooter(True) HTML.CreateHtmlTabFooter(True)
else: else:
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Invalid mode') sys.exit('Invalid mode')
sys.exit(0) sys.exit(0)
...@@ -232,7 +232,7 @@ class RANManagement(): ...@@ -232,7 +232,7 @@ class RANManagement():
def BuildeNB(self): def BuildeNB(self):
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if self.eNB_serverId == '0': if self.eNB_serverId == '0':
lIpAddr = self.eNBIPAddress lIpAddr = self.eNBIPAddress
...@@ -250,7 +250,7 @@ class RANManagement(): ...@@ -250,7 +250,7 @@ class RANManagement():
lPassWord = self.eNB2Password lPassWord = self.eNB2Password
lSourcePath = self.eNB2SourceCodePath lSourcePath = self.eNB2SourceCodePath
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
...@@ -359,7 +359,7 @@ class RANManagement(): ...@@ -359,7 +359,7 @@ class RANManagement():
lPassWord = self.eNB2Password lPassWord = self.eNB2Password
lSourcePath = self.eNB2SourceCodePath lSourcePath = self.eNB2SourceCodePath
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
...@@ -454,7 +454,7 @@ class RANManagement(): ...@@ -454,7 +454,7 @@ class RANManagement():
lPassWord = self.eNB2Password lPassWord = self.eNB2Password
lSourcePath = self.eNB2SourceCodePath lSourcePath = self.eNB2SourceCodePath
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if self.htmlObj is not None: if self.htmlObj is not None:
...@@ -679,7 +679,7 @@ class RANManagement(): ...@@ -679,7 +679,7 @@ class RANManagement():
lPassWord = self.eNB2Password lPassWord = self.eNB2Password
lSourcePath = self.eNB2SourceCodePath lSourcePath = self.eNB2SourceCodePath
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '': if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
GenericHelp(Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<htmlTabRef>test-05-tm2</htmlTabRef> <htmlTabRef>test-05-tm2</htmlTabRef>
<htmlTabName>Test-05MHz-TM2</htmlTabName> <htmlTabName>Test-05MHz-TM2</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>3</repeatCount> <repeatCount>2</repeatCount>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030201
040101 040101
......
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