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

Another batch of additional tests (take 2) #341

Merged
merged 7 commits into from
Aug 1, 2024

Conversation

auerswal
Copy link
Collaborator

  • fix test of unprivileged use
  • test --print-tos output with IPv4 datagram socket
  • test --print-tos output with IPv6
  • test --print-tos output without -O
  • test -c and -C with reply source address different from target address (using ff02::1)
  • test -d a little, since it may be mostly equivalent to -n, but still uses different code paths
  • test error message and statistics output when name resolution does not provide an IP address

This has been tested on GNU/Linux. I do not know if it also works on macOS.
Added skipping of two IPv6 tests when IPv6 is not available.

The current code can only read the TOS byte when using a raw
socket.  It prints '(TOS unknown)' when a datagram socket is
used.
Printing the TOS byte of the received Echo response does not
require setting a non-default TOS byte value in the Echo request.
Currently, --print-tos only works with IPv4.  In contrast
to IPv4, IPv6 raw sockets do not provide access to the
raw IP packet.  Thus the method used to access the TOS
byte value of an IPv4 packet does not work for the TC byte
value of an IPv6 packet.  This results in always generating
'(TOS unknown)' for IPv6 targets.
The tests for --check-source verify that Echo reply packets
from a source IP that was not used as the target of the Echo
request are not accepted.  It does so for default fping, for
use with -c, and for use with -C.  Test if the source address
is really printed without --check-source, but with -c or -C.
Usually, -d gives the same result as -n.  Test this.

When the target is a name that resolves to an IP, but the IP
does not resolve to the same name or any name at all, the
output differs.  This is harder to test, because this is
usually seen as a misconfiguration, so leave this out for now.
The top level domain '.invalid' is reserved for such tests.
@coveralls
Copy link

Coverage Status

coverage: 87.085% (+1.6%) from 85.512%
when pulling 17359d9 on auerswal:more_tests_08
into 04950d2 on schweikert:develop.

@schweikert
Copy link
Owner

That's great, thank you!

@schweikert schweikert merged commit fc2fcb3 into schweikert:develop Aug 1, 2024
9 checks passed
@auerswal auerswal deleted the more_tests_08 branch August 4, 2024 15:26
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.

3 participants