Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The single process type check is skipped if the AUT is deployed in a non-default namespace #2030

Closed
sysarch-repo opened this issue May 16, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@sysarch-repo
Copy link

sysarch-repo commented May 16, 2024

Describe the bug
The single process type check is skipped if the AUT is deployed in a non-default namespace.
Some kubectl commands triggered during the check do not observe the namespace, i.e. the -n part is missing.
Example for a deployment with two pods - drouter (statefulSet) and dserver (deployment):

I, [2024-05-15 21:12:33 +00:00 #157756]  INFO -- cnf-testsuite: KubectlClient::Get.resource command: kubectl get Deployment dns-dserver -o json
D, [2024-05-15 21:12:34 +00:00 #157756] DEBUG -- cnf-testsuite: KubectlClient::Get.resource output:
I, [2024-05-15 21:12:34 +00:00 #157756]  INFO -- cnf-testsuite: KubectlClient::Get.resource stderr: Error from server (NotFound): deployments.apps "dns-dserver" not found

I, [2024-05-15 21:12:42 +00:00 #157756]  INFO -- cnf-testsuite: KubectlClient::Get.resource command: kubectl get StatefulSet dns-drouter -o json
D, [2024-05-15 21:12:43 +00:00 #157756] DEBUG -- cnf-testsuite: KubectlClient::Get.resource output:
I, [2024-05-15 21:12:43 +00:00 #157756]  INFO -- cnf-testsuite: KubectlClient::Get.resource stderr: Error from server (NotFound): statefulsets.apps "dns-drouter" not found

To Reproduce
Steps to reproduce the behavior:

$ cnf-testsuite version
CNF TestSuite version: v1.2.0

  1. Run the test with helm_install_namespace set to a non-default namespace, e.g. helm_install_namespace: cnti
  2. Observe the result:
    🎬 Testing: [single_process_type]
    ⏭️ 🏆SKIPPED: [single_process_type] Container resources not checked ⚖👀

Expected behavior
The check is executed and either succeeds or fails.

Device (please complete the following information):
Linux ip-10-0-33-150 6.5.0-1020-aws #20~22.04.1-Ubuntu SMP Wed May 1 16:10:50 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

How will this be tested? aka Acceptance Criteria (optional)

Additional context
Note the check conflicts with the specialized init system check. Example with dumb-init:
🎬 Testing: [single_process_type]
resource: {kind: "StatefulSet", name: "dns-drouter", namespace: "default"}, pod dns-drouter-0 and container: drouter has more than one process type (/usr/local/bin/dumb-init--/usr/local/bin/dns-app, /usr/local/bin/dns-app)
✖️ 🏆FAILED: [single_process_type] More than one process type used ⚖👀

Maybe the single process type should be tolerant to init subsystems (just as a suggestion)

@sysarch-repo sysarch-repo added the bug Something isn't working label May 16, 2024
@taylor
Copy link
Collaborator

taylor commented May 16, 2024

This will probably need to be addressed for all of the specialized init systems. We still want to check for multiple process types when those systems are used, but the init-related process (eg. /usr/local/bin/dumb-init--/usr/local/bin/dns-app) should not be treated as an additional process type causing a failure.

@taylor
Copy link
Collaborator

taylor commented May 16, 2024

@sysarch-repo
Copy link
Author

@taylor , thanks for your comments. I have probably confused you with providing the additional context (single_process_type check fails if init system is used) that is unrelated to the issue reported. Sorry for that.

The issue concerned in this ticket is that the single_process_type check is skipped if the AUT is deployed in a non-default namespace. Some kubectl commands utilized by the test do not use the -n parameter that needs to be added. Thoughts?

@martin-mat
Copy link
Collaborator

@sysarch-repo nice catch.

@martin-mat martin-mat self-assigned this May 17, 2024
martin-mat added a commit to martin-mat/cnf-testsuite that referenced this issue May 17, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: cnti-testcatalog#2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
taylor pushed a commit that referenced this issue Jun 1, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: #2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit to martin-mat/cnf-testsuite that referenced this issue Jun 3, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: cnti-testcatalog#2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit that referenced this issue Jun 3, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: #2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit that referenced this issue Jun 3, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: #2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit that referenced this issue Jun 3, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: #2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit that referenced this issue Jun 4, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: #2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit that referenced this issue Jun 4, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: #2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit to martin-mat/cnf-testsuite that referenced this issue Jun 6, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: cnti-testcatalog#2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit that referenced this issue Jun 6, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: #2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
martin-mat added a commit that referenced this issue Jun 6, 2024
The namespace is needed to be passed as a parameter
when calling pods_by_resource of kubectl client.
Impacted tests: single_process_type, prometheus_traffic
Also adding non-default namespace to respective spec tests.

Refs: #2030

Signed-off-by: Martin Matyas <martin.matyas@tietoevry.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants