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

Simplify executing generic checks as part of the connectivity suite #2250

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

giorio94
Copy link
Member

When developing new connectivity tests, we may be interested in creating an action also in case we are not strictly running a connectivity check, but for instance checking for error logs or similar (to benefit from better progress and error reporting). Let's introduce a NewGenericAction method for such use-cases, as well as the possibility of tuning the sysdump collection policy, as it may be superfluous to collect one sysdump for each failure.

Please review commit by commit, and refer to the commit messages for additional details.

We may be interested in creating an action also in case we are not
strictly running a connectivity check, but for instance checking for
error logs or similar (to benefit from progress and error reporting).

Yet, in these cases, we don't strictly have a source pod and
destination peer, and it doesn't make sense to attempt capturing
hubble flows. Hence, let's slightly adapt the Run method to skip this
step when the source pod is nil (as it would also otherwise cause a
panic).

Additionally, let's also not attempt to print the hubble flows if their
collection hasn't even been performed, as potentially misleading.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
NewGenericAction mimics the behavior of the already existing NewAction
method, but is intended to be used for assertions that are not strictly
connectivity checks (e.g., asserting the absence of log errors over
multiple pods), hence not associated with any execution pod nor network
target). Yet, it still provides improved progress and error reporting
compared to just a bare scenario.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
By default, when the connectivity tests suite is run with the
--collect-sysdump-on-failure flag, one sysdump is collected for every
failing action. Yet, for certain tests this is superfluous, as
subsequent ones would not contain any additional information. One
example is represented by asserting the absence of log errors over
multiple pods, as introducing no state change by itself.

Hence, let's provide the possibility of selectively customizing the
sysdump collection policy on a per test basis. In addition to the
default policy (i.e., one sysdump per failure), it is possible to
request capturing only one sysdump for the given test, regardless
of the number of failures, or disable sysdump collection altogether
for the given test. The sysdump policy applies only when sysdumps
have been requested by the user through the above mentioned flag,
otherwise they are never collected.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
@tklauser tklauser merged commit fb9c426 into cilium:main Jan 24, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants