diff --git a/ci/test-9-option-r-t.pl b/ci/test-9-option-r-t.pl new file mode 100755 index 0000000..3b30d1f --- /dev/null +++ b/ci/test-9-option-r-t.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl -w + +use Test::Command tests => 6; +use Test::More; +use Time::HiRes qw(gettimeofday tv_interval); +use File::Temp; + +# -r n number of retries (default 3) +# -s print final stats +# -S addr set source address +# -t n individual target initial timeout (in millisec) (default 500) +# -T n ignored (for compatibility with fping 2.4) + +# fping -r tested in test-4-options-a-b.pl + +# fping -s +{ +my $cmd = Test::Command->new(cmd => "fping -s 127.0.0.1"); +$cmd->exit_is_num(0); +$cmd->stdout_is_eq("127.0.0.1 is alive\n"); +$cmd->stderr_like(qr{\s* +\s*1 targets +\s*1 alive +\s*0 unreachable +\s*0 unknown addresses +\s* +\s*0 timeouts \(waiting for response\) +\s*1 ICMP Echos sent +\s*1 ICMP Echo Replies received +\s*0 other ICMP received + +\s*0.\d+ ms \(min round trip time\) +\s*0.\d+ ms \(avg round trip time\) +\s*0.\d+ ms \(max round trip time\) +\s*0.\d+ sec \(elapsed real time\) +}); +} + +# fping -S +{ +my $cmd = Test::Command->new(cmd => "fping -S 127.0.0.1 127.0.0.1"); +$cmd->exit_is_num(0); +$cmd->stdout_is_eq("127.0.0.1 is alive\n"); +$cmd->stderr_is_eq(""); +} + + +# fping -t tested in test-4-options-a-b.pl diff --git a/doc/fping.pod b/doc/fping.pod index e3296f9..4a6f4ca 100644 --- a/doc/fping.pod +++ b/doc/fping.pod @@ -49,10 +49,11 @@ number. =item B<-B> I -In the default mode, B sends several requests to a target before giving -up, waiting longer for a reply on each successive request. This parameter is -the value by which the wait time is multiplied on each successive request; it -must be entered as a floating-point number (x.y). The default is 1.5. +Backoff factor. In the default mode, B sends several requests to a +target before giving up, waiting longer for a reply on each successive request. +This parameter is the value by which the wait time is multiplied on each +successive request; it must be entered as a floating-point number (x.y). The +default is 1.5. =item B<-c> I