From b5d4f83c1f442efa94bcc5d84cec1d9a3aa18529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Ollivier?= Date: Mon, 27 Jan 2025 11:29:04 +0100 Subject: [PATCH] Upgrade cnf_testsuite to latest change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uninstall_all is needed as well as pss support. note: we must keep deleting the namespaces until [1] is fixed [1] https://github.com/cnti-testcatalog/testsuite/issues/2213 Change-Id: Ife81a87d5cc0e7ae432c7397c1125adf595d2fa4 Signed-off-by: Cédric Ollivier (cherry picked from commit d912f5609a0f743f6be2d3c235eb7656f96dc8b4) --- .../cnf_conformance/conformance.py | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/functest_kubernetes/cnf_conformance/conformance.py b/functest_kubernetes/cnf_conformance/conformance.py index 637f666e..b4907fe8 100644 --- a/functest_kubernetes/cnf_conformance/conformance.py +++ b/functest_kubernetes/cnf_conformance/conformance.py @@ -66,26 +66,6 @@ def setup(self): if os.path.exists(os.path.join(self.src_dir, "results")): shutil.rmtree(os.path.join(self.src_dir, "results")) api_response = self.corev1.list_namespace() - for namespace in ["cnf-testsuite", "cnf-default", "litmus"]: - for item in api_response.items: - if item.metadata.name == namespace: - self.corev1.patch_namespace( - namespace, - client.V1Namespace(metadata=client.V1ObjectMeta( - labels={ - "pod-security.kubernetes.io/enforce": - "privileged"}))) - self.__logger.debug( - "patch_namespace: %s", namespace) - break - else: - self.corev1.create_namespace( - client.V1Namespace(metadata=client.V1ObjectMeta( - name=namespace, labels={ - "pod-security.kubernetes.io/enforce": - "privileged"}))) - self.__logger.debug( - "create_namespace: %s", namespace) os.chdir(self.src_dir) cmd = ['cnf-testsuite', 'setup', '-l', 'debug'] try: @@ -166,13 +146,13 @@ def run(self, **kwargs): self.stop_time = time.time() def clean(self): - for clean_cmd in ['cnf_uninstall']: + for clean_cmd in ['cnf_uninstall', 'uninstall_all']: cmd = ['cnf-testsuite', clean_cmd, f'cnf-config={self.cnf_config}'] output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) self.__logger.info("%s\n%s", " ".join(cmd), output.decode("utf-8")) try: - for namespace in ["cnf-testsuite", "cnf-default", "litmus"]: + for namespace in ["cnf-testsuite", "cnf-default"]: self.corev1.delete_namespace(namespace) self.__logger.debug("delete_namespace: %s", namespace) except client.rest.ApiException: