Skip to content

Commit

Permalink
Upgrade cnf_testsuite to latest change
Browse files Browse the repository at this point in the history
uninstall_all is needed as well as pss support.
note: we must keep deleting the namespaces until [1] is fixed

[1] cnti-testcatalog/testsuite#2213

Change-Id: Ife81a87d5cc0e7ae432c7397c1125adf595d2fa4
Signed-off-by: Cédric Ollivier <[email protected]>
(cherry picked from commit d912f56)
  • Loading branch information
collivier committed Jan 30, 2025
1 parent d0995f1 commit b5d4f83
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions functest_kubernetes/cnf_conformance/conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b5d4f83

Please sign in to comment.