Skip to content

Commit 27ae281

Browse files
committed
extending prepare part
Signed-off-by: Katharina Trentau <katharina.trentau@cloudandheat.com>
1 parent 816dc87 commit 27ae281

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Tests/kaas/k8s-default-storage-class/k8s-default-storage-class-check.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def check_default_persistentvolumeclaim_readwriteonce(k8s_api_instance):
156156
"""
157157
3. Check if PV got succesfully created using ReadWriteOnce
158158
"""
159-
160159
# 3. Check if PV got succesfully created using ReadWriteOnce
161160
logger.debug("check if the created PV supports ReadWriteOnce")
162161

@@ -192,13 +191,12 @@ def __init__(self, k8s_api_instance):
192191
self.pvc_name = PVC_NAME
193192
self.k8s_api_instance = k8s_api_instance
194193
self.return_code = None
195-
self.return_message = "return message"
194+
self.return_message = "return_message: FAILED"
196195

197196

198197
def prepare(self, k8s_api_instance):
199198
print("prepare")
200199
try:
201-
# Get the list of PVCs in the namespace and filter by name
202200
pvc_list = k8s_api_instance.list_namespaced_persistent_volume_claim(namespace=self.namespace)
203201
for pvc in pvc_list.items:
204202
if pvc.metadata.name == self.pvc_name:
@@ -239,11 +237,11 @@ def __enter__(self):
239237

240238
def __exit__(self, exc_type, exc_value, traceback):
241239
self.clean()
242-
logger.debug(f"return_code:{self.return_code}")
243-
244240
if self.return_code == 0:
245241
self.return_message = "all tests passed"
246242

243+
logger.debug(f"return_code:{self.return_code} {self.return_message}")
244+
247245
gen_sonobuoy_result_file(self.return_code, self.return_message, os.path.basename(__file__))
248246
print(f"Exiting the context {self.k8s_api_instance}")
249247
if exc_type:

0 commit comments

Comments
 (0)