aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/onboard/cds.py
diff options
context:
space:
mode:
authorMicha? Jagie??o <michal.jagiello@t-mobile.pl>2023-08-07 13:06:39 +0000
committerGerrit Code Review <gerrit@onap.org>2023-08-07 13:06:39 +0000
commitf79b8e825e0e3cbde157e29a3225f9357e4198bd (patch)
tree72494a6d436ce591b54cf621ccec4c68f8154ed7 /src/onaptests/steps/onboard/cds.py
parentbe6ea937c20fb6ba83d6c7b35f6f5677f9a355cc (diff)
parent4bccbde3060931c8fcf61fbf8b61db4a85b3200e (diff)
Merge "Change cleanup process of tests"
Diffstat (limited to 'src/onaptests/steps/onboard/cds.py')
-rw-r--r--src/onaptests/steps/onboard/cds.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/onaptests/steps/onboard/cds.py b/src/onaptests/steps/onboard/cds.py
index 5256eac..2074296 100644
--- a/src/onaptests/steps/onboard/cds.py
+++ b/src/onaptests/steps/onboard/cds.py
@@ -14,7 +14,6 @@ from onapsdk.configuration import settings
import urllib3
from onaptests.steps.base import BaseStep
-
from onaptests.utils.exceptions import OnapTestException
@@ -30,9 +29,9 @@ class CDSBaseStep(BaseStep, ABC):
class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep):
"""Expose CDS blueprintsprocessor port."""
- def __init__(self, cleanup: bool) -> None:
+ def __init__(self) -> None:
"""Initialize step."""
- super().__init__(cleanup=cleanup)
+ super().__init__(cleanup=settings.CLEANUP_FLAG)
self.service_name: str = "cds-blueprints-processor-http"
if settings.IN_CLUSTER:
config.load_incluster_config()
@@ -92,6 +91,7 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep):
else:
self._logger.debug("Service already patched, skip")
+ @BaseStep.store_state(cleanup=True)
def cleanup(self) -> None:
"""Step cleanup.
@@ -129,15 +129,15 @@ class ExposeCDSBlueprintprocessorNodePortStep(CDSBaseStep):
class BootstrapBlueprintprocessor(CDSBaseStep):
"""Bootstrap blueprintsprocessor."""
- def __init__(self, cleanup: bool = False) -> None:
+ def __init__(self) -> None:
"""Initialize step.
Substeps:
- ExposeCDSBlueprintprocessorNodePortStep.
"""
- super().__init__(cleanup=cleanup)
+ super().__init__(cleanup=BaseStep.HAS_NO_CLEANUP)
if settings.EXPOSE_SERVICES_NODE_PORTS:
- self.add_step(ExposeCDSBlueprintprocessorNodePortStep(cleanup=cleanup))
+ self.add_step(ExposeCDSBlueprintprocessorNodePortStep())
@property
def description(self) -> str:
@@ -154,10 +154,10 @@ class BootstrapBlueprintprocessor(CDSBaseStep):
class DataDictionaryUploadStep(CDSBaseStep):
"""Upload data dictionaries to CDS step."""
- def __init__(self, cleanup: bool = False) -> None:
+ def __init__(self) -> None:
"""Initialize data dictionary upload step."""
- super().__init__(cleanup=cleanup)
- self.add_step(BootstrapBlueprintprocessor(cleanup=cleanup))
+ super().__init__(cleanup=BaseStep.HAS_NO_CLEANUP)
+ self.add_step(BootstrapBlueprintprocessor())
@property
def description(self) -> str:
@@ -180,10 +180,10 @@ class DataDictionaryUploadStep(CDSBaseStep):
class CbaEnrichStep(CDSBaseStep):
"""Enrich CBA file step."""
- def __init__(self, cleanup=False) -> None:
+ def __init__(self) -> None:
"""Initialize CBA enrichment step."""
- super().__init__(cleanup=cleanup)
- self.add_step(DataDictionaryUploadStep(cleanup=cleanup))
+ super().__init__(cleanup=settings.CLEANUP_FLAG)
+ self.add_step(DataDictionaryUploadStep())
@property
def description(self) -> str:
@@ -217,14 +217,14 @@ class CbaEnrichStep(CDSBaseStep):
class CbaPublishStep(CDSBaseStep):
"""Publish CBA file step."""
- def __init__(self, cleanup=False) -> None:
+ def __init__(self) -> None:
"""Initialize CBA publish step."""
- super().__init__(cleanup=cleanup)
+ super().__init__(cleanup=BaseStep.HAS_NO_CLEANUP)
"""Let's skip enrichment if enriched CBA is already present"""
if Path.is_file(settings.CDS_CBA_UNENRICHED):
- self.add_step(CbaEnrichStep(cleanup=cleanup))
+ self.add_step(CbaEnrichStep())
elif settings.EXPOSE_SERVICES_NODE_PORTS:
- self.add_step(ExposeCDSBlueprintprocessorNodePortStep(cleanup=cleanup))
+ self.add_step(ExposeCDSBlueprintprocessorNodePortStep())
@property
def description(self) -> str:
@@ -247,10 +247,10 @@ class CbaPublishStep(CDSBaseStep):
class CbaProcessStep(CDSBaseStep):
"""Process CBA step."""
- def __init__(self, cleanup=False) -> None:
+ def __init__(self) -> None:
"""Initialize CBA process step."""
- super().__init__(cleanup=cleanup)
- self.add_step(CbaPublishStep(cleanup=cleanup))
+ super().__init__(cleanup=BaseStep.HAS_NO_CLEANUP)
+ self.add_step(CbaPublishStep())
@property
def description(self) -> str: