Adding travis ci tests for more coverage and rectifying a mistake

pull/138/head
deepak0004 6 years ago
parent b18e930bed
commit 8e33daed93

@ -1,6 +1,6 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
use Test::Command tests => 6; use Test::Command tests => 12;
# -u show targets that are unreachable # -u show targets that are unreachable
# -v show version # -v show version
@ -22,3 +22,19 @@ fping: comments to david\@schweikert\.ch
}); });
$cmd->stderr_is_eq(""); $cmd->stderr_is_eq("");
} }
# fping -x
{
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->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->stdout_is_eq("<2 hosts are reachable\n");
$cmd->stderr_is_eq("");
}

@ -1281,13 +1281,6 @@ void main_loop()
timeval_add(&next_report_time, report_interval); timeval_add(&next_report_time, report_interval);
} }
} }
if (reachable_flag) {
if ((num_hosts-num_unreachable >= reachable)) {
printf(">=%d hosts are reachable\n", reachable);
} else {
printf("<%d hosts are reachable\n", reachable);
}
}
} }
/************************************************************ /************************************************************
@ -1329,6 +1322,14 @@ void finish()
} }
} }
if (reachable_flag) {
if ((num_hosts-num_unreachable >= reachable)) {
printf(">=%d hosts are reachable\n", reachable);
} else {
printf("<%d hosts are reachable\n", reachable);
}
}
if (count_flag || loop_flag) if (count_flag || loop_flag)
print_per_system_stats(); print_per_system_stats();
#if defined(DEBUG) || defined(_DEBUG) #if defined(DEBUG) || defined(_DEBUG)

Loading…
Cancel
Save