From 65549745eed214b87bd874b65dbccbec8e6383ae Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 25 Oct 2023 14:16:25 +0200 Subject: [PATCH] fix(ci): proper automatic undeployment Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 3 +++ ci-scripts/cls_oaicitest.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index dab8b0b64c..bc6b36bd8b 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -289,6 +289,7 @@ class Containerize(): self.proxyCommit = None self.eNB_instance = 0 self.eNB_serverId = ['', '', ''] + self.deployKind = [True, True, True] self.yamlPath = ['', '', ''] self.services = ['', '', ''] self.nb_healthy = [0, 0, 0] @@ -835,6 +836,7 @@ class Containerize(): HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') logging.debug('\u001B[1m Deploying OAI Object on server: ' + lIpAddr + '\u001B[0m') + self.deployKind[self.eNB_instance] = True mySSH = SSH.SSHConnection() mySSH.open(lIpAddr, lUserName, lPassWord) @@ -1037,6 +1039,7 @@ class Containerize(): logging.debug('\u001B[1m Checking Services to deploy\u001B[0m') # Implicitly we are running locally myCmd = cls_cmd.LocalCmd(d = self.yamlPath[0]) + self.deployKind[0] = False cmd = 'docker-compose config --services' listServices = myCmd.run(cmd) if listServices.returncode != 0: diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index d7a8ccfdd9..3065917dfb 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -1358,7 +1358,10 @@ class OaiCiTest(): for instance in range(0, len(CONTAINERS.yamlPath)): if CONTAINERS.yamlPath[instance]!='': CONTAINERS.eNB_instance=instance - CONTAINERS.UndeployObject(HTML,RAN) + if CONTAINERS.deployKind[instance]: + CONTAINERS.UndeployObject(HTML,RAN) + else: + CONTAINERS.UndeployGenObject(HTML,RAN, self) RAN.prematureExit=True #this function is called only if eNB/gNB fails to start @@ -1385,7 +1388,10 @@ class OaiCiTest(): for instance in range(0, len(CONTAINERS.yamlPath)): if CONTAINERS.yamlPath[instance]!='': CONTAINERS.eNB_instance=instance - CONTAINERS.UndeployObject(HTML,RAN) + if CONTAINERS.deployKind[instance]: + CONTAINERS.UndeployObject(HTML,RAN) + else: + CONTAINERS.UndeployGenObject(HTML,RAN,self) RAN.prematureExit=True def IdleSleep(self,HTML):