From: Erik Auerswald Date: Sat, 8 Mar 2025 18:45:14 +0000 (+0100) Subject: test that --icmp-timestamp requires privileges X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4160d03a2653684b37a776744095aac43f7efc88;p=fping.git test that --icmp-timestamp requires privileges --- diff --git a/ci/test-11-unpriv.pl b/ci/test-11-unpriv.pl index debf2af..5b5705d 100755 --- a/ci/test-11-unpriv.pl +++ b/ci/test-11-unpriv.pl @@ -60,15 +60,6 @@ sub test_unprivileged_works { $cmd->stdout_is_eq("127.0.0.1 is alive (TTL unknown)\n"); $cmd->stderr_is_eq(""); } - SKIP: { - if($^O ne 'linux') { - skip '-k option is only supported on Linux', 3; - } - my $cmd = Test::Command->new(cmd => "$fping_copy -4 -k 256 127.0.0.1"); - $cmd->exit_is_num(0); - $cmd->stdout_is_eq("127.0.0.1 is alive\n"); - $cmd->stderr_like(qr{fwmark ipv4: .+\n}); - } SKIP: { if($^O ne 'linux') { skip '-k option is only supported on Linux', 3; @@ -81,6 +72,15 @@ sub test_unprivileged_works { $cmd->stdout_is_eq("::1 is alive\n"); $cmd->stderr_like(qr{fwmark ipv6: .+\n}); } + SKIP: { + if($^O ne 'linux') { + skip 'testing --icmp-timestamp option only works on Linux', 3; + } + my $cmd = Test::Command->new(cmd => "$fping_copy --icmp-timestamp 127.0.0.1"); + $cmd->exit_is_num(1); + $cmd->stdout_is_eq("127.0.0.1 is unreachable\n"); + $cmd->stderr_like(qr{127.0.0.1: error while sending ping: .+\n}); + } } sub test_privileged_fails {