CppCheckAnalysis()/LicenceFormattingCheck(): use node
- ubuntu18 eNB_IPAddress obelix => obelix - cppcheck eNB_IPAddress 172.21.18.47 => carabe
This commit is contained in:
@@ -125,7 +125,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
|||||||
matchReg = re.match(r'^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE)
|
matchReg = re.match(r'^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE)
|
||||||
RAN.eNBIPAddress=matchReg.group(1)
|
RAN.eNBIPAddress=matchReg.group(1)
|
||||||
CONTAINERS.eNBIPAddress=matchReg.group(1)
|
CONTAINERS.eNBIPAddress=matchReg.group(1)
|
||||||
SCA.eNBIPAddress=matchReg.group(1)
|
|
||||||
CLUSTER.eNBIPAddress=matchReg.group(1)
|
CLUSTER.eNBIPAddress=matchReg.group(1)
|
||||||
elif re.match(r'^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE):
|
elif re.match(r'^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE):
|
||||||
matchReg = re.match(r'^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE)
|
matchReg = re.match(r'^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE)
|
||||||
@@ -140,7 +139,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
|||||||
matchReg = re.match(r'^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE)
|
matchReg = re.match(r'^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE)
|
||||||
RAN.eNBUserName=matchReg.group(1)
|
RAN.eNBUserName=matchReg.group(1)
|
||||||
CONTAINERS.eNBUserName=matchReg.group(1)
|
CONTAINERS.eNBUserName=matchReg.group(1)
|
||||||
SCA.eNBUserName=matchReg.group(1)
|
|
||||||
CLUSTER.eNBUserName=matchReg.group(1)
|
CLUSTER.eNBUserName=matchReg.group(1)
|
||||||
elif re.match(r'^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE):
|
elif re.match(r'^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE):
|
||||||
matchReg = re.match(r'^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE)
|
matchReg = re.match(r'^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE)
|
||||||
@@ -155,7 +153,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,CLUSTER):
|
|||||||
matchReg = re.match(r'^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE)
|
matchReg = re.match(r'^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE)
|
||||||
RAN.eNBPassword=matchReg.group(1)
|
RAN.eNBPassword=matchReg.group(1)
|
||||||
CONTAINERS.eNBPassword=matchReg.group(1)
|
CONTAINERS.eNBPassword=matchReg.group(1)
|
||||||
SCA.eNBPassword=matchReg.group(1)
|
|
||||||
CLUSTER.eNBPassword=matchReg.group(1)
|
CLUSTER.eNBPassword=matchReg.group(1)
|
||||||
elif re.match(r'^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE):
|
elif re.match(r'^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE):
|
||||||
matchReg = re.match(r'^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE)
|
matchReg = re.match(r'^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE)
|
||||||
|
|||||||
@@ -76,25 +76,18 @@ class StaticCodeAnalysis():
|
|||||||
self.ranAllowMerge = False
|
self.ranAllowMerge = False
|
||||||
self.ranCommitID = ''
|
self.ranCommitID = ''
|
||||||
self.ranTargetBranch = ''
|
self.ranTargetBranch = ''
|
||||||
self.eNBIPAddress = ''
|
|
||||||
self.eNBUserName = ''
|
|
||||||
self.eNBPassword = ''
|
|
||||||
self.eNBSourceCodePath = ''
|
self.eNBSourceCodePath = ''
|
||||||
|
|
||||||
def CppCheckAnalysis(self, ctx, HTML):
|
def CppCheckAnalysis(self, ctx, node, HTML):
|
||||||
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
|
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
|
||||||
HELP.GenericHelp(CONST.Version)
|
HELP.GenericHelp(CONST.Version)
|
||||||
sys.exit('Insufficient Parameter')
|
sys.exit('Insufficient Parameter')
|
||||||
lIpAddr = self.eNBIPAddress
|
|
||||||
lUserName = self.eNBUserName
|
|
||||||
lPassWord = self.eNBPassword
|
|
||||||
lSourcePath = self.eNBSourceCodePath
|
lSourcePath = self.eNBSourceCodePath
|
||||||
|
|
||||||
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
|
if not lSourcePath or not node:
|
||||||
HELP.GenericHelp(CONST.Version)
|
raise ValueError(f"{lSourcePath=} {node=}")
|
||||||
sys.exit('Insufficient Parameter')
|
logging.debug('Building on server: ' + node)
|
||||||
logging.debug('Building on server: ' + lIpAddr)
|
cmd = cls_cmd.getConnection(node)
|
||||||
cmd = cls_cmd.getConnection(lIpAddr)
|
|
||||||
self.testCase_id = HTML.testCase_id
|
self.testCase_id = HTML.testCase_id
|
||||||
# on RedHat/CentOS .git extension is mandatory
|
# on RedHat/CentOS .git extension is mandatory
|
||||||
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
|
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
|
||||||
@@ -184,20 +177,16 @@ class StaticCodeAnalysis():
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def LicenceAndFormattingCheck(self, ctx, HTML):
|
def LicenceAndFormattingCheck(self, ctx, node, HTML):
|
||||||
# Workspace is no longer recreated from scratch.
|
# Workspace is no longer recreated from scratch.
|
||||||
# It implies that this method shall be called last within a build pipeline
|
# It implies that this method shall be called last within a build pipeline
|
||||||
# where workspace is already created
|
# where workspace is already created
|
||||||
lIpAddr = self.eNBIPAddress
|
|
||||||
lUserName = self.eNBUserName
|
|
||||||
lPassWord = self.eNBPassword
|
|
||||||
lSourcePath = self.eNBSourceCodePath
|
lSourcePath = self.eNBSourceCodePath
|
||||||
|
|
||||||
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
|
if not node or not lSourcePath:
|
||||||
HELP.GenericHelp(CONST.Version)
|
raise ValueError(f"{lSourcePath=} {node=}")
|
||||||
sys.exit('Insufficient Parameter')
|
logging.debug('Building on server: ' + node)
|
||||||
logging.debug('Building on server: ' + lIpAddr)
|
cmd = cls_cmd.getConnection(node)
|
||||||
cmd = cls_cmd.getConnection(lIpAddr)
|
|
||||||
self.testCase_id = HTML.testCase_id
|
self.testCase_id = HTML.testCase_id
|
||||||
|
|
||||||
check_options = ''
|
check_options = ''
|
||||||
|
|||||||
+4
-2
@@ -337,10 +337,12 @@ def ExecuteActionWithParam(action, ctx):
|
|||||||
success = cls_native.Native.Run_Physim(ctx, HTML, RAN.eNBIPAddress, RAN.eNBSourceCodePath, physim_options, physim_test, physim_threshold)
|
success = cls_native.Native.Run_Physim(ctx, HTML, RAN.eNBIPAddress, RAN.eNBSourceCodePath, physim_options, physim_test, physim_threshold)
|
||||||
|
|
||||||
elif action == 'LicenceAndFormattingCheck':
|
elif action == 'LicenceAndFormattingCheck':
|
||||||
success = SCA.LicenceAndFormattingCheck(ctx, HTML)
|
node = test.findtext('node')
|
||||||
|
success = SCA.LicenceAndFormattingCheck(ctx, node, HTML)
|
||||||
|
|
||||||
elif action == 'Cppcheck_Analysis':
|
elif action == 'Cppcheck_Analysis':
|
||||||
success = SCA.CppCheckAnalysis(ctx, HTML)
|
node = test.findtext('node')
|
||||||
|
success = SCA.CppCheckAnalysis(ctx, node, HTML)
|
||||||
|
|
||||||
elif action == 'Push_Local_Registry':
|
elif action == 'Push_Local_Registry':
|
||||||
node = test.findtext('node')
|
node = test.findtext('node')
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
<testCase id="000001">
|
<testCase id="000001">
|
||||||
<class>Cppcheck_Analysis</class>
|
<class>Cppcheck_Analysis</class>
|
||||||
<desc>Static Code Analysis with cppcheck</desc>
|
<desc>Static Code Analysis with cppcheck</desc>
|
||||||
|
<node>carabe</node>
|
||||||
</testCase>
|
</testCase>
|
||||||
|
|
||||||
</testCaseList>
|
</testCaseList>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<testCase id="000002">
|
<testCase id="000002">
|
||||||
<class>LicenceAndFormattingCheck</class>
|
<class>LicenceAndFormattingCheck</class>
|
||||||
<desc>License and Formatting Checks</desc>
|
<desc>License and Formatting Checks</desc>
|
||||||
|
<node>obelix</node>
|
||||||
</testCase>
|
</testCase>
|
||||||
|
|
||||||
</testCaseList>
|
</testCaseList>
|
||||||
|
|||||||
Reference in New Issue
Block a user