Commit 92ce0e8d authored by Raphael Defosseux's avatar Raphael Defosseux

CI: fix merge request case

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 46b386f0
...@@ -49,23 +49,33 @@ class HTMLManagement(): ...@@ -49,23 +49,33 @@ class HTMLManagement():
self.htmlFile = '' self.htmlFile = ''
self.htmlHeaderCreated = False self.htmlHeaderCreated = False
self.htmlFooterCreated = False self.htmlFooterCreated = False
self.ranRepository = ''
self.ranBranch = ''
self.ranCommitID = ''
self.ranAllowMerge = False self.ranAllowMerge = False
self.ranTargetBranch = ''
self.nbTestXMLfiles = 0 self.nbTestXMLfiles = 0
self.htmlTabRefs = [] self.htmlTabRefs = []
self.htmlTabNames = [] self.htmlTabNames = []
self.htmlTabIcons = [] self.htmlTabIcons = []
self.testXMLfiles = [] self.testXMLfiles = []
self.htmleNBFailureMsg = '' self.htmleNBFailureMsg = ''
self.htmlUEFailureMsg = '' self.htmlUEFailureMsg = ''
self.startTime = int(round(time.time() * 1000))
self.testCase_id = ''
self.desc = ''
#----------------------------------------------------------- #-----------------------------------------------------------
# Setters and Getters # Setters and Getters
#----------------------------------------------------------- #-----------------------------------------------------------
def SethtmlUEFailureMsg(self,huefa): def SethtmlUEFailureMsg(self,huefa):
self.htmlUEFailureMsg = huefa self.htmlUEFailureMsg = huefa
def GethtmlUEFailureMsg(self): def GethtmlUEFailureMsg(self):
return huefa return self.htmlUEFailureMsg
def SetreseNB(self,rsenb): def SetreseNB(self,rsenb):
self.reseNB = rsenb self.reseNB = rsenb
...@@ -386,7 +396,7 @@ class HTMLManagement(): ...@@ -386,7 +396,7 @@ class HTMLManagement():
self.htmlFile.close() self.htmlFile.close()
def CreateHtmlTestRow(self, options, status, processesStatus, machine='eNB'): def CreateHtmlTestRow(self, options, status, processesStatus, machine='eNB'):
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): print ('RD: calling CreateHtmlTestRow')
self.htmlFile = open('test_results.html', 'a') self.htmlFile = open('test_results.html', 'a')
currentTime = int(round(time.time() * 1000)) - self.startTime currentTime = int(round(time.time() * 1000)) - self.startTime
self.htmlFile.write(' <tr>\n') self.htmlFile.write(' <tr>\n')
......
...@@ -760,7 +760,6 @@ class OaiCiTest(): ...@@ -760,7 +760,6 @@ class OaiCiTest():
else: else:
SSH.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "dumpsys telephony.registry"\' | grep -m 1 mDataConnectionState', '\$', 60) SSH.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "dumpsys telephony.registry"\' | grep -m 1 mDataConnectionState', '\$', 60)
result = re.search('mDataConnectionState.*=(?P<state>[0-9\-]+)', SSH.getBefore()) result = re.search('mDataConnectionState.*=(?P<state>[0-9\-]+)', SSH.getBefore())
print(SSH.getBefore()) #GP debugging
if result is None: if result is None:
logging.debug('\u001B[1;37;41m mDataConnectionState Not Found! \u001B[0m') logging.debug('\u001B[1;37;41m mDataConnectionState Not Found! \u001B[0m')
lock.acquire() lock.acquire()
...@@ -1069,12 +1068,10 @@ class OaiCiTest(): ...@@ -1069,12 +1068,10 @@ class OaiCiTest():
phone_list_file.close() phone_list_file.close()
if terminate_ue_flag == True: if terminate_ue_flag == True:
print('terminate_ue_flag == True')
if len(self.UEDevices) == 0: if len(self.UEDevices) == 0:
logging.debug('\u001B[1;37;41m UE Not Found! \u001B[0m') logging.debug('\u001B[1;37;41m UE Not Found! \u001B[0m')
sys.exit(1) sys.exit(1)
if len(self.UEDevicesStatus) == 0: if len(self.UEDevicesStatus) == 0:
print('len(self.UEDevicesStatus) == 0')
cnt = 0 cnt = 0
while cnt < len(self.UEDevices): while cnt < len(self.UEDevices):
self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED) self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED)
...@@ -3250,6 +3247,7 @@ while len(argvs) > 1: ...@@ -3250,6 +3247,7 @@ while len(argvs) > 1:
else: else:
matchReg = re.match('^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE)
RAN.SetranTargetBranch(matchReg.group(1)) RAN.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):
if re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE): if re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE)
...@@ -3447,7 +3445,7 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE): ...@@ -3447,7 +3445,7 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
print("Error while parsing file: " + xml_test_file) print("Error while parsing file: " + xml_test_file)
xmlRoot = xmlTree.getroot() xmlRoot = xmlTree.getroot()
HTML.SethtmlTabRefs(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count))) HTML.SethtmlTabRefs(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count)))
HTML.SethtmlTabNames(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count))) HTML.SethtmlTabNames(xmlRoot.findtext('htmlTabName',default='test-tab-' + str(count)))
HTML.SethtmlTabIcons(xmlRoot.findtext('htmlTabIcon',default='info-sign')) HTML.SethtmlTabIcons(xmlRoot.findtext('htmlTabIcon',default='info-sign'))
#CiTestObj.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count))) #CiTestObj.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count)))
#CiTestObj.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-' + str(count))) #CiTestObj.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-' + str(count)))
......
...@@ -386,6 +386,7 @@ class RANManagement(): ...@@ -386,6 +386,7 @@ class RANManagement():
def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId): def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId):
myHTML = HTML.HTMLManagement() myHTML = HTML.HTMLManagement()
myHTML.SettestCase_id(testcaseId)
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 3) mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 3)
......
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