diff --git a/ci/test-01-basics.pl b/ci/test-01-basics.pl index 309728c..e54bc22 100755 --- a/ci/test-01-basics.pl +++ b/ci/test-01-basics.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::Command tests => 12; +use Test::Command tests => 15; use Test::More; # ping 127.0.0.1 @@ -45,3 +45,11 @@ }); $cmd->stderr_like(qr{127\.0\.0\.1 : \d\.\d+ \d\.\d+ \d\.\d+\n}); } + +# invalid target name +{ + my $cmd = Test::Command->new(cmd => "fping host.name.invalid"); + $cmd->exit_is_num(2); + $cmd->stdout_is_eq(""); + $cmd->stderr_like(qr{host\.name\.invalid: .+\n}); +} diff --git a/ci/test-09-option-r-t.pl b/ci/test-09-option-r-t.pl index 5cede8d..2c26d24 100755 --- a/ci/test-09-option-r-t.pl +++ b/ci/test-09-option-r-t.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::Command tests => 27; +use Test::Command tests => 30; use Test::More; # -R random bytes @@ -76,6 +76,30 @@ }); } +# fping -s (both valid and invalid host name) +{ +my $cmd = Test::Command->new(cmd => "fping -s 127.0.0.1 host.name.invalid"); +$cmd->exit_is_num(2); +$cmd->stdout_is_eq("127.0.0.1 is alive\n"); +$cmd->stderr_like(qr{host\.name\.invalid: .+ +\s* +\s*1 targets +\s*1 alive +\s*0 unreachable +\s*1 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*\d\.\d+ ms \(min round trip time\) +\s*\d\.\d+ ms \(avg round trip time\) +\s*\d\.\d+ ms \(max round trip time\) +\s*\d\.\d+ sec \(elapsed real time\) +}); +} + # fping -S { my $cmd = Test::Command->new(cmd => "fping -S 127.0.0.1 127.0.0.1");