diff options
Diffstat (limited to 'src/onaptests')
-rw-r--r-- | src/onaptests/configuration/pnf_macro_settings.py | 1 | ||||
-rw-r--r-- | src/onaptests/configuration/settings.py | 3 | ||||
-rw-r--r-- | src/onaptests/steps/onboard/cds.py | 8 | ||||
-rw-r--r-- | src/onaptests/steps/onboard/msb_k8s.py | 2 | ||||
-rw-r--r-- | src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py | 4 |
5 files changed, 10 insertions, 8 deletions
diff --git a/src/onaptests/configuration/pnf_macro_settings.py b/src/onaptests/configuration/pnf_macro_settings.py index c385847..6f59893 100644 --- a/src/onaptests/configuration/pnf_macro_settings.py +++ b/src/onaptests/configuration/pnf_macro_settings.py @@ -44,6 +44,7 @@ MSB_K8S_PROFILE_ARTIFACT_FILE_PATH = Path(Path(__file__).parent.parent, MSB_K8S_PROFILE_NAME = f"{MSB_K8S_RESOURCE_NAME_PREFIX}-profile-{str(uuid4())}" K8S_VERSION = "1.0" K8S_CONFIG = str(Path(Path(__file__).parent.parent, "templates/artifacts/config")) +K8S_ADDITIONAL_RESOURCES_NAMESPACE = "onap-tests" SERVICE_INSTANCE_NAME = "TestPNFMacroInstantiation" diff --git a/src/onaptests/configuration/settings.py b/src/onaptests/configuration/settings.py index 491e5e0..e6f894d 100644 --- a/src/onaptests/configuration/settings.py +++ b/src/onaptests/configuration/settings.py @@ -43,7 +43,8 @@ REPORTING_FILE_PATH = "/tmp/reporting.html" K8S_REGION_TYPE = "k8s" TILLER_HOST = "localhost" K8S_CONFIG = None # None means it will use default config (~/.kube/config) -K8S_NAMESPACE = "onap" # Kubernetes namespace +K8S_ONAP_NAMESPACE = "onap" # ONAP Kubernetes namespace +K8S_ADDITIONAL_RESOURCES_NAMESPACE = K8S_ONAP_NAMESPACE # Resources created on tests namespace #SOCK_HTTP = "socks5h://127.0.0.1:8091" ORCHESTRATION_REQUEST_TIMEOUT = 60.0 * 15 # 15 minutes in seconds diff --git a/src/onaptests/steps/onboard/cds.py b/src/onaptests/steps/onboard/cds.py index 9239c43..7f91d56 100644 --- a/src/onaptests/steps/onboard/cds.py +++ b/src/onaptests/steps/onboard/cds.py @@ -54,7 +54,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep): try: service_data: Dict[str, Any] = self.k8s_client.read_namespaced_service( self.service_name, - settings.K8S_NAMESPACE + settings.K8S_ONAP_NAMESPACE ) return service_data.spec.type == "NodePort" except ApiException: @@ -67,7 +67,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep): Use settings values: - K8S_CONFIG, - - K8S_NAMESPACE. + - K8S_ONAP_NAMESPACE. """ super().execute() @@ -75,7 +75,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep): try: self.k8s_client.patch_namespaced_service( self.service_name, - settings.K8S_NAMESPACE, + settings.K8S_ONAP_NAMESPACE, {"spec": {"ports": [{"port": 8080, "nodePort": 30449}], "type": "NodePort"}} ) except ApiException: @@ -97,7 +97,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep): try: self.k8s_client.patch_namespaced_service( self.service_name, - settings.K8S_NAMESPACE, + settings.K8S_ONAP_NAMESPACE, [ { "op": "remove", diff --git a/src/onaptests/steps/onboard/msb_k8s.py b/src/onaptests/steps/onboard/msb_k8s.py index 1d2aa82..503a886 100644 --- a/src/onaptests/steps/onboard/msb_k8s.py +++ b/src/onaptests/steps/onboard/msb_k8s.py @@ -74,6 +74,6 @@ class CreateProfileStep(BaseStep): rb_version=settings.MSB_K8S_RB_VERSION) with open(settings.MSB_K8S_PROFILE_ARTIFACT_FILE_PATH, "rb") as profile_file: self.profile = definition.create_profile(profile_name=settings.MSB_K8S_PROFILE_NAME, - namespace=settings.K8S_NAMESPACE, + namespace=settings.K8S_ADDITIONAL_RESOURCES_NAMESPACE, kubernetes_version=settings.K8S_VERSION) self.profile.upload_artifact(profile_file.read()) 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 caeb20b..1960659 100644 --- a/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py +++ b/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py @@ -51,7 +51,7 @@ class PnfSimulatorCnfRegisterStep(BaseStep): k8s_watch: "Watch" = watch.Watch() try: for event in k8s_watch.stream(k8s_client.list_namespaced_pod, - namespace=settings.K8S_NAMESPACE, + namespace=settings.K8S_ADDITIONAL_RESOURCES_NAMESPACE, timeout_seconds=timeout_seconds): if event["object"].metadata.name == "pnf-macro-test-simulator": if not event["object"].status.phase in ["Pending", "Running"]: @@ -76,7 +76,7 @@ class PnfSimulatorCnfRegisterStep(BaseStep): config.load_kube_config(settings.K8S_CONFIG) k8s_client: "CoreV1API" = client.CoreV1Api() try: - for service in k8s_client.list_namespaced_service(namespace=settings.K8S_NAMESPACE).items: + for service in k8s_client.list_namespaced_service(namespace=settings.K8S_ONAP_NAMESPACE).items: if service.metadata.name == settings.DCAE_VES_COLLECTOR_POD_NAME: return service.spec.cluster_ip, service.spec.ports[0].port raise EnvironmentPreparationException("Couldn't get VES ip and port") |