]> git.gsnw.org Git - fping.git/commitdiff
try to fix tests on travis-ci (no ipv6?)
authorDavid Schweikert <david@schweikert.ch>
Wed, 24 Aug 2016 09:45:10 +0000 (11:45 +0200)
committerDavid Schweikert <david@schweikert.ch>
Wed, 24 Aug 2016 09:45:10 +0000 (11:45 +0200)
.travis.yml
ci/test-01-basics.pl

index b4c8a34ad06e749812e18e4534a5970b3b8207ba..2e20eda0cbb3b2f0195e7c8300334d8062531519 100644 (file)
@@ -1,6 +1,6 @@
 # travis-ci.org configuration
 # 
-language: c
+language: generic
 sudo: required
 dist: trusty
 env:
index 9500970e3472125eff3c8643e6caf23adb33e247..66059620c80d96e15e86d4f1189a2ff760e31e28 100755 (executable)
@@ -3,22 +3,31 @@
 use Test::Command tests => 9;
 
 # ping 127.0.0.1
-my $cmd1 = Test::Command->new(cmd => "fping 127.0.0.1");
-$cmd1->exit_is_num(0);
-$cmd1->stdout_is_eq("127.0.0.1 is alive\n");
-$cmd1->stderr_is_eq("");
+{
+    my $cmd = Test::Command->new(cmd => "fping 127.0.0.1");
+    $cmd->exit_is_num(0);
+    $cmd->stdout_is_eq("127.0.0.1 is alive\n");
+    $cmd->stderr_is_eq("");
+}
 
 # ping ::1
-my $cmd2 = Test::Command->new(cmd => "fping6 ::1");
-$cmd2->exit_is_num(0);
-$cmd2->stdout_is_eq("::1 is alive\n");
-$cmd2->stderr_is_eq("");
+if(system("/sbin/ifconfig | grep inet6") != 0) {
+    skip 'No IPv6 on this host', 3;
+}
+else {
+    my $cmd = Test::Command->new(cmd => "fping6 ::1");
+    $cmd->exit_is_num(0);
+    $cmd->stdout_is_eq("::1 is alive\n");
+    $cmd->stderr_is_eq("");
+}
 
 # ping 3 times 127.0.0.1
-my $cmd3 = Test::Command->new(cmd => "fping -p 100 -C3 127.0.0.1");
-$cmd3->exit_is_num(0);
-$cmd3->stdout_like(qr{127\.0\.0\.1 : \[0\], 84 bytes, 0\.\d+ ms \(0\.\d+ avg, 0% loss\)
-127\.0\.0\.1 : \[1\], 84 bytes, 0\.\d+ ms \(0.\d+ avg, 0% loss\)
-127\.0\.0\.1 : \[2\], 84 bytes, 0\.\d+ ms \(0.\d+ avg, 0% loss\)
-});
-$cmd3->stderr_like(qr{127\.0\.0\.1 : 0\.\d+ 0\.\d+ 0\.\d+\n});
+{
+    my $cmd = Test::Command->new(cmd => "fping -p 100 -C3 127.0.0.1");
+    $cmd->exit_is_num(0);
+    $cmd->stdout_like(qr{127\.0\.0\.1 : \[0\], 84 bytes, 0\.\d+ ms \(0\.\d+ avg, 0% loss\)
+    127\.0\.0\.1 : \[1\], 84 bytes, 0\.\d+ ms \(0.\d+ avg, 0% loss\)
+    127\.0\.0\.1 : \[2\], 84 bytes, 0\.\d+ ms \(0.\d+ avg, 0% loss\)
+    });
+    $cmd->stderr_like(qr{127\.0\.0\.1 : 0\.\d+ 0\.\d+ 0\.\d+\n});
+}