From cc2e23b44438102d2af026bc38df19e87bbae1fd Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Thu, 17 Jan 2019 13:27:52 +0100 Subject: [PATCH] F #2816: Initial commit for Travis smoke tests --- .travis.yml | 12 ++++++++++ .travis/smoke_tests.sh | 49 +++++++++++++++++++++++++++++++++++++++ .travis/tests/01-scons.sh | 1 + 3 files changed, 62 insertions(+) create mode 100644 .travis.yml create mode 100755 .travis/smoke_tests.sh create mode 100755 .travis/tests/01-scons.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..66ea8d2b29 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +dist: xenial +language: generic +before_install: + - sudo apt-get install -y libsystemd-dev bash-completion bison debhelper default-jdk flex javahelper libmysql++-dev libsqlite3-dev libssl-dev libws-commons-util-java libxml2-dev libxmlrpc3-client-java libxmlrpc3-common-java libxslt1-dev libcurl4-openssl-dev ruby scons libxmlrpc-c++8-dev npm + - gem install rubocop + - sudo npm install -g bower + - sudo npm install -g grunt + - sudo npm install -g grunt-cli + - (cd src/sunstone/public && npm install && bower install) +script: + - rubocop -c share/linters/.rubocop.yml src/cli + - set -o errexit; source .travis/smoke_tests.sh diff --git a/.travis/smoke_tests.sh b/.travis/smoke_tests.sh new file mode 100755 index 0000000000..000508d9d4 --- /dev/null +++ b/.travis/smoke_tests.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2019, OpenNebula Project, OpenNebula Systems # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +#--------------------------------------------------------------------------- # + +#------------------------------------------------------------------------------- +# Smoke tests for OpenNebula, to be triggered by travis or manually +# It executes all scripts in 'tests' folder and expects 0 exit code +#------------------------------------------------------------------------------- + +# default parameters values + +LOG_FILE='smoke_tests.results' + +check_test() { + local TEST=$1 + + echo "Executing test $TEST" >> ${LOG_FILE} + eval $TEST >> ${LOG_FILE} 2>&1 + RC=$? + return $RC +} + +for smoke_test in .travis/tests/*.sh; do + check_test "$smoke_test" || break +done + +if [ $RC == 0 ]; then + echo "All tests OK!" +else + echo "Test failed: "$smoke_test + echo "Log follows:" + cat $LOG_FILE +fi + +exit $RC diff --git a/.travis/tests/01-scons.sh b/.travis/tests/01-scons.sh new file mode 100755 index 0000000000..c5e35a1c3d --- /dev/null +++ b/.travis/tests/01-scons.sh @@ -0,0 +1 @@ +scons sunstone=yes mysql=yes systemd=yes new_xmlrpc=yes