--- /dev/null
+#!/usr/bin/perl -w
+
+use Test::Command tests => 6;
+
+# -u show targets that are unreachable
+# -v show version
+
+# fping -u
+{
+my $cmd = Test::Command->new(cmd => "fping -r0 -u 8.8.0.0 127.0.0.1");
+$cmd->exit_is_num(1);
+$cmd->stdout_is_eq("8.8.0.0\n");
+$cmd->stderr_is_eq("");
+}
+
+# fping -v
+{
+my $cmd = Test::Command->new(cmd => "fping -v");
+$cmd->exit_is_num(0);
+$cmd->stdout_like(qr{ping: Version 3\.\d+
+fping: comments to david\@schweikert\.ch
+});
+$cmd->stderr_is_eq("");
+}
-l loop sending pings forever
-m ping multiple interfaces on target host
-n show targets by name (-d is equivalent)
+ -O n set the type of service (tos) flag on the ICMP packets
-p n interval between ping packets to one target (in millisec)
(in looping and counting modes, default 1000)
-q quiet (don't show per-target/per-ping results)
-t n individual target initial timeout (in millisec) (default 500)
-T n ignored (for compatibility with fping 2.4)
-u show targets that are unreachable
- -O n set the type of service (tos) flag on the ICMP packets
-v show version
targets list of targets to check (if no -f specified)
#!/usr/bin/perl -w
use Test::Command tests => 12;
-use Test::More;
-use Time::HiRes qw(gettimeofday tv_interval);
# -c n count of pings to send to each target (default 1)
# -C n same as -c, report results in verbose format
#!/usr/bin/perl -w
use Test::Command tests => 15;
-use Test::More;
-use Time::HiRes qw(gettimeofday tv_interval);
use File::Temp;
# -f file read list of targets from a file ( - means stdin) (only if no -g specified)
#!/usr/bin/perl -w
use Test::Command tests => 7;
-use Test::More;
-use Time::HiRes qw(gettimeofday tv_interval);
-use File::Temp;
# -i n interval between sending ping packets (in millisec) (default 25)
# -l loop sending pings forever
#!/usr/bin/perl -w
-use Test::Command tests => 9;
-use Test::More;
-use Time::HiRes qw(gettimeofday tv_interval);
-use File::Temp;
+use Test::Command tests => 12;
# -n show targets by name (-d is equivalent)
+# -O n set the type of service (tos) flag on the ICMP packets
# -p n interval between ping packets to one target (in millisec)
# (in looping and counting modes, default 1000)
# -q quiet (don't show per-target/per-ping results)
$cmd->stderr_is_eq("");
}
+# fping -O
+{
+my $cmd = Test::Command->new(cmd => "fping -O 2 127.0.0.1");
+$cmd->exit_is_num(0);
+$cmd->stdout_is_eq("127.0.0.1 is alive\n");
+$cmd->stderr_is_eq("");
+}
+
# fping -q
{
my $cmd = Test::Command->new(cmd => "fping -q -p 100 -c 3 127.0.0.1");
#!/usr/bin/perl -w
use Test::Command tests => 6;
-use Test::More;
-use Time::HiRes qw(gettimeofday tv_interval);
-use File::Temp;
# -r n number of retries (default 3)
# -s print final stats
fprintf(out, " -l loop sending pings forever\n" );
fprintf(out, " -m ping multiple interfaces on target host\n" );
fprintf(out, " -n show targets by name (-d is equivalent)\n" );
+ fprintf(out, " -O n set the type of service (tos) flag on the ICMP packets\n" );
fprintf(out, " -p n interval between ping packets to one target (in millisec)\n" );
fprintf(out, " (in looping and counting modes, default %d)\n", perhost_interval / 100 );
fprintf(out, " -q quiet (don't show per-target/per-ping results)\n" );
fprintf(out, " -t n individual target initial timeout (in millisec) (default %d)\n", timeout / 100 );
fprintf(out, " -T n ignored (for compatibility with fping 2.4)\n");
fprintf(out, " -u show targets that are unreachable\n" );
- fprintf(out, " -O n set the type of service (tos) flag on the ICMP packets\n" );
fprintf(out, " -v show version\n" );
fprintf(out, " targets list of targets to check (if no -f specified)\n" );
fprintf(out, "\n");