my $cmd8 = Test::Command->new(cmd => "fping -b 65509 127.0.0.1");
$cmd8->exit_is_num(1);
$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
my $cmd9 = Test::Command->new(cmd => "fping -B 0.9 127.0.0.1");
#!/usr/bin/perl -w
use Test::Command tests => 18;
+use Test::More;
# -R random bytes
# -r n number of retries (default 3)
$cmd->stderr_like(qr{127\.0\.0\.1 : xmt/rcv/%loss = 3/3/0%.*});
}
-# fping6 -R
-{
-my $cmd = Test::Command->new(cmd => "fping6 -q -R -c3 -p100 ::1");
-$cmd->exit_is_num(0);
-$cmd->stdout_is_eq("");
-$cmd->stderr_like(qr{::1 : xmt/rcv/%loss = 3/3/0%.*});
+SKIP: {
+ if(system("/sbin/ifconfig | grep inet6") != 0) {
+ skip 'No IPv6 on this host', 3;
+ }
+ my $cmd = Test::Command->new(cmd => "fping6 -q -R -c3 -p100 ::1");
+ $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
}
# fping6 -S
-{
-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("");
+SKIP: {
+ if(system("/sbin/ifconfig | grep inet6") != 0) {
+ skip 'No IPv6 on this host', 3;
+ }
+ 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
}
# fping6 -A -n
-{
-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("");
+SKIP: {
+ if(system("/sbin/ifconfig | grep inet6") != 0) {
+ skip 'No IPv6 on this host', 3;
+ }
+ 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