diff --git a/.travis.yml b/.travis.yml index 373a3429f0..74614503c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,89 +1,89 @@ # Control file for the Travis autobuilder # https://docs.travis-ci.com/user/customizing-the-build/ language: c compiler: - gcc - clang # - cov-build env: global: # -- BEGIN Coverity Scan ENV # Used by https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh # The build command with all of the arguments that you would apply to a manual `cov-build` - COVERITY_SCAN_BUILD_COMMAND="make" # Email address for notifications related to this build - OWNER_EMAIL="andrew@beekhof.net" # Regular expression selects on which branches to run analysis # Be aware of quotas. Do not run on every branch/commit - COVERITY_SCAN_BRANCH_PATTERN="1.1" # COVERITY_SCAN_TOKEN via "travis encrypt" using the repo's public key - secure: "qnrF7L8RejLUY7URdNe7XP4Hu4R55C0tvAuMRg4EjVtelOpw+nIgA7BLiX19q/70VjFuKcGnMhW28TdYl0uwMMdWKKxmwTim04Sy3UfOE2BPeuQOBphr+8s9gd0U1MO8j2dZ84A40t5Mkk946wWZwT0okpjOr/PfBOZkU3o87FM=" # -- END Coverity Scan ENV # sudo add-apt-repository ppa:hotot-team before_install: - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main" - sudo apt-get update -qq # To switch to Travis-CI's containerized (non-sudo) architecture, # all our dependencies need to be on Travis's whitelist: # https://github.com/travis-ci/apt-package-whitelist # # The only ones that aren't already are: # - cluster-glue-dev: see open issue: # https://github.com/travis-ci/apt-package-whitelist/issues/2936 # - resource-agents: see open issue: # https://github.com/travis-ci/apt-package-whitelist/issues/4261 # - libdbus-1-dev: see multiple open issues: # https://github.com/travis-ci/apt-package-whitelist/issues?utf8=%E2%9C%93&q=is%3Aissue+libdbus+-1-dev # (a workaround is to install libdbus-glib-1-dev, which depends on it and is whitelisted) install: - sudo apt-get install -qq automake autoconf chrpath libtool perl python python-dev - sudo apt-get install -qq libbz2-dev libdbus-1-dev libglib2.0-dev libgnutls-dev libltdl-dev - sudo apt-get install -qq libncurses5-dev libpam0g-dev libxml2-dev libxslt1-dev uuid-dev - sudo apt-get install -qq libqb-dev libcfg-dev libcmap-dev libcorosync-common-dev libcpg-dev - sudo apt-get install -qq libquorum-dev libsam-dev libtotem-pg-dev libvotequorum-dev - sudo apt-get install -qq cluster-glue-dev resource-agents before_script: # Save and restore CC so that ./configure can pass - export CC_SAVED=$CC - export CC=`echo ${CC} | sed s/cov-build/gcc/` - ./autogen.sh - ./configure - export CC=$CC_SAVED script: - if test ${CC} != cov-build; then sudo make install-exec-local || true; fi -- if test ${CC} != cov-build; then make && ./cts/cts-regression -V; fi +- if test ${CC} != cov-build; then make && ./cts/cts-regression -V cli scheduler exec; fi - if test ${CC} = cov-build; then export CC=gcc; bash ./travisci_build_coverity_scan.sh; fi #after_script: #after_success: after_failure: - lsb_release -a - sudo cat /etc/apt/sources.list - whoami - env | sort - cat include/config.h notifications: irc: "irc.freenode.org#pcmk" # email: # recipients: # - developers@clusterlabs.org # whitelist branches: only: - master - "1.1" - "2.0" diff --git a/cts/cts-regression.in b/cts/cts-regression.in index fc08954e12..d458a5e989 100755 --- a/cts/cts-regression.in +++ b/cts/cts-regression.in @@ -1,216 +1,215 @@ #!@BASH_PATH@ # # cts-regression # # Convenience wrapper for running any of the Pacemaker regression tests # # Copyright 2012-2018 Andrew Beekhof # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # USAGE_TEXT="Usage: cts-regression [] [ ...] Options: --help Display this text, then exit -V, --verbose Increase test verbosity -v, --valgrind Run test commands under valgrind -Tests (default tests are 'scheduler cli exec'): +Tests (default tests are 'scheduler cli'): scheduler Action scheduler cli Command-line tools exec Local resource agent executor pacemaker_remote Resource agent executor in remote mode fencing Fencer all Synonym for 'scheduler cli exec fencing'" # If readlink supports -e (i.e. GNU), use it readlink -e / >/dev/null 2>/dev/null if [ $? -eq 0 ]; then test_home="$(dirname $(readlink -e $0))" else test_home="$(dirname $0)" fi valgrind="" verbose="" tests="" # These constants must track crm_exit_t values CRM_EX_OK=0 CRM_EX_ERROR=1 CRM_EX_NOT_INSTALLED=5 CRM_EX_USAGE=64 function info() { printf "$*\n" } function error() { printf " * ERROR: $*\n" } function run_as_root() { CMD="$1" shift ARGS="$@" # Test might not be executable if run from source directory chmod a+x $CMD CMD="$CMD $ARGS $verbose" if [ $EUID -eq 0 ]; then $CMD elif [ -z $TRAVIS ]; then # sudo doesn't work in buildbot, su doesn't work in travis echo "Enter the root password..." su root -c "$CMD" else echo "Enter the root password if prompted..." sudo -- $CMD fi } add_test() { local TEST="$1" case "$TEST" in scheduler|exec|pacemaker_remote|fencing|cli) if [[ ! $tests =~ $TEST ]]; then tests="$tests $TEST" fi ;; *) error "unknown test: $TEST" echo echo "$USAGE_TEXT" exit $CRM_EX_USAGE ;; esac } run_test() { local t="$1" info "Executing the $t regression tests" info "============================================================" case $t in scheduler) if [ -x $test_home/cts-scheduler ]; then $test_home/cts-scheduler $verbose $valgrind rc=$? else error "scheduler regression test not found" rc=$CRM_EX_NOT_INSTALLED fi ;; exec) if [ -x $test_home/cts-exec ]; then run_as_root $test_home/cts-exec rc=$? else error "executor regression test not found" rc=$CRM_EX_NOT_INSTALLED fi ;; pacemaker_remote) if [ -x $test_home/cts-exec ]; then run_as_root $test_home/cts-exec -R rc=$? else error "pacemaker_remote regression test not found" rc=$CRM_EX_NOT_INSTALLED fi ;; fencing) if [ -x $test_home/cts-fencing ]; then run_as_root $test_home/cts-fencing rc=$? else error "fencing regression test not found" rc=$CRM_EX_NOT_INSTALLED fi ;; cli) if [ -x $test_home/cts-cli ]; then $test_home/cts-cli $verbose $valgrind rc=$? else error "cli regression test not found" rc=$CRM_EX_NOT_INSTALLED fi ;; esac info "============================================================" info "" info "" return $rc } run_tests() { TESTS="$@" local TEST local TEST_RC local FAILED FAILED="" for TEST in $TESTS; do run_test $TEST TEST_RC=$? if [ $TEST_RC -ne 0 ]; then info "$TEST regression tests failed ($TEST_RC)" FAILED="$FAILED $TEST" fi done if [ -n "$FAILED" ]; then error "failed regression tests: $FAILED" return $CRM_EX_ERROR fi return $CRM_EX_OK } while [ $# -gt 0 ] ; do case "$1" in --help) echo "$USAGE_TEXT" exit $CRM_EX_OK ;; -V|--verbose) verbose="-V" shift ;; -v|--valgrind) valgrind="-v" shift ;; scheduler|exec|pacemaker_remote|fencing|cli) add_test $1 shift ;; all) add_test scheduler add_test cli add_test exec add_test fencing shift ;; *) error "unknown option: $1" echo echo "$USAGE_TEXT" exit $CRM_EX_USAGE ;; esac done if [ -z "$tests" ]; then add_test scheduler add_test cli - add_test exec fi run_tests $tests