From ce73240765711d68a9cd8aed40a87ec42a637b2d Mon Sep 17 00:00:00 2001 From: Jason Hee Date: Sun, 15 Aug 2021 21:28:49 +0800 Subject: [PATCH] Use xenial for travis (#11) * Use Ubuntu Xenial for Travis CI * Fix CI tests * Ensure NTP time is synced https://askubuntu.com/a/1049810 --- .travis.yml | 4 ++-- setupLibrary.sh | 5 +++++ tests/unit-tests.sh | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a117c8f..9ee43d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: generic sudo: required matrix: include: - - dist: trusty + - dist: xenial sudo: required # Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior git: @@ -13,4 +13,4 @@ before_install: - git submodule update --init --recursive script: - bash -c 'shopt -s globstar; shellcheck ./*.sh; shellcheck ./tests/*.sh' - - bash tests/unit-tests.sh -skip \ No newline at end of file + - bash tests/unit-tests.sh -s \ No newline at end of file diff --git a/setupLibrary.sh b/setupLibrary.sh index 9dc0542..68026ee 100644 --- a/setupLibrary.sh +++ b/setupLibrary.sh @@ -121,6 +121,11 @@ function configureNTP() { else sudo apt-get update sudo apt-get --assume-yes install ntp + + # force NTP to sync + sudo service ntp stop + sudo ntpd -gq + sudo service ntp start fi } diff --git a/tests/unit-tests.sh b/tests/unit-tests.sh index 10766c1..1ec6776 100644 --- a/tests/unit-tests.sh +++ b/tests/unit-tests.sh @@ -2,9 +2,11 @@ set -e -while getopts "skip" opt; do +while getopts "s" opt; do case $opt in s) SKIP_SETUP=true ;; + *) echo "usage: $0 [-v] [-r]" >&2 + exit 1 ;; esac done