aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-01-28 19:45:44 +0100
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-01-29 22:24:42 +0100
commita7edeebc90bdd335361a7b36f5f5d12a14375554 (patch)
tree0e48ee456ef26471271c5412f3205aafcda41857 /src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py
parent2479155376b6142e97163a7903632015fed50815 (diff)
Enhanced validation of configuration of all tests
Issue-ID: TEST-402 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> Change-Id: I2e4ef6365b44c33f4c0b3e72886a83f92c63e2f3
Diffstat (limited to 'src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py')
-rw-r--r--src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py b/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py
index 5adba2c..0ecc2ca 100644
--- a/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py
+++ b/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py
@@ -5,13 +5,14 @@ import time
from typing import Tuple
import requests
-from kubernetes import client, config, watch
-from onapsdk.configuration import settings
import urllib3
+from kubernetes import client, config, watch
+from onapsdk.configuration import settings
from onaptests.steps.base import BaseStep
from onaptests.steps.instantiate.msb_k8s import CreateInstanceStep
-from onaptests.utils.exceptions import EnvironmentPreparationException, OnapTestException
+from onaptests.utils.exceptions import (EnvironmentPreparationException,
+ OnapTestException)
class PnfSimulatorCnfRegisterStep(BaseStep):
@@ -64,9 +65,9 @@ class PnfSimulatorCnfRegisterStep(BaseStep):
if event["object"].status.phase == "Running":
return True
return status
- except urllib3.exceptions.HTTPError:
+ except urllib3.exceptions.HTTPError as exc:
self._logger.error("Can't connect with k8s")
- raise OnapTestException
+ raise OnapTestException from exc
def get_ves_protocol_ip_and_port(self) -> Tuple[str, str, str]:
"""Static method to get VES protocol, ip address and port.
@@ -92,9 +93,9 @@ class PnfSimulatorCnfRegisterStep(BaseStep):
proto = "https"
return proto, service.spec.cluster_ip, service.spec.ports[0].port
raise EnvironmentPreparationException("Couldn't get VES protocol, ip and port")
- except Exception:
+ except Exception as exc:
self._logger.exception("Can't connect with k8s")
- raise OnapTestException
+ raise OnapTestException from exc
@BaseStep.store_state
def execute(self) -> None:
@@ -131,7 +132,8 @@ class PnfSimulatorCnfRegisterStep(BaseStep):
}
}
}
- }
+ },
+ timeout=settings.DEFAULT_REQUEST_TIMEOUT
)
response.raise_for_status()
registered_successfully = True