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.
#!/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
});
}
+# 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");