[monitoring-plugins] make travis tests more reliable

Sven Nierlein git at monitoring-plugins.org
Mon Mar 13 11:50:12 CET 2017


 Module: monitoring-plugins
 Branch: master
 Commit: d721efc10b35071b85ca98a9338e3981ce36a9ab
 Author: Sven Nierlein <sven at nierlein.de>
   Date: Fri Mar 10 21:36:41 2017 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=d721efc

make travis tests more reliable

- add-apt-repository might be missing, so install it to be sure
- killing ntp might fail if there is none
- removing ipv6 from etc/hosts should not fail

Signed-off-by: Sven Nierlein <sven at nierlein.de>

---

 .travis.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 78ebc30..d68490c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,11 +31,12 @@ matrix:
 before_install:
   # Trusty related fixed
   # multiverse is no on trusty activated (https://github.com/travis-ci/travis-ci/issues/4979)
+  - sudo apt-get install -qq --no-install-recommends software-properties-common
   - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty multiverse" && sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-updates multiverse"
   # /etc/hosts has IPv6 hosts (https://github.com/travis-ci/travis-ci/issues/4978)
-  - sudo [ $(ip addr show | grep "inet6 ::1" | wc -l) -lt "1" ] && sudo sed -i '/^::1/d' /etc/hosts
+  - sudo [ $(ip addr show | grep "inet6 ::1" | wc -l) -eq "0" ] || sudo sed -i '/^::1/d' /etc/hosts
   # Trusty has running ntpd on localhost, but we don't like that for our tests
-  - sudo killall -9 ntpd
+  - "sudo killall -9 ntpd ||:"
   # Trusty has no swap, lets create some
   - sudo fallocate -l 20M /swapfile; sudo chmod 600 /swapfile; sudo mkswap /swapfile; sudo swapon /swapfile
   - sudo add-apt-repository -y ppa:waja/trusty-backports



More information about the Commits mailing list