more tests

This commit is contained in:
David Schweikert 2014-05-02 23:10:46 +02:00
parent c1fe95f7b7
commit 75101dd843
8 changed files with 36 additions and 16 deletions

24
ci/test-10-option-u-v.pl Executable file
View File

@ -0,0 +1,24 @@
#!/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("");
}

View File

@ -26,6 +26,7 @@ Usage: fping [options] [targets...]
-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)
@ -36,7 +37,6 @@ Usage: fping [options] [targets...]
-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)

View File

@ -1,8 +1,6 @@
#!/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

View File

@ -1,8 +1,6 @@
#!/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)

View File

@ -1,9 +1,6 @@
#!/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

View File

@ -1,11 +1,9 @@
#!/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)
@ -19,6 +17,14 @@ $cmd->stdout_is_eq("google-public-dns-a.google.com is alive\n");
$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");

View File

@ -1,9 +1,6 @@
#!/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

View File

@ -2693,6 +2693,7 @@ void usage(int is_error)
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" );
@ -2703,7 +2704,6 @@ void usage(int is_error)
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");