From: Erik Auerswald Date: Sun, 28 Jul 2024 18:27:09 +0000 (+0200) Subject: more tests with reply source != target X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68d0ec109208e4dd2d28debef727efddbfccd4bc;p=fping.git more tests with reply source != target The tests for --check-source verify that Echo reply packets from a source IP that was not used as the target of the Echo request are not accepted. It does so for default fping, for use with -c, and for use with -C. Test if the source address is really printed without --check-source, but with -c or -C. --- diff --git a/ci/test-05-options-c-e.pl b/ci/test-05-options-c-e.pl index 400cd31..73b04ed 100755 --- a/ci/test-05-options-c-e.pl +++ b/ci/test-05-options-c-e.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::Command tests => 63; +use Test::Command tests => 69; use Test::More; # -c n count of pings to send to each target (default 1) @@ -64,6 +64,18 @@ $cmd->stderr_like(qr{localhost : xmt/rcv/%loss = 2/2/0%, min/avg/max = \d\.\d+/\ }); } +# fping -c n ff02::1 +SKIP: { + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; + } + my $cmd = Test::Command->new(cmd => "fping -c 1 ff02::1"); + $cmd->exit_is_num(0); + $cmd->stdout_like(qr{ff02::1 : \[0\], 64 bytes, \d\.\d+ ms \(\d\.\d+ avg, 0% loss\)\n}); + $cmd->stderr_like(qr{ \[<- .*\] +ff02::1 : xmt/rcv/%loss = 1/1/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+\n}); +} + # fping -C n { my $cmd = Test::Command->new(cmd => "fping -4 -C 2 -p 100 localhost 127.0.0.1"); @@ -128,6 +140,17 @@ $cmd->stderr_like(qr{127\.0\.0\.1 :( \d\.\d+){20} }); } +# fping -C n ff02::1 +SKIP: { + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; + } + my $cmd = Test::Command->new(cmd => "fping -C 1 ff02::1"); + $cmd->exit_is_num(0); + $cmd->stdout_like(qr{ff02::1 : \[0\], 64 bytes, \d\.\d+ ms \(\d\.\d+ avg, 0% loss\)\n}); + $cmd->stderr_like(qr{ \[<- .*\]\nff02::1 : \d\.\d+\n}); +} + # fping --check-source { my $cmd = Test::Command->new(cmd => "fping --check-source 127.0.0.1 127.0.0.2");