Avoid running VNF testing if deployment failed 89/71089/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Sat, 12 Sep 2020 09:31:37 +0000 (11:31 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sat, 12 Sep 2020 11:54:33 +0000 (13:54 +0200)
Change-Id: Id7642e47ec2cc438c5fe3a0ec9447f72b358adab
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 3afa7d700eebf2bfcaabab7bdd3aa09198ba4fe0)

functest_kubernetes/ims/ims.py

index 60cde88..562fc33 100644 (file)
@@ -113,7 +113,11 @@ class Vims(testcase.TestCase):  # pylint: disable=too-many-instance-attributes
                         time.time()-self.start_time)
             if not status:
                 watch_deployment.stop()
-        self.result = 1/2 * 100
+        if not status:
+            self.result = 1/2 * 100
+            return True
+        self.__logger.error("Cannot deploy vIMS")
+        return False
 
     def test_vnf(self):
         """Test vIMS as proposed by clearwater-live-test
@@ -170,8 +174,8 @@ class Vims(testcase.TestCase):  # pylint: disable=too-many-instance-attributes
     def run(self, **kwargs):
         self.start_time = time.time()
         try:
-            self.deploy_vnf()
-            self.test_vnf()
+            if self.deploy_vnf():
+                self.test_vnf()
         except client.rest.ApiException:
             self.__logger.exception("Cannot deploy and test vIms")
         self.stop_time = time.time()