aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/onboard
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2021-08-25 17:44:25 +0200
committerKrzysztof Opasiak <k.opasiak@samsung.com>2021-08-25 17:46:39 +0200
commit58a82a7e0a5bc010236991061aa959e55672028c (patch)
treeaa647c89633301d1fcbe1a704715d346707e5c77 /src/onaptests/steps/onboard
parent5c91aa8f3286c685a88b03a073865f2e0caf9f2a (diff)
[TEST] Unwind master back to 27.07.2020
Unwind master due to regression in few tests. Issue-ID: OOM-1 Change-Id: I3b759a5928aeb47fc7fddeaa5998aa090d085c5c Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'src/onaptests/steps/onboard')
-rw-r--r--src/onaptests/steps/onboard/cds.py46
-rw-r--r--src/onaptests/steps/onboard/msb_k8s.py16
2 files changed, 14 insertions, 48 deletions
diff --git a/src/onaptests/steps/onboard/cds.py b/src/onaptests/steps/onboard/cds.py
index 7f91d56..cbd69ce 100644
--- a/src/onaptests/steps/onboard/cds.py
+++ b/src/onaptests/steps/onboard/cds.py
@@ -8,7 +8,6 @@ from typing import Any, Dict
from kubernetes import client, config
from kubernetes.client.exceptions import ApiException
from onapsdk.cds import Blueprint, DataDictionarySet
-from onapsdk.cds.blueprint import Workflow
from onapsdk.cds.blueprint_processor import Blueprintprocessor
from onapsdk.configuration import settings
import urllib3
@@ -54,7 +53,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep):
try:
service_data: Dict[str, Any] = self.k8s_client.read_namespaced_service(
self.service_name,
- settings.K8S_ONAP_NAMESPACE
+ settings.K8S_NAMESPACE
)
return service_data.spec.type == "NodePort"
except ApiException:
@@ -67,7 +66,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep):
Use settings values:
- K8S_CONFIG,
- - K8S_ONAP_NAMESPACE.
+ - K8S_NAMESPACE.
"""
super().execute()
@@ -75,7 +74,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep):
try:
self.k8s_client.patch_namespaced_service(
self.service_name,
- settings.K8S_ONAP_NAMESPACE,
+ settings.K8S_NAMESPACE,
{"spec": {"ports": [{"port": 8080, "nodePort": 30449}], "type": "NodePort"}}
)
except ApiException:
@@ -97,7 +96,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep):
try:
self.k8s_client.patch_namespaced_service(
self.service_name,
- settings.K8S_ONAP_NAMESPACE,
+ settings.K8S_NAMESPACE,
[
{
"op": "remove",
@@ -223,45 +222,12 @@ class CbaPublishStep(CDSBaseStep):
@BaseStep.store_state
def execute(self) -> None:
- """Publish CBA file.
+ """Enrich CBA file.
Use settings values:
- - CDS_CBA_ENRICHED.
+ - CDS_DD_FILE.
"""
super().execute()
blueprint: Blueprint = Blueprint.load_from_file(settings.CDS_CBA_ENRICHED)
blueprint.publish()
-
-
-class CbaProcessStep(CDSBaseStep):
- """Process CBA step."""
-
- def __init__(self, cleanup=False) -> None:
- """Initialize CBA process step."""
- super().__init__(cleanup=cleanup)
- self.add_step(CbaPublishStep(cleanup=cleanup))
-
- @property
- def description(self) -> str:
- """Step description."""
- return "Process CBA file."
-
- @BaseStep.store_state
- def execute(self) -> None:
- """Process CBA file.
-
- Check if output is equal to expected
-
- Use settings values:
- - CDS_CBA_ENRICHED,
- - CDS_WORKFLOW_NAME,
- - CDS_WORKFLOW_INPUT
-
- """
- super().execute()
- blueprint: Blueprint = Blueprint.load_from_file(settings.CDS_CBA_ENRICHED)
- workflow: Workflow = blueprint.get_workflow_by_name(settings.CDS_WORKFLOW_NAME)
- output: Dict[str, Any] = workflow.execute(settings.CDS_WORKFLOW_INPUT)
- if not output == settings.CDS_WORKFLOW_EXPECTED_OUTPUT:
- raise OnapTestException("Response is not equal to the expected one")
diff --git a/src/onaptests/steps/onboard/msb_k8s.py b/src/onaptests/steps/onboard/msb_k8s.py
index 503a886..cad471b 100644
--- a/src/onaptests/steps/onboard/msb_k8s.py
+++ b/src/onaptests/steps/onboard/msb_k8s.py
@@ -36,9 +36,9 @@ class CreateDefinitionStep(BaseStep):
def execute(self) -> None:
"""Create definition."""
super().execute()
- with open(settings.MSB_K8S_DEFINITION_ATRIFACT_FILE_PATH, "rb") as definition_file:
- self.definition = Definition.create(rb_name=settings.MSB_K8S_RB_NAME,
- rb_version=settings.MSB_K8S_RB_VERSION)
+ with open(settings.PNF_DEFINITION_ATRIFACT_FILE_PATH, "rb") as definition_file:
+ self.definition = Definition.create(rb_name=settings.PNF_RB_NAME,
+ rb_version=settings.PNF_RB_VERSION)
self.definition.upload_artifact(definition_file.read())
@@ -70,10 +70,10 @@ class CreateProfileStep(BaseStep):
"""Create profile."""
super().execute()
definition: Definition = Definition.get_definition_by_name_version(\
- rb_name=settings.MSB_K8S_RB_NAME,
- 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_ADDITIONAL_RESOURCES_NAMESPACE,
+ rb_name=settings.PNF_RB_NAME,
+ rb_version=settings.PNF_RB_VERSION)
+ with open(settings.PNF_PROFILE_ARTIFACT_FILE_PATH, "rb") as profile_file:
+ self.profile = definition.create_profile(profile_name=settings.PNF_PROFILE_NAME,
+ namespace=settings.K8S_NAMESPACE,
kubernetes_version=settings.K8S_VERSION)
self.profile.upload_artifact(profile_file.read())