Fix VES client simulator image and pod verification method 00/134600/1
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Tue, 23 May 2023 11:56:25 +0000 (11:56 +0000)
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Tue, 23 May 2023 11:56:25 +0000 (11:56 +0000)
Issue-ID: TEST-397
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Change-Id: Iaabd13e0eed2f7a0714e8baf6f5eaf01da599ebd

src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py
src/onaptests/templates/artifacts/pnf-simulator.tar.gz

index 3180733..0e6e001 100644 (file)
@@ -49,6 +49,7 @@ class PnfSimulatorCnfRegisterStep(BaseStep):
         config.load_kube_config(settings.K8S_CONFIG)
         k8s_client: "CoreV1API" = client.CoreV1Api()
         k8s_watch: "Watch" =  watch.Watch()
+        status = False
         try:
             for event in k8s_watch.stream(k8s_client.list_namespaced_pod,
                                         namespace=settings.K8S_ADDITIONAL_RESOURCES_NAMESPACE,
@@ -57,8 +58,9 @@ class PnfSimulatorCnfRegisterStep(BaseStep):
                     if not event["object"].status.phase in ["Pending", "Running"]:
                         # Invalid pod state
                         return False
-                    return event["object"].status.phase == "Running"
-            return False
+                    if event["object"].status.phase == "Running":
+                        return True
+            return status
         except urllib3.exceptions.HTTPError:
             self._logger.error("Can't connect with k8s")
             raise OnapTestException
@@ -91,8 +93,9 @@ class PnfSimulatorCnfRegisterStep(BaseStep):
     def execute(self) -> None:
         """Send PNF registration event."""
         super().execute()
-        if not self.is_pnf_pod_running():
-            EnvironmentPreparationException("PNF simulator is not running")
+        status = self.is_pnf_pod_running()
+        if not status:
+            raise EnvironmentPreparationException("PNF simulator is not running")
         time.sleep(settings.PNF_WAIT_TIME)  # Let's still wait for PNF simulator to make sure it's initialized
         ves_proto, ves_ip, ves_port = self.get_ves_protocol_ip_and_port()
         registration_number: int = 0
index 605490f..b715b1c 100644 (file)
Binary files a/src/onaptests/templates/artifacts/pnf-simulator.tar.gz and b/src/onaptests/templates/artifacts/pnf-simulator.tar.gz differ