Skip to content

Utils / network: improvements to ping_flood()#6063

Closed
clebergnu wants to merge 5 commits into
avocado-framework:masterfrom
clebergnu:utils_network_interface_flood
Closed

Utils / network: improvements to ping_flood()#6063
clebergnu wants to merge 5 commits into
avocado-framework:masterfrom
clebergnu:utils_network_interface_flood

Conversation

@clebergnu
Copy link
Copy Markdown
Contributor

This contains a number of improvements to the ping_flood() utility.

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
Copy link
Copy Markdown

codecov Bot commented Nov 1, 2024

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 54.52%. Comparing base (6b55d5a) to head (e69d607).
⚠️ Report is 407 commits behind head on master.

Files with missing lines Patch % Lines
avocado/utils/network/interfaces.py 80.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@harvey0100
Copy link
Copy Markdown
Contributor

Closing this PR due to current team constraints following our recent restructuring. This is part of a broader effort to triage all in-flight work across our upstream repos. If this work is still needed, please feel free to reopen and it will be picked up. Apologies for any inconvenience.

@harvey0100 harvey0100 closed this May 25, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Done 114 in Default project May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done 114

Development

Successfully merging this pull request may close these issues.

3 participants