#!/usr/bin/perl -w
-use Test::Command tests => 72;
+use Test::Command tests => 75;
use Test::More;
# -c n count of pings to send to each target (default 1)
$cmd->exit_is_num(0);
$cmd->stdout_like(qr{127\.0\.0\.1 is alive \(\d\.\d+ ms\)
});
+$cmd->stderr_is_eq("");
+}
+# fping -e -a
+{
+my $cmd = Test::Command->new(cmd => "fping -e -a 127.0.0.1");
+$cmd->exit_is_num(0);
+$cmd->stdout_like(qr{127\.0\.0\.1 \(\d\.\d+ ms\)
+});
$cmd->stderr_is_eq("");
}
#!/usr/bin/perl -w
-use Test::Command tests => 45;
+use Test::Command tests => 48;
use Test::More;
# -n show targets by name (-d is equivalent)
$cmd->stderr_is_eq("");
}
+# fping -a -O --print-tos
+{
+my $cmd = Test::Command->new(cmd => "fping -a -O 32 --print-tos 127.0.0.1");
+$cmd->exit_is_num(0);
+$cmd->stdout_like(qr{127\.0\.0\.1 \(TOS \d+\)
+});
+$cmd->stderr_is_eq("");
+}
+
# fping --print-tos
{
my $cmd = Test::Command->new(cmd => "fping --print-tos 127.0.0.1");
if (verbose_flag || alive_flag) {
printf("%s", h->host);
- if (verbose_flag) {
+ if (verbose_flag)
printf(" is alive");
- if(print_tos_flag) {
- if(ip_header_tos != -1) {
- printf(" (TOS %d)", ip_header_tos);
- }
- else {
- printf(" (TOS unknown)");
- }
- }
+
+ if(print_tos_flag) {
+ if(ip_header_tos != -1) {
+ printf(" (TOS %d)", ip_header_tos);
+ }
+ else {
+ printf(" (TOS unknown)");
+ }
}
if (print_ttl_flag) {
fprintf(out, " -v, --version show version\n");
fprintf(out, " -x, --reachable=N shows if >=N hosts are reachable or not\n");
fprintf(out, " -X, --fast-reachable=N exits true immediately when N hosts are found\n");
- fprintf(out, " --print-tos show tos value\n");
+ fprintf(out, " --print-tos show received TOS value\n");
fprintf(out, " --print-ttl show IP TTL value\n");
exit(is_error);
}