From: Erik Auerswald Date: Sun, 28 Jul 2024 18:36:01 +0000 (+0200) Subject: basic test for -d, --rdns X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43a99b8c7da2da3e205cc284ff06e63e296cbfcc;p=fping.git basic test for -d, --rdns 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. --- diff --git a/ci/test-05-options-c-e.pl b/ci/test-05-options-c-e.pl index 73b04ed..7d90505 100755 --- a/ci/test-05-options-c-e.pl +++ b/ci/test-05-options-c-e.pl @@ -1,11 +1,12 @@ #!/usr/bin/perl -w -use Test::Command tests => 69; +use Test::Command tests => 72; use Test::More; # -c n count of pings to send to each target (default 1) # -C n same as -c, report results in verbose format # --check-source discard replies not from target address +# -d reverse name lookup # -D print timestamp before each output line # -e show elapsed time on return packets @@ -202,6 +203,14 @@ ff02::1 : - }); } +# fping -d +{ +my $cmd = Test::Command->new(cmd => "fping -d 127.0.0.1"); +$cmd->exit_is_num(0); +$cmd->stdout_is_eq("localhost is alive\n"); +$cmd->stderr_is_eq(""); +} + # fping -D { my $cmd = Test::Command->new(cmd => "fping -D -c 2 -p 100 127.0.0.1");