Test that -g does not accept IPv6

pull/293/head
Erik Auerswald 10 months ago committed by David Schweikert
parent 2fa4f61079
commit ccc0cdfdd7

@ -1,6 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
use Test::Command tests => 45; use Test::Command tests => 51;
use Test::More;
use File::Temp; use File::Temp;
# -f file read list of targets from a file ( - means stdin) (only if no -g specified) # -f file read list of targets from a file ( - means stdin) (only if no -g specified)
@ -124,6 +125,28 @@ $cmd->stdout_is_eq("");
$cmd->stderr_is_eq("fping: netmask must be between 1 and 32 (is: 0)\n"); $cmd->stderr_is_eq("fping: netmask must be between 1 and 32 (is: 0)\n");
} }
# fping -g (range - no IPv6 generator)
SKIP: {
if($ENV{SKIP_IPV6}) {
skip 'Skip IPv6 tests', 3;
}
my $cmd = Test::Command->new(cmd => "fping -6 -g ::1 ::1");
$cmd->exit_is_num(1);
$cmd->stdout_is_eq("");
$cmd->stderr_is_eq("fping: -g works only with IPv4 addresses\n");
}
# fping -g (CIDR - no IPv6 generator)
SKIP: {
if($ENV{SKIP_IPV6}) {
skip 'Skip IPv6 tests', 3;
}
my $cmd = Test::Command->new(cmd => "fping -6 -g ::1/128");
$cmd->exit_is_num(1);
$cmd->stdout_is_eq("");
$cmd->stderr_is_eq("fping: -g works only with IPv4 addresses\n");
}
# fping -H # fping -H
{ {
my $cmd = Test::Command->new(cmd => "fping -H 1 127.0.0.1"); my $cmd = Test::Command->new(cmd => "fping -H 1 127.0.0.1");

Loading…
Cancel
Save