Skip to content

Conversation

@clebergnu
Copy link
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

codecov bot commented Nov 1, 2024

Codecov Report

Attention: 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 37 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants