aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/onboard/cps.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/onboard/cps.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/onboard/cps.py')
-rw-r--r--src/onaptests/steps/onboard/cps.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/onaptests/steps/onboard/cps.py b/src/onaptests/steps/onboard/cps.py
index f5820c7..04471c2 100644
--- a/src/onaptests/steps/onboard/cps.py
+++ b/src/onaptests/steps/onboard/cps.py
@@ -254,6 +254,8 @@ class CheckPostgressDataBaseConnectionStep(CpsBaseStep):
def __init__(self) -> None:
"""Initialize step."""
super().__init__(cleanup=BaseStep.HAS_NO_CLEANUP)
+ self.login = None
+ self.password = None
@property
def description(self) -> str:
@@ -261,6 +263,8 @@ class CheckPostgressDataBaseConnectionStep(CpsBaseStep):
return "Establish connection with Postgress and execute the query"
def get_database_credentials(self):
+ """Resolve CPS datbase credentials from k8s secret."""
+
if settings.IN_CLUSTER:
config.load_incluster_config()
else:
@@ -286,6 +290,8 @@ class CheckPostgressDataBaseConnectionStep(CpsBaseStep):
raise EnvironmentPreparationException("Error accessing secret") from e
def connect_to_postgress(self):
+ """Connect to CPS database and execute select query."""
+
self.get_database_credentials()
if self.login and self.password:
db_params = {