From 73bfc121c2d3274d7fbd040677087aff74d89bbd Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Tue, 4 Aug 2020 07:45:23 +0300 Subject: [PATCH] more travis-ci improvements --- .travis.yml | 23 +++++++++++++++++++++-- CHANGELOG.md | 3 +++ ci/deploy-coveralls.sh | 14 +++++++++++++- ci/test-01-basics.pl | 4 ++-- ci/test-04-options-a-b.pl | 4 ++-- ci/test-09-option-r-t.pl | 8 ++++---- ci/test-14-ping-internet-hosts.pl | 12 ++++++------ 7 files changed, 51 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08ddccf..829fa60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,9 @@ env: # via the "travis encrypt" command using the project repo's public key - secure: "C9ZJ9LYnuowRdF4D66KLfquimvu8GtRGIafwvCcGYKReEy8phlBdFsHlybkMBNYJNTJSM0j6wyo1lKTVGHxmpQDimjR7kmxUtawbhuJ5qOCBtFqNVh9lRQi7hC4+UOhvRsIcbV8HAJM5u/5RxGOfXCePK3a2DtiYv1d2NHToZN8=" +notifications: + webhooks: https://coveralls.io/webhook + compiler: - gcc @@ -34,6 +37,7 @@ addons: script: - ci/build-4-compile.sh - ci/run-tests.sh + - ci/deploy-coveralls.sh stages: - test @@ -47,20 +51,35 @@ jobs: name: test trusty os: linux dist: trusty + env: + - SKIP_IPV6=1 install: - ci/build-1-autotools.sh - name: test xenial os: linux dist: xenial - after_success: - - ci/deploy-coveralls.sh + env: + - SKIP_IPV6=1 + + - name: test bionic + os: linux + dist: bionic + env: + - SKIP_IPV6=1 + + - name: test bionic lxd arm64 + os: linux + dist: bionic + arch: arm64 - name: test macos os: osx install: - ci/build-2-test-command.sh - ci/build-3-prepare-macos.sh + env: + - SKIP_IPV6=1 #### STAGE: deploy - stage: deploy diff --git a/CHANGELOG.md b/CHANGELOG.md index 59b9ce2..b0b83d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,9 @@ fping 5.0 (unreleased) - The reported size of received packets is now always correct on Linux even for packets > 4096 bytes. +- Travis CI automated testing now also macos testing and additional ubuntu + distributions. + fping 4.4 (2020-07-24) ====================== ## Bugfixes and other changes diff --git a/ci/deploy-coveralls.sh b/ci/deploy-coveralls.sh index 738f281..bf62144 100755 --- a/ci/deploy-coveralls.sh +++ b/ci/deploy-coveralls.sh @@ -2,5 +2,17 @@ set -xe -pip install --user cpp-coveralls +set + +if [ "$TRAVIS_DIST" = "trusty" ]; then + echo "skip coveralls on trusty because coveralls errors out due to python issues" + exit 0 +elif [ "$TRAVIS_OS_NAME" = "osx" ]; then + pip3 install --user cpp-coveralls + PATH="${PATH}:$(python3 -c 'import site; print(site.USER_BASE)')/bin" +else + pip install --user cpp-coveralls +fi + +export COVERALLS_PARALLEL=true coveralls --build-root src --exclude src/optparse.c --exclude ci --exclude config.h --gcov-options '\-lp' diff --git a/ci/test-01-basics.pl b/ci/test-01-basics.pl index 47f1910..ba12059 100755 --- a/ci/test-01-basics.pl +++ b/ci/test-01-basics.pl @@ -14,8 +14,8 @@ use Test::More; # ping ::1 SKIP: { #system("/sbin/ifconfig >&2"); - if(system("/sbin/ifconfig | grep inet6") != 0) { - skip 'No IPv6 on this host', 3; + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; } my $cmd = Test::Command->new(cmd => "fping ::1"); $cmd->exit_is_num(0); diff --git a/ci/test-04-options-a-b.pl b/ci/test-04-options-a-b.pl index 83859ae..46f3522 100755 --- a/ci/test-04-options-a-b.pl +++ b/ci/test-04-options-a-b.pl @@ -44,8 +44,8 @@ $cmd->stderr_like(qr{^::1:.*(not supported|not known)}); # fping -6 SKIP: { - if(system("/sbin/ifconfig | grep inet6") != 0) { - skip 'No IPv6 on this host', 3; + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; } my $cmd = Test::Command->new(cmd => "fping -6 ::1"); $cmd->exit_is_num(0); diff --git a/ci/test-09-option-r-t.pl b/ci/test-09-option-r-t.pl index e182ca3..b256f66 100755 --- a/ci/test-09-option-r-t.pl +++ b/ci/test-09-option-r-t.pl @@ -19,8 +19,8 @@ $cmd->stderr_like(qr{127\.0\.0\.1 : xmt/rcv/%loss = 3/3/0%.*}); } SKIP: { - if(system("/sbin/ifconfig | grep inet6") != 0) { - skip 'No IPv6 on this host', 3; + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; } my $cmd = Test::Command->new(cmd => "fping -q -R -c3 -p100 ::1"); $cmd->exit_is_num(0); @@ -86,8 +86,8 @@ $cmd->stderr_is_eq(""); # fping -S SKIP: { - if(system("/sbin/ifconfig | grep inet6") != 0) { - skip 'No IPv6 on this host', 3; + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; } my $cmd = Test::Command->new(cmd => "fping -S ::1 ::1"); $cmd->exit_is_num(0); diff --git a/ci/test-14-ping-internet-hosts.pl b/ci/test-14-ping-internet-hosts.pl index b8ecc05..1de24fb 100755 --- a/ci/test-14-ping-internet-hosts.pl +++ b/ci/test-14-ping-internet-hosts.pl @@ -59,23 +59,23 @@ $cmd->stderr_is_eq(""); # fping -A -n (IPv6) SKIP: { - if(system("/sbin/ifconfig | grep inet6.*Scope:Global") != 0) { - skip 'No IPv6 on this host', 3; + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; } my $cmd = Test::Command->new(cmd => "fping -6 -n -A dns.google"); $cmd->exit_is_num(0); - $cmd->stdout_is_eq("dns.google (2001:4860:4860::8888) is alive\n"); + $cmd->stdout_like(qr{^dns.google \(2001:4860:4860::88(44|88)\) is alive\n$}); $cmd->stderr_is_eq(""); } # fping -m SKIP: { - if(system("/sbin/ifconfig | grep inet6.*Scope:Global") != 0) { - skip 'No IPv6 on this host', 3; + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; } my $cmd = Test::Command->new(cmd => "fping -A -m dns.google"); $cmd->exit_is_num(0); - $cmd->stdout_is_eq("2001:4860:4860::8888 is alive\n8.8.8.8 is alive\n"); + $cmd->stdout_like(qr{^.* is alive\n.* is alive\n.* is alive\n.* is alive\n}); $cmd->stderr_is_eq(""); }