From 177dfd4615edf6c9f0c1a93ab6c862a55507a40b Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Wed, 22 Apr 2020 14:36:56 +0200 Subject: [PATCH] travis: fix /etc/hosts issue on bionic image --- travis/prepare.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/travis/prepare.sh b/travis/prepare.sh index acde24d..ca0e172 100755 --- a/travis/prepare.sh +++ b/travis/prepare.sh @@ -29,6 +29,23 @@ CACHEDIR=${CACHEDIR:-${HOME}/.cache} echo -e "${ANSI_YELLOW}Using bash version $BASH_VERSION${ANSI_RESET}" +if [ -f /etc/hosts ] +then + # The travis-ci "bionic" image throws us a curveball in /etc/hosts + # by including two entries for localhost. The first for 127.0.1.1 + # which causes epicsSockResolveTest to fail. + # cat /etc/hosts + # ... + # 127.0.1.1 localhost localhost ip4-loopback + # 127.0.0.1 localhost nettuno travis vagrant travis-job-.... + + sudo sed -i -e '/^127\.0\.1\.1/ s|localhost\s*||g' /etc/hosts + + echo "==== /etc/hosts" + cat /etc/hosts + echo "====" +fi + # Load settings # -------------