Skip to content

Commit

Permalink
test error when binding to wrong local address
Browse files Browse the repository at this point in the history
Test "fping -S" with both IPv4 and IPv6 addresses not configured
on local interfaces using addresses reserved for documentation.
Check the fping error message, but accept any system generated
additional information.  This additional information differs
between operation systems.
  • Loading branch information
auerswal authored and schweikert committed Jun 9, 2024
1 parent 79e274d commit 97b7484
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion ci/test-09-option-r-t.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w

use Test::Command tests => 21;
use Test::Command tests => 27;
use Test::More;

# -R random bytes
Expand Down Expand Up @@ -84,6 +84,14 @@
$cmd->stderr_is_eq("");
}

# fping -S (wrong source address)
{
my $cmd = Test::Command->new(cmd => "fping -S 192.0.2.47 127.0.0.1");
$cmd->exit_is_num(4);
$cmd->stdout_is_eq("");
$cmd->stderr_like(qr{fping: cannot bind source address : .+\n});
}

# fping -S
SKIP: {
if($ENV{SKIP_IPV6}) {
Expand All @@ -95,6 +103,17 @@
$cmd->stderr_is_eq("");
}

# fping -S (wrong IPv6 source address)
SKIP: {
if($ENV{SKIP_IPV6}) {
skip 'Skip IPv6 tests', 3;
}
my $cmd = Test::Command->new(cmd => "fping -S 2001:db8::1 ::1");
$cmd->exit_is_num(4);
$cmd->stdout_is_eq("");
$cmd->stderr_like(qr{fping: cannot bind source address : .+\n});
}

# fping -S
{
my $cmd = Test::Command->new(cmd => "fping -S bla");
Expand Down

0 comments on commit 97b7484

Please sign in to comment.