Commit 86225c3b authored by Remi Hardy's avatar Remi Hardy

implement optional Qlog trace

parent 0d3b4246
...@@ -55,14 +55,23 @@ pipeline { ...@@ -55,14 +55,23 @@ pipeline {
string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)),
booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE)) booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE))
] ]
//calling Benetel sub job //calling NSA long sub job
//build job: "RAN-CI-BENETEL", wait : false, propagate : false, parameters: [ build job: "RAN-NSA-Mini-Module-Long", wait : false, propagate : false, parameters: [
// string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_MR', value: String.valueOf(MR)),
// string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)),
// string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)),
// string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)),
// booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE)) booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE))
//] ]
//calling NSA attach/detach job
build job: "RAN-NSA-Mini-Module-Attach-Detach", wait : false, propagate : false, parameters: [
string(name: 'eNB_MR', value: String.valueOf(MR)),
string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)),
string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)),
booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE))
]
} }
} }
} }
......
...@@ -50,7 +50,8 @@ class Module_UE: ...@@ -50,7 +50,8 @@ class Module_UE:
setattr(self, k, v) setattr(self, k, v)
self.UEIPAddress = "" self.UEIPAddress = ""
#dictionary linking command names and related module scripts #dictionary linking command names and related module scripts
self.cmd_dict= {"wup": self.WakeupScript,"detach":self.DetachScript}#dictionary of function scripts self.cmd_dict= {"wup": self.WakeupScript,"detach":self.DetachScript}#dictionary of function scripts
self.ue_trace=''
...@@ -130,13 +131,14 @@ class Module_UE: ...@@ -130,13 +131,14 @@ class Module_UE:
return -1 return -1
def EnableTrace(self): def EnableTrace(self):
mySSH = sshconnection.SSHConnection() if self.ue_trace=="yes":
mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) mySSH = sshconnection.SSHConnection()
#delete old artifacts mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword)
mySSH.command('echo ' + self.HostPassword + ' | sudo -S rm -rf ci_qlog','\$',5) #delete old artifacts
#start Trace, artifact is created in home dir mySSH.command('echo ' + self.HostPassword + ' | sudo -S rm -rf ci_qlog','\$',5)
mySSH.command('echo $USER; nohup sudo -E QLog/QLog -s ci_qlog -f NR5G.cfg &','\$', 5) #start Trace, artifact is created in home dir
mySSH.close() mySSH.command('echo $USER; nohup sudo -E QLog/QLog -s ci_qlog -f NR5G.cfg &','\$', 5)
mySSH.close()
def DisableTrace(self): def DisableTrace(self):
mySSH = sshconnection.SSHConnection() mySSH = sshconnection.SSHConnection()
...@@ -153,18 +155,20 @@ class Module_UE: ...@@ -153,18 +155,20 @@ class Module_UE:
def LogCollect(self): def LogCollect(self):
mySSH = sshconnection.SSHConnection() if self.ue_trace=="yes":
mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) mySSH = sshconnection.SSHConnection()
#archive qlog to USB stick in /media/usb-drive/ci_qlogs with datetime suffix mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword)
now=datetime.now() #archive qlog to USB stick in /media/usb-drive/ci_qlogs with datetime suffix
now_string = now.strftime("%Y%m%d-%H%M") now=datetime.now()
source='ci_qlog' now_string = now.strftime("%Y%m%d-%H%M")
destination='/media/usb-drive/ci_qlogs/ci_qlog_'+now_string+'.zip' source='ci_qlog'
#qlog artifact is zipped into the target folder destination='/media/usb-drive/ci_qlogs/ci_qlog_'+now_string+'.zip'
mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S zip -r '+destination+' '+source+' &','\$', 10) #qlog artifact is zipped into the target folder
mySSH.close() mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S zip -r '+destination+' '+source+' &','\$', 10)
#post action : log cleaning to make sure enough space is reserved for the next run mySSH.close()
Log_Mgt=cls_log_mgt.Log_Mgt(self.HostIPAddress, self.HostPassword, "/media/usb-drive/ci_qlogs") #post action : log cleaning to make sure enough space is reserved for the next run
Log_Mgt.LogRotation() Log_Mgt=cls_log_mgt.Log_Mgt(self.HostIPAddress, self.HostPassword, "/media/usb-drive/ci_qlogs")
Log_Mgt.LogRotation()
else:
destination=""
return destination return destination
...@@ -160,6 +160,7 @@ class OaiCiTest(): ...@@ -160,6 +160,7 @@ class OaiCiTest():
self.air_interface='' self.air_interface=''
self.expectedNbOfConnectedUEs = 0 self.expectedNbOfConnectedUEs = 0
self.ue_id = '' #used for module identification self.ue_id = '' #used for module identification
self.ue_trace ='' #used to enable QLog trace for Module UE, passed to Module UE object at InitializeUE()
def BuildOAIUE(self,HTML): def BuildOAIUE(self,HTML):
...@@ -367,7 +368,7 @@ class OaiCiTest(): ...@@ -367,7 +368,7 @@ class OaiCiTest():
except: except:
os.kill(os.getppid(),signal.SIGUSR1) os.kill(os.getppid(),signal.SIGUSR1)
def InitializeUE(self,HTML,RAN,EPC, COTS_UE, InfraUE): def InitializeUE(self,HTML,RAN,EPC, COTS_UE, InfraUE,ue_trace):
if self.ue_id=='':#no ID specified, then it is a COTS controlled by ADB if self.ue_id=='':#no ID specified, then it is a COTS controlled by ADB
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)
...@@ -386,6 +387,7 @@ class OaiCiTest(): ...@@ -386,6 +387,7 @@ class OaiCiTest():
else: #if an ID is specified, it is a module from the yaml infrastructure file else: #if an ID is specified, it is a module from the yaml infrastructure file
#RH #RH
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
Module_UE.ue_trace=ue_trace
is_module=Module_UE.CheckCMProcess() is_module=Module_UE.CheckCMProcess()
if is_module: if is_module:
Module_UE.EnableTrace() Module_UE.EnableTrace()
...@@ -3102,7 +3104,7 @@ class OaiCiTest(): ...@@ -3102,7 +3104,7 @@ class OaiCiTest():
except: except:
os.kill(os.getppid(),signal.SIGUSR1) os.kill(os.getppid(),signal.SIGUSR1)
def TerminateUE(self,HTML,COTS_UE): def TerminateUE(self,HTML,COTS_UE,InfraUE,ue_trace):
if self.ue_id=='':#no ID specified, then it is a COTS controlled by ADB if self.ue_id=='':#no ID specified, then it is a COTS controlled by ADB
terminate_ue_flag = False terminate_ue_flag = False
self.GetAllUEDevices(terminate_ue_flag) self.GetAllUEDevices(terminate_ue_flag)
...@@ -3119,6 +3121,7 @@ class OaiCiTest(): ...@@ -3119,6 +3121,7 @@ class OaiCiTest():
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
else: #if an ID is specified, it is a module from the yaml infrastructure file else: #if an ID is specified, it is a module from the yaml infrastructure file
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
Module_UE.ue_trace=ue_trace
Module_UE.Command("detach") Module_UE.Command("detach")
Module_UE.DisableTrace() Module_UE.DisableTrace()
Module_UE.DisableCM() Module_UE.DisableCM()
......
...@@ -197,6 +197,7 @@ def GetParametersFromXML(action): ...@@ -197,6 +197,7 @@ def GetParametersFromXML(action):
elif action == 'Initialize_UE': elif action == 'Initialize_UE':
ue_id = test.findtext('id') ue_id = test.findtext('id')
CiTestObj.ue_trace=test.findtext('UE_Trace')#temporary variable, to be passed to Module_UE in Initialize_UE call
if (ue_id is None): if (ue_id is None):
CiTestObj.ue_id = "" CiTestObj.ue_id = ""
else: else:
...@@ -727,9 +728,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -727,9 +728,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif action == 'Terminate_eNB': elif action == 'Terminate_eNB':
RAN.TerminateeNB(HTML, EPC) RAN.TerminateeNB(HTML, EPC)
elif action == 'Initialize_UE': elif action == 'Initialize_UE':
CiTestObj.InitializeUE(HTML,RAN, EPC, COTS_UE, InfraUE) CiTestObj.InitializeUE(HTML,RAN, EPC, COTS_UE, InfraUE, CiTestObj.ue_trace)
elif action == 'Terminate_UE': elif action == 'Terminate_UE':
CiTestObj.TerminateUE(HTML,COTS_UE) CiTestObj.TerminateUE(HTML,COTS_UE, InfraUE, CiTestObj.ue_trace)
elif action == 'Attach_UE': elif action == 'Attach_UE':
CiTestObj.AttachUE(HTML,RAN,EPC,COTS_UE,InfraUE) CiTestObj.AttachUE(HTML,RAN,EPC,COTS_UE,InfraUE)
elif action == 'Detach_UE': elif action == 'Detach_UE':
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
<class>Initialize_UE</class> <class>Initialize_UE</class>
<desc>Initialize Quectel</desc> <desc>Initialize Quectel</desc>
<id>idefix</id> <id>idefix</id>
<UE_Trace>yes</UE_Trace>
</testCase> </testCase>
......
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