]> git.gsnw.org Git - fping.git/commitdiff
Add IPv6 test for --oiface
authorGerman Service Network <support@gsnw.de>
Sun, 22 Mar 2026 08:44:43 +0000 (09:44 +0100)
committerSebastian <176771227+gsnw-sebast@users.noreply.github.com>
Sat, 25 Apr 2026 05:42:10 +0000 (07:42 +0200)
ci/test-07-options-i-m.pl

index 3bb31698f275a5f021ee1486ae897063bb3730ca..938d2a273f17620347bb436ea75850baae51d203 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-use Test::Command tests => 28;
+use Test::Command tests => 31;
 use Test::More;
 
 #  -i n       interval between sending ping packets (in millisec) (default 25)
@@ -65,6 +65,20 @@ $cmd->stdout_is_eq("127.0.0.1 is alive\n");
 $cmd->stderr_is_eq("");
 }
 
+# fping --oiface=IFACE (IPv6)
+SKIP: {
+    if($^O ne 'linux') {
+        skip '--oiface option functionality is only tested on Linux', 3;
+    }
+    if($ENV{SKIP_IPV6}) {
+        skip 'Skip IPv6 tests', 3;
+    }
+    my $cmd = Test::Command->new(cmd => 'fping -6 --oiface=lo ::1');
+    $cmd->exit_is_num(0);
+    $cmd->stdout_is_eq("::1 is alive\n");
+    $cmd->stderr_is_eq("");
+}
+
 # fping -l
 {
 my $cmd = Test::Command->new(cmd => '(sleep 0.5; pkill -INT fping)& fping -p 100 -l 127.0.0.1');