#!/usr/bin/perl -w
-use Test::Command tests => 12;
+use Test::Command tests => 15;
use Test::More;
# ping 127.0.0.1
});
$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});
+}
#!/usr/bin/perl -w
-use Test::Command tests => 27;
+use Test::Command tests => 30;
use Test::More;
# -R random bytes
});
}
+# 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");