Add test_k8s_dashboard test
Add 'cluster role binding' api wrapper
Add method in TestMCPK8sActions to read testdata yamls
Change-Id: I7b9f7a74ce74ea5e722cb4c958bd60b6a64b6a0c
Related-PROD: PROD-22249
diff --git a/tcp_tests/managers/k8s/serviceaccounts.py b/tcp_tests/managers/k8s/serviceaccounts.py
index 3b779eb..bc0db30 100644
--- a/tcp_tests/managers/k8s/serviceaccounts.py
+++ b/tcp_tests/managers/k8s/serviceaccounts.py
@@ -14,6 +14,8 @@
from kubernetes import client
+from devops.helpers import helpers
+
from tcp_tests.managers.k8s.base import K8sBaseResource
from tcp_tests.managers.k8s.base import K8sBaseManager
@@ -41,6 +43,13 @@
self._manager.api.delete_namespaced_service_account(
self.name, self.namespace, client.V1DeleteOptions(), **kwargs)
+ def wait_secret_generation(self, timeout=90, interval=2):
+ def is_secret_generated():
+ secrets = self.read().secrets
+ return secrets is not None and len(secrets) > 0
+ helpers.wait(lambda: is_secret_generated(),
+ timeout=timeout, interval=interval)
+
class K8sServiceAccountManager(K8sBaseManager):
resource_class = K8sServiceAccount