Utils / network: improvements to ping_flood()#6063
Draft
clebergnu wants to merge 5 commits intoavocado-framework:masterfrom
Draft
Utils / network: improvements to ping_flood()#6063clebergnu wants to merge 5 commits intoavocado-framework:masterfrom
clebergnu wants to merge 5 commits intoavocado-framework:masterfrom
Conversation
Signed-off-by: Cleber Rosa <crosa@redhat.com>
It's not possible for regular users to flood ping without a interval of less than 2 ms: ping: cannot flood, minimal interval for user must be >= 2 ms, use -i 0.002 (or higher) Given that it's a fact, let's improve the odds of this function behaving well by not causing the ping utility to simply error out in such situations. Signed-off-by: Cleber Rosa <crosa@redhat.com>
The implementation of ping_flood() counts on the output generated by the ping command line utility. But, the way and amount of data it reads looking for the failure pattern is both too small and is susceptible to timing issues. In order to minimize those possibilities, let's send error messages (which will never contain the info this function is looking for) to another file. It also allows to use that as an improvement to the log messages. Signed-off-by: Cleber Rosa <crosa@redhat.com>
The ping_flood() function is a bit delicate, and further improvements are needed. To make sure we introduce improvements and not regressions, let's add some basic functional tests. Signed-off-by: Cleber Rosa <crosa@redhat.com>
…tests We have the name of the suite, so let's give it to users when printing out a possible mismatch. Signed-off-by: Cleber Rosa <crosa@redhat.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6063 +/- ##
==========================================
+ Coverage 54.46% 54.52% +0.06%
==========================================
Files 202 202
Lines 21883 21884 +1
==========================================
+ Hits 11919 11933 +14
+ Misses 9964 9951 -13 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This contains a number of improvements to the
ping_flood()utility.