]> git.gsnw.org Git - fping.git/commitdiff
test that --icmp-timestamp requires privileges
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sat, 8 Mar 2025 18:45:14 +0000 (19:45 +0100)
committerErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sun, 6 Apr 2025 15:24:15 +0000 (17:24 +0200)
ci/test-11-unpriv.pl

index debf2afb809f1cf1462c3b0feaf67309f76d57ad..5b5705d837f61cc06d8ee1c82ee2149974a2a300 100755 (executable)
@@ -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 {