Commit Graph

696 Commits (65f00ff013cc66309c5c8b70cd30c71c3b692436)
 

Author SHA1 Message Date
Erik Auerswald 65f00ff013 ci: test timestamp plausibility
Some changes of fping resulted in some systems reporting
implausible timestamps, see, e.g., GH issue #203.  This
commit adds a simplistic plausability check for timestamps
in Unix time format: they need to be greater or equal to
1000000000 (2001-09-09 03:46:40+02:00).
4 months ago
Erik Auerswald a333f95c9d ci: test empty string argument instead of number
Giving an empty string instead of a number as option argument
was not reliably caught, see GH issue #324 and GH PR #323.
4 months ago
German Service Network 94de79153f Fix incorrect return-value check for a scanf like function 4 months ago
German Service Network 118cdc5cc6 configure.ac check required function strftime 5 months ago
German Service Network b39f5a5cef Extended dokumentation for parameter timestamp-format 5 months ago
German Service Network aa724910b8 Test 05 for --timestamp-format extended 5 months ago
German Service Network 85b92d3d21 New parameter timestamp-format for changing the timestamp output 5 months ago
German Service Network 652d319803 Handling optparse long option 5 months ago
German Service Network 2f2ff0bd2c Change to codeql-action-v2 5 months ago
German Service Network 46793cdf80 Debug with Visual Studio Code 5 months ago
Erik Auerswald 97b7484350 test error when binding to wrong local address
Test "fping -S" with both IPv4 and IPv6 addresses not configured
on local interfaces using addresses reserved for documentation.
Check the fping error message, but accept any system generated
additional information.  This additional information differs
between operation systems.
5 months ago
Erik Auerswald 79e274d4b8 test help output during normal option parsing
The existing test for "fping -h" triggers the special code path
for only one option, either -h or --help, that is handled before
normal option parsing.
5 months ago
Erik Auerswald 90ad83fbd0 Print cumulative stats with -Q SECS,cumulative
With -Q SECS, fping emits information for the just finished
interval.  This is good for long-running fping processes where
one would like to get an update on recent results, ignoring
missing responses from older intervals.  This seems appropriate
for use with other software like netdata or smokeping.

But for short(er)-running fping processes, e.g., during a change
window, it may be more interesting to get a status update since
the beginning of the change window, i.e., the start of fping.
Adding a comma followed by the keyword "cumulative" to -Q SECS
(i.e., -Q SECS,cumulative) changes the interim reports to output
the current per system overall statistics, unless -N is used, too.

The new syntax is documented in fping.pod and added to fping -h
output.

Four tests are added:

  1. Characters after SECS are ignored as before.
  2. Unknown keywords are ignored as before.
  2. Adding ",cumulative" changes -Q output.
  3. Adding ",cumulative" also affects the additional -o output.

This addresses issue #243.
6 months ago
dwes 0d08321346 Prepare v5.2 release. 7 months ago
German Service Network bd44c9f016 Removes the unnecessary file 18 7 months ago
German Service Network f71e40ab60 Extended configure.ac with --enable-debug and create debug output cpu time use 7 months ago
German Service Network 5a2a23d2af Update Azure Pipline add macOS pipline job 7 months ago
German Service Network 47c0c3d8de Update Azure Pipline linux test based on github pipline with matching exclude 7 months ago
David Schweikert ab05279782 Fix number of tests 7 months ago
David Schweikert d6d9c653eb Remove flaky test for now.
Remove the 'fping -X 2 --generate 8.8.0.0/29' test, because it
is currently failing on the MacOS runner. Also, I am not sure that
it is a good idea to ping the IPs 8.8.0.1 and 8.8.0.2 and rely on
them being up.
7 months ago
German Service Network 94e98acaaa Check if the variable next_value->ping_ts != 0 in seqmap_add() 7 months ago
Erik Auerswald c3a2f2c7cc always output error message in crash_and_burn()
This aligns crash_and_burn() with errno_crash_and_burn()
and addresses issue #300.
9 months ago
Erik Auerswald 4151976986 improve help output for options -c and -C 9 months ago
Erik Auerswald 266eb16568 use function stats_reset_interval()
Git commit bb8d71ef27 from 2020 among many
other things introduced the function stats_reset_interval() to reset the
*_i interval (or split) host statistics, but did not use it.  This commit
replaces the open coded reset of interval stats inside print_host_splits()
and print_netdata() with calling stats_reset_interval().
9 months ago
Erik Auerswald c138b08141 typo fixes pertaining to ICMP for IPv6 sockets
As mentioned in issue #300, error messages pertaining to
socket creation may not be printed.  But they should be
corrected anyway, just as the comments.  Having correct
error messages also makes a fix for issue #300 more
obvious, because the messages itself would not change.
9 months ago
Erik Auerswald ae0bc23804 Document that -c N overrides -a or -u 9 months ago
Erik Auerswald 1443614dad Decouple -a/-u effects from -c
As described in issue #295, the option combinations "-c N -u"
and "-c N -a" inadvertently have the same effect as "-c N -q".
Prevent this by first acting on -c, which includes disabling
either -a or -u, if -c is given, before acting on -a/-u.
9 months ago
Erik Auerswald c122186f70 Move description of -i MSEC to probing options
The -i MSEC, --interval=MSEC option does not directly affect
the output format, but rather the probe generation, i.e., the
minimum time between probes.  Thus it is more fitting to list
it under "probing options" than under "output options".
9 months ago
Erik Auerswald d312a278d5 Test ping to "all IPv6 nodes" multicast address
Any Echo Response packet uses a different source address than
used for the target, because it is not allowed to use a multicast
address as source.  This results in extra output in a specific
format on standard error.

This should work, because IPv6 requires multicast support, and
every IPv6 node is supposed to join the "all nodes" multicast
group, including the node the test runs on.  It at least works
on my Ubuntu 20.04 LTS system.
9 months ago
Erik Auerswald ef74f642d1 Test edge cases of -f and -g
* -f with non-existing file
* -f with input file containing comment and empty line
* -g with non-numeric address in "CIDR" format
* -g with one non-numeric address in start resp. end position
* -g with one IPv6 address in start resp. end position
9 months ago
Erik Auerswald 32b9a55a98 Test -l together with -Q or -t 9 months ago
Erik Auerswald dcda0cc595 Test that -x, -X, -k require numeric argument 9 months ago
Erik Auerswald c5428391a6 Test that negative numbers are not accepted 9 months ago
Erik Auerswald 8ae2babae0 Fix a comment describing a test 9 months ago
Erik Auerswald 290d944b56 Defensive coding: guard against a division by zero
In the function print_per_system_stats(), if packets have been
lost, the number of sent packets is checked to be positive before
dividing by it.  If no packets have been lost, this is not checked.
Either the existing check is not needed, or both code paths need
the check.

The function print_per_system_splits() is quite similar to
print_per_system_stats(), and has the equivalent guards against a
division by zero in both code paths, not just one of them.

In the spirit of defensive coding, I think it is better to be safe
and add the missing guard against a division by zero.
9 months ago
Erik Auerswald e4bae43d66 Update exit status description in man page
With the options -x and -X, fping does not require all hosts to
be reachable for an exit status of 0.

This addresses a comment in issue #99 suggesting such a man page
update.
9 months ago
Erik Auerswald 2a609b856d Test examples from man page
The man page gives two examples combining -C and -q, but
these combinations are not yet tested.  Add tests to help
ensure the documented examples continue to work.
10 months ago
Erik Auerswald 3a527fbc86 Add test for option combination -Q SECS -o
The -o option adds outage duration to the periodic reports.
Each report shows the outage since the last report, not since
the beginning.
10 months ago
Erik Auerswald 4753437b17 Add longer test for -Q SECS
The statistics printed every SECS seconds show the results
since the the last report, not since the beginning.  Also,
every report starts with a timestamp.
10 months ago
Erik Auerswald ccc0cdfdd7 Test that -g does not accept IPv6 10 months ago
Erik Auerswald 2fa4f61079 Test edge case behavior of "fping -g"
* wrong number or kind of arguments fails and prints usage;
* an empty range silently pings nothing and fping returns 1;
* a too large range fails with an error message;
* a zero CIDR prefix length fails with an error message.
10 months ago
deepkv c8e9632150 Add --fwmark/-k option for Linux 10 months ago
German Service Network a3f4c573bf Change obsolete macro from AC_CANONICAL_SYSTEM to AC_CANONICAL_TARGET 1 year ago
German Service Network 7351afdd89 Move the OS detection to configure.ac script to set the use of clock_realtime 1 year ago
German Service Network 163fcdb1ed Fix deprected github action ubuntu-18.04 to ubuntu-22.04 1 year ago
German Service Network b8e413f5ba Checking obsolete macro AC_PROG_CC_STDC as of autoconf-2.70 1 year ago
German Service Network 88091f7c94 Checking obsolete macro AC_GNU_SOURCE as of autoconf-2.62 1 year ago
darless 8601d1ba70 Remove dockerfile from root 1 year ago
darless1 e20939ebfe Move to contrib folder 1 year ago
darless1 55ad83898f Dockerfile for fping 1 year ago