From: Erik Auerswald Date: Sun, 28 Jul 2024 17:35:46 +0000 (+0200) Subject: test --print-tos without raw socket X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d0d79c1a4848214f101f1dcb6d982f8604c17fc;p=fping.git test --print-tos without raw socket The current code can only read the TOS byte when using a raw socket. It prints '(TOS unknown)' when a datagram socket is used. --- diff --git a/ci/test-11-unpriv.pl b/ci/test-11-unpriv.pl index 9cf529d..0f10a1a 100755 --- a/ci/test-11-unpriv.pl +++ b/ci/test-11-unpriv.pl @@ -35,7 +35,7 @@ else { } sub test_unprivileged_works { - plan tests => 3; + plan tests => 6; { my $cmd = Test::Command->new(cmd => "/tmp/fping.copy 127.0.0.1"); @@ -43,6 +43,12 @@ sub test_unprivileged_works { $cmd->stdout_is_eq("127.0.0.1 is alive\n"); $cmd->stderr_is_eq(""); } + { + my $cmd = Test::Command->new(cmd => "/tmp/fping.copy --print-tos 127.0.0.1"); + $cmd->exit_is_num(0); + $cmd->stdout_is_eq("127.0.0.1 is alive (TOS unknown)\n"); + $cmd->stderr_is_eq(""); + } } sub test_privileged_fails {