Commit b0e5b6eb authored by Robert Schmidt's avatar Robert Schmidt

Add Run_NRulsimTest

parent aa1cbff5
...@@ -56,7 +56,6 @@ class PhySim: ...@@ -56,7 +56,6 @@ class PhySim:
self.__workSpacePath='' self.__workSpacePath=''
self.__buildLogFile='compile_phy_sim.log' self.__buildLogFile='compile_phy_sim.log'
self.__runLogFile='' self.__runLogFile=''
self.__runResults=[]
self.__runLogPath='phy_sim_logs' self.__runLogPath='phy_sim_logs'
...@@ -71,13 +70,13 @@ class PhySim: ...@@ -71,13 +70,13 @@ class PhySim:
mySSH.copyin(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord, self.__workSpacePath+self.__runLogFile, '.') mySSH.copyin(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord, self.__workSpacePath+self.__runLogFile, '.')
mySSH.close() mySSH.close()
#parse results looking for Encoding and Decoding mean values #parse results looking for Encoding and Decoding mean values
self.__runResults=[] runResults=[]
with open(self.__runLogFile) as f: with open(self.__runLogFile) as f:
for line in f: for line in f:
if 'mean' in line: if 'mean' in line:
self.__runResults.append(line) runResults.append(line)
#the values are appended for each mean value (2), so we take these 2 values from the list #the values are appended for each mean value (2), so we take these 2 values from the list
info=self.__runResults[0]+self.__runResults[1] info = runResults[0] + runResults[1]
#once parsed move the local logfile to its folder for tidiness #once parsed move the local logfile to its folder for tidiness
os.system('mv '+self.__runLogFile+' '+ self.__runLogPath+'/.') os.system('mv '+self.__runLogFile+' '+ self.__runLogPath+'/.')
...@@ -89,6 +88,38 @@ class PhySim: ...@@ -89,6 +88,38 @@ class PhySim:
HTML.CreateHtmlTestRowQueue(self.runargs, 'OK', 1, html_queue) HTML.CreateHtmlTestRowQueue(self.runargs, 'OK', 1, html_queue)
return HTML return HTML
def __CheckResults_NRulsimTest(self, HTML, CONST, testcase_id):
html_queue = SimpleQueue()
#retrieve run log file and store it locally
mySSH = sshconnection.SSHConnection()
filename = self.__workSpacePath + self.__runLogFile
ret = mySSH.copyin(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord, filename, '.')
if ret != 0:
error_msg = f'could not recover test result file {filename}'
logging.error(error_msg)
html_queue.put(f'<pre style="background-color:white">{error_msg}</pre>')
HTML.CreateHtmlTestRowQueue("could not recover results", 'KO', 1, html_queue)
self.exitStatus = 1
return HTML
PUSCH_OK = False
with open(self.__runLogFile) as f:
PUSCH_OK = 'PUSCH test OK' in f.read()
# once parsed move the local logfile to its folder for tidiness
os.system(f'mv {self.__runLogFile} {self.__runLogPath}/.')
#updating the HTML with results
if PUSCH_OK:
html_queue.put('<pre style="background-color:white">succeeded</pre>')
HTML.CreateHtmlTestRowQueue(self.runargs, 'OK', 1, html_queue)
else:
error_msg = 'error: no "PUSCH test OK"'
logging.error(error_msg)
html_queue.put(f'<pre style="background-color:white">{error_msg}</pre>')
HTML.CreateHtmlTestRowQueue(self.runargs, 'KO', 1, html_queue)
self.exitStatus = 1
return HTML
def __CheckBuild_PhySim(self, HTML, CONST): def __CheckBuild_PhySim(self, HTML, CONST):
self.__workSpacePath=self.eNBSourceCodePath+'/cmake_targets/' self.__workSpacePath=self.eNBSourceCodePath+'/cmake_targets/'
...@@ -183,3 +214,16 @@ class PhySim: ...@@ -183,3 +214,16 @@ class PhySim:
lHTML = cls_oai_html.HTMLManagement() lHTML = cls_oai_html.HTMLManagement()
lHTML=self.__CheckResults_LDPCTest(htmlObj,constObj,testcase_id) lHTML=self.__CheckResults_LDPCTest(htmlObj,constObj,testcase_id)
return lHTML return lHTML
def Run_NRulsimTest(self, htmlObj, constObj, testcase_id):
self.__workSpacePath=self.eNBSourceCodePath+'/cmake_targets/'
os.system(f'mkdir -p ./{self.__runLogPath}')
self.__runLogFile = f'physim_{testcase_id}.log'
mySSH = sshconnection.SSHConnection()
mySSH.open(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord)
mySSH.command(f'cd {self.__workSpacePath}', '\$', 5)
mySSH.command(f'sudo {self.__workSpacePath}ran_build/build/nr_ulsim {self.runargs} > {self.__runLogFile} 2>&1', '\$', 30)
mySSH.close()
#return updated HTML to main
lHTML = self.__CheckResults_NRulsimTest(htmlObj, constObj, testcase_id)
return lHTML
...@@ -457,7 +457,7 @@ def GetParametersFromXML(action): ...@@ -457,7 +457,7 @@ def GetParametersFromXML(action):
if (string_field is not None): if (string_field is not None):
CONTAINERS.testSvrId = string_field CONTAINERS.testSvrId = string_field
elif action == 'Run_LDPCTest': elif action == 'Run_LDPCTest' or action == 'Run_NRulsimTest':
ldpc.runargs = test.findtext('physim_run_args') ldpc.runargs = test.findtext('physim_run_args')
else: else:
...@@ -923,6 +923,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -923,6 +923,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
HTML=ldpc.Run_LDPCTest(HTML,CONST,id) HTML=ldpc.Run_LDPCTest(HTML,CONST,id)
if ldpc.exitStatus==1: if ldpc.exitStatus==1:
RAN.prematureExit = True RAN.prematureExit = True
elif action == 'Run_NRulsimTest':
HTML=ldpc.Run_NRulsimTest(HTML,CONST,id)
if ldpc.exitStatus==1:
RAN.prematureExit = True
elif action == 'Build_Image': elif action == 'Build_Image':
CONTAINERS.BuildImage(HTML) CONTAINERS.BuildImage(HTML)
elif action == 'Build_Proxy': elif action == 'Build_Proxy':
......
- Build_Proxy - Build_Proxy
- Build_PhySim - Build_PhySim
- Run_LDPCTest - Run_LDPCTest
- Run_NRulsimTest
- Build_eNB - Build_eNB
- WaitEndBuild_eNB - WaitEndBuild_eNB
- Initialize_eNB - Initialize_eNB
......
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