Commit b54fbaec authored by Mohammed Ismail's avatar Mohammed Ismail

CI: correction and update

Signed-off-by: default avatarMohammed Ismail <mohammed.ismail@openairinterface.org>
parent 977226c8
...@@ -26,6 +26,7 @@ keywords: ...@@ -26,6 +26,7 @@ keywords:
- Physical Simulators - Physical Simulators
- RAN - RAN
- 4G - 4G
- 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -26,7 +26,7 @@ keywords: ...@@ -26,7 +26,7 @@ keywords:
- Physical Simulator - Physical Simulator
- ldpctest - ldpctest
- RAN - RAN
- 4G - 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -26,7 +26,7 @@ keywords: ...@@ -26,7 +26,7 @@ keywords:
- Physical Simulator - Physical Simulator
- nr-dlschsim - nr-dlschsim
- RAN - RAN
- 4G - 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -26,7 +26,7 @@ keywords: ...@@ -26,7 +26,7 @@ keywords:
- Physical Simulator - Physical Simulator
- nr-dlsim - nr-dlsim
- RAN - RAN
- 4G - 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -26,7 +26,7 @@ keywords: ...@@ -26,7 +26,7 @@ keywords:
- Physical Simulator - Physical Simulator
- nr-pbchsim - nr-pbchsim
- RAN - RAN
- 4G - 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -26,7 +26,7 @@ keywords: ...@@ -26,7 +26,7 @@ keywords:
- Physical Simulator - Physical Simulator
- nr-prachsim - nr-prachsim
- RAN - RAN
- 4G - 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -26,7 +26,7 @@ keywords: ...@@ -26,7 +26,7 @@ keywords:
- Physical Simulator - Physical Simulator
- nr-pucchsim - nr-pucchsim
- RAN - RAN
- 4G - 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -26,7 +26,7 @@ keywords: ...@@ -26,7 +26,7 @@ keywords:
- Physical Simulator - Physical Simulator
- nr-ulschsim - nr-ulschsim
- RAN - RAN
- 4G - 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -26,7 +26,7 @@ keywords: ...@@ -26,7 +26,7 @@ keywords:
- Physical Simulator - Physical Simulator
- nr-ulsim - nr-ulsim
- RAN - RAN
- 4G - 5G
sources: sources:
- https://gitlab.eurecom.fr/oai/openairinterface5g - https://gitlab.eurecom.fr/oai/openairinterface5g
......
...@@ -146,7 +146,7 @@ pipeline { ...@@ -146,7 +146,7 @@ pipeline {
if (params.OC_Credentials == null) { if (params.OC_Credentials == null) {
allParametersPresent = false allParametersPresent = false
} }
if (params.OC_Workspace == null) { if (params.OC_ProjectName == null) {
allParametersPresent = false allParametersPresent = false
} }
if (allParametersPresent) { if (allParametersPresent) {
...@@ -197,7 +197,7 @@ pipeline { ...@@ -197,7 +197,7 @@ pipeline {
for (xmlFile in myXmlTestSuite) { for (xmlFile in myXmlTestSuite) {
if (fileExists(xmlFile)) { if (fileExists(xmlFile)) {
try { try {
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${xmlFile} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCWorkspace=${OC_Workspace}" sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${xmlFile} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName}"
} catch (Exception e) { } catch (Exception e) {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
buildStageStatus = false buildStageStatus = false
......
...@@ -263,9 +263,9 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM): ...@@ -263,9 +263,9 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,ldpc,CONTAINERS,HELP,SCA,PHYSIM):
elif re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE)
PHYSIM.OCPassword = matchReg.group(1) PHYSIM.OCPassword = matchReg.group(1)
elif re.match('^\-\-OCWorkspace=(.+)$', myArgv, re.IGNORECASE): elif re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-OCWorkspace=(.+)$', myArgv, re.IGNORECASE) matchReg = re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE)
PHYSIM.OCWorkspace = matchReg.group(1) PHYSIM.OCProjectName = matchReg.group(1)
else: else:
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Invalid Parameter: ' + myArgv) sys.exit('Invalid Parameter: ' + myArgv)
......
...@@ -48,7 +48,7 @@ class PhySim: ...@@ -48,7 +48,7 @@ class PhySim:
self.eNBPassword = "" self.eNBPassword = ""
self.OCUserName = "" self.OCUserName = ""
self.OCPassword = "" self.OCPassword = ""
self.OCWorkspace = "" self.OCProjectName = ""
self.eNBSourceCodePath = "" self.eNBSourceCodePath = ""
self.ranRepository = "" self.ranRepository = ""
self.ranBranch = "" self.ranBranch = ""
...@@ -74,9 +74,9 @@ class PhySim: ...@@ -74,9 +74,9 @@ class PhySim:
lSourcePath = self.eNBSourceCodePath lSourcePath = self.eNBSourceCodePath
ocUserName = self.OCUserName ocUserName = self.OCUserName
ocPassword = self.OCPassword ocPassword = self.OCPassword
ocWorkspace = self.OCWorkspace ocProjectName = self.OCProjectName
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '' or ocUserName == '' or ocPassword == '' or ocWorkspace == '': if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '' or ocUserName == '' or ocPassword == '' or ocProjectName == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
logging.debug('Building on server: ' + lIpAddr) logging.debug('Building on server: ' + lIpAddr)
...@@ -138,13 +138,13 @@ class PhySim: ...@@ -138,13 +138,13 @@ class PhySim:
sys.exit(-1) sys.exit(-1)
else: else:
logging.debug('\u001B[1m Login to OC Cluster Successfully\u001B[0m') logging.debug('\u001B[1m Login to OC Cluster Successfully\u001B[0m')
mySSH.command(f'oc project {ocWorkspace}', '\$', 6) mySSH.command(f'oc project {ocProjectName}', '\$', 6)
if mySSH.getBefore().count(f'Already on project "{ocWorkspace}"') == 0 and mySSH.getBefore().count(f'Now using project "{self.OCWorkspace}"') == 0: if mySSH.getBefore().count(f'Already on project "{ocProjectName}"') == 0 and mySSH.getBefore().count(f'Now using project "{self.OCProjectName}"') == 0:
logging.error(f'\u001B[1m Unable to access OC project {ocWorkspace}\u001B[0m') logging.error(f'\u001B[1m Unable to access OC project {ocProjectName}\u001B[0m')
mySSH.close() mySSH.close()
sys.exit(-1) sys.exit(-1)
else: else:
logging.debug(f'\u001B[1m Now using project {ocWorkspace}\u001B[0m') logging.debug(f'\u001B[1m Now using project {ocProjectName}\u001B[0m')
# Tag the image and push to the OC cluster # Tag the image and push to the OC cluster
mySSH.command('oc whoami -t | sudo podman login -u ' + ocUserName + ' --password-stdin https://default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/ --tls-verify=false', '\$', 6) mySSH.command('oc whoami -t | sudo podman login -u ' + ocUserName + ' --password-stdin https://default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/ --tls-verify=false', '\$', 6)
...@@ -156,13 +156,13 @@ class PhySim: ...@@ -156,13 +156,13 @@ class PhySim:
logging.debug('\u001B[1m Podman Login to OC Cluster Registry Successfully\u001B[0m') logging.debug('\u001B[1m Podman Login to OC Cluster Registry Successfully\u001B[0m')
mySSH.command('oc create -f openshift/oai-physim-image-stream.yml', '\$', 6) mySSH.command('oc create -f openshift/oai-physim-image-stream.yml', '\$', 6)
if mySSH.getBefore().count('(AlreadyExists):') == 0 and mySSH.getBefore().count('created') == 0: if mySSH.getBefore().count('(AlreadyExists):') == 0 and mySSH.getBefore().count('created') == 0:
logging.error(f'\u001B[1m Image Stream "oai-physim" Creation Failed on OC Cluster {ocWorkspace}\u001B[0m') logging.error(f'\u001B[1m Image Stream "oai-physim" Creation Failed on OC Cluster {ocProjectName}\u001B[0m')
mySSH.close() mySSH.close()
sys.exit(-1) sys.exit(-1)
else: else:
logging.debug(f'\u001B[1m Image Stream "oai-physim" created on OC project {ocWorkspace}\u001B[0m') logging.debug(f'\u001B[1m Image Stream "oai-physim" created on OC project {ocProjectName}\u001B[0m')
mySSH.command(f'sudo podman tag oai-physim:{imageTag} default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCWorkspace}/oai-physim:{imageTag}', '\$', 6) mySSH.command(f'sudo podman tag oai-physim:{imageTag} default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6)
mySSH.command(f'sudo podman push default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCWorkspace}/oai-physim:{imageTag} --tls-verify=false', '\$', 30) mySSH.command(f'sudo podman push default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag} --tls-verify=false', '\$', 30)
if mySSH.getBefore().count('Storing signatures') == 0: if mySSH.getBefore().count('Storing signatures') == 0:
logging.error('\u001B[1m Image "oai-physim" push to OC Cluster Registry Failed\u001B[0m') logging.error('\u001B[1m Image "oai-physim" push to OC Cluster Registry Failed\u001B[0m')
mySSH.close() mySSH.close()
...@@ -200,18 +200,18 @@ class PhySim: ...@@ -200,18 +200,18 @@ class PhySim:
# Waiting to complete the running test # Waiting to complete the running test
count = 0 count = 0
isFinished = False isFinished = False
while(count < 24 and isFinished == False): testCompleteCount = 0
while(count < 25 and isFinished == False):
time.sleep(58) time.sleep(58)
mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6) for podName in podNames:
time.sleep(2) mySSH.command(f'oc logs --tail=1 {podName} 2>&1', '\$', 6)
result = re.search('oai-nr-dlsim[\S\d\w]+', mySSH.getBefore())
if result is not None:
podName1 = result.group()
mySSH.command(f'oc logs --tail=1 {podName1} 2>&1', '\$', 6)
time.sleep(1)
if mySSH.getBefore().count('Finished') != 0: if mySSH.getBefore().count('Finished') != 0:
testCompleteCount += 1
time.sleep(1)
if testCompleteCount == 12:
isFinished = True isFinished = True
count += 1 count += 1
testCompleteCount = 0
if isFinished: if isFinished:
logging.debug('\u001B[1m PhySim test is Complete\u001B[0m') logging.debug('\u001B[1m PhySim test is Complete\u001B[0m')
...@@ -230,7 +230,7 @@ class PhySim: ...@@ -230,7 +230,7 @@ class PhySim:
isFinished1 = True isFinished1 = True
if isFinished1 == True: if isFinished1 == True:
logging.debug('\u001B[1m UnDeployed PhySim Successfully on OC Cluster\u001B[0m') logging.debug('\u001B[1m UnDeployed PhySim Successfully on OC Cluster\u001B[0m')
mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCWorkspace}/oai-physim:{imageTag}', '\$', 6) mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6)
mySSH.command('oc delete is oai-physim', '\$', 6) mySSH.command('oc delete is oai-physim', '\$', 6)
logging.debug('\u001B[1m Deleted the Image and ImageStream\u001B[0m') logging.debug('\u001B[1m Deleted the Image and ImageStream\u001B[0m')
mySSH.command('oc logout', '\$', 6) mySSH.command('oc logout', '\$', 6)
......
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
<htmlTabName>Physical Simulators Check</htmlTabName> <htmlTabName>Physical Simulators Check</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon> <htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList> <TestCaseRequestedList>
000001 0102001
</TestCaseRequestedList> </TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList> <TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000001"> <testCase id="0102001">
<class>Deploy_Run_PhySim</class> <class>Deploy_Run_PhySim</class>
<desc>Deploy and run physical simulator on openshift</desc> <desc>Deploy and run physical simulator on openshift</desc>
</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