try to fix tests on travis-ci (no ipv6?)

pull/102/head
David Schweikert 8 years ago
parent 2e316571bd
commit 093ca16719

@ -60,7 +60,7 @@ $cmd7->stderr_is_eq("fping: specify only one of c, l\n");
my $cmd8 = Test::Command->new(cmd => "fping -b 65509 127.0.0.1"); my $cmd8 = Test::Command->new(cmd => "fping -b 65509 127.0.0.1");
$cmd8->exit_is_num(1); $cmd8->exit_is_num(1);
$cmd8->stdout_is_eq(""); $cmd8->stdout_is_eq("");
$cmd8->stderr_is_eq("fping: data size 65509 not valid, must be between 0 and 65508\n"); $cmd8->stderr_is_eq("fping: data size 65509 not valid, must be lower than 65508\n");
# fping -B 0.9 # fping -B 0.9
my $cmd9 = Test::Command->new(cmd => "fping -B 0.9 127.0.0.1"); my $cmd9 = Test::Command->new(cmd => "fping -B 0.9 127.0.0.1");

@ -1,6 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
use Test::Command tests => 18; use Test::Command tests => 18;
use Test::More;
# -R random bytes # -R random bytes
# -r n number of retries (default 3) # -r n number of retries (default 3)
@ -17,12 +18,14 @@ $cmd->stdout_is_eq("");
$cmd->stderr_like(qr{127\.0\.0\.1 : xmt/rcv/%loss = 3/3/0%.*}); $cmd->stderr_like(qr{127\.0\.0\.1 : xmt/rcv/%loss = 3/3/0%.*});
} }
# fping6 -R SKIP: {
{ if(system("/sbin/ifconfig | grep inet6") != 0) {
my $cmd = Test::Command->new(cmd => "fping6 -q -R -c3 -p100 ::1"); skip 'No IPv6 on this host', 3;
$cmd->exit_is_num(0); }
$cmd->stdout_is_eq(""); my $cmd = Test::Command->new(cmd => "fping6 -q -R -c3 -p100 ::1");
$cmd->stderr_like(qr{::1 : xmt/rcv/%loss = 3/3/0%.*}); $cmd->exit_is_num(0);
$cmd->stdout_is_eq("");
$cmd->stderr_like(qr{::1 : xmt/rcv/%loss = 3/3/0%.*});
} }
# fping -r tested in test-4-options-a-b.pl # fping -r tested in test-4-options-a-b.pl
@ -82,11 +85,14 @@ $cmd->stderr_is_eq("");
} }
# fping6 -S # fping6 -S
{ SKIP: {
my $cmd = Test::Command->new(cmd => "fping6 -S ::1 ::1"); if(system("/sbin/ifconfig | grep inet6") != 0) {
$cmd->exit_is_num(0); skip 'No IPv6 on this host', 3;
$cmd->stdout_is_eq("::1 is alive\n"); }
$cmd->stderr_is_eq(""); my $cmd = Test::Command->new(cmd => "fping6 -S ::1 ::1");
$cmd->exit_is_num(0);
$cmd->stdout_is_eq("::1 is alive\n");
$cmd->stderr_is_eq("");
} }
# fping -t tested in test-4-options-a-b.pl # fping -t tested in test-4-options-a-b.pl

@ -42,11 +42,14 @@ $cmd->stderr_is_eq("");
} }
# fping6 -A -n # fping6 -A -n
{ SKIP: {
my $cmd = Test::Command->new(cmd => "fping6 -n -A 2001:4860:4860::8888"); if(system("/sbin/ifconfig | grep inet6") != 0) {
$cmd->exit_is_num(0); skip 'No IPv6 on this host', 3;
$cmd->stdout_is_eq("google-public-dns-a.google.com (2001:4860:4860::8888) is alive\n"); }
$cmd->stderr_is_eq(""); my $cmd = Test::Command->new(cmd => "fping6 -n -A 2001:4860:4860::8888");
$cmd->exit_is_num(0);
$cmd->stdout_is_eq("google-public-dns-a.google.com (2001:4860:4860::8888) is alive\n");
$cmd->stderr_is_eq("");
} }
# fping -m # fping -m

Loading…
Cancel
Save