{
my $cmd = Test::Command->new(cmd => "fping -x 1 8.8.0.0 127.0.0.1");
$cmd->exit_is_num(0);
-$cmd->stdout_is_eq(">=1 hosts are reachable\n");
+$cmd->stdout_is_eq("Number of reachable hosts: 1\n");
$cmd->stderr_is_eq("");
}
# fping -x
{
my $cmd = Test::Command->new(cmd => "fping -x 2 8.8.0.0 127.0.0.1");
-$cmd->exit_is_num(0);
+$cmd->exit_is_num(1);
$cmd->stdout_is_eq("<2 hosts are reachable\n");
$cmd->stderr_is_eq("");
}
if (reachable_flag) {
if ((num_hosts-num_unreachable >= reachable)) {
- printf(">=%d hosts are reachable\n", reachable);
+ printf("Number of reachable hosts: %d\n", num_hosts-num_unreachable);
+ exit(0);
} else {
printf("<%d hosts are reachable\n", reachable);
+ exit(1);
}
- exit(0);
}
if (num_noaddress)