cnti-testcatalog / testsuite

📞📱☎️📡🌐 Cloud Native Telecom Initiative (CNTI) Test Catalog is a tool to check for and provide feedback on the use of K8s + cloud native best practices in networking applications and platforms
https://wiki.lfnetworking.org/display/LN/Test+Catalog
Apache License 2.0
173 stars 71 forks source link

[BUG] cnf_setup fails with a stacktrace when a Kubernetes cluster is not configured #985

Closed HashNuke closed 2 months ago

HashNuke commented 3 years ago

Describe the bug

When cnf_setup is run without a Kubernetes cluster configured, then the cnf_setup command results in a crash and displays the stacktrace.

image

To Reproduce

unset KUBECONFIG
 ./cnf-testsuite cnf_setup cnf-config=./sample-cnfs/sample_nonroot/cnf-testsuite.yml

Expected behavior

Should display an error that a Kubernetes server is not accessible.

lixuna commented 7 months ago

hi @HashNuke is this issue still relevant for cnti?

HashNuke commented 7 months ago

Confirmed. This issue still exists. Screenshot below. Tagging for contributors.

CleanShot 2024-03-04 at 18 29 15@2x

barmull commented 5 months ago

I added method ensure_kubeconfig! into the create_namespace task. Also added one condition into this method, when the KUBECONFIG is unset and default path to config file does not exist, it raises the error. It looks like this: image

Also I write improvement ticket ( https://github.com/cnti-testcatalog/testsuite/issues/1968 ). There is 1 case when the test passes, but the k8s cluster is not up and running. Case occurs when KUBECONFIG is set successfully, indicating that the path to config file exists, but the file itself is empty or contains some faults, resulting k8s cluster is not running. So KUBECONFIG variable is set (the test passes), but the cluster is not running.

lixuna commented 4 months ago

ready for peer review, @taylor @HashNuke @agentpoyo