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: I65cd11bf02d8df049f964809eee1d51715e75473
Signed-off-by: Cédric Ollivier <[email protected]>
(cherry picked from commit d912f56)
  • Loading branch information
collivier committed Jan 27, 2025
1 parent 9e925d9 commit 3250499
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docker/cnf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM opnfv/functest-kubernetes-core:v1.29

ARG K8S_TAG=1.29
ARG CNF_TESTSUITE_TAG=v1.4.0
ARG CNF_TESTSUITE_TAG=4bf8e73992eee555cb0b56f88729de9369d64064
ARG HELM_TAG=v3.6.0

USER root
Expand Down
24 changes: 2 additions & 22 deletions functest_kubernetes/cnf_conformance/conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,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 @@ -155,13 +135,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,
'cnf-config=cnf-testsuite.yml']
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 3250499

Please sign in to comment.