From e054678803794cb6d56311a52697f064f71075a0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 10 Jul 2019 23:22:28 +0100 Subject: [PATCH] fix(travis-ci): resolve broken tests (#2440) --- .../config-lgsm/btserver/_default.cfg | 2 +- tests/tests_fctrserver.sh | 9 +++---- tests/tests_jc2server.sh | 24 +++++++++---------- tests/tests_mcserver.sh | 24 +++++++++---------- tests/tests_ts3server.sh | 24 +++++++++---------- 5 files changed, 42 insertions(+), 41 deletions(-) diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index ed8650e16..46f6079a9 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -109,7 +109,7 @@ glibc="2.17" ## Server Specific Directories systemdir="${serverfiles}" executabledir="${systemdir}" -executable="./DedicatedServer" +executable="./Launch_DedicatedServer" servercfg="serversettings.xml" servercfgdefault="serversettings.xml" servercfgdir="${systemdir}" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index de29a27d1..5901a7e29 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,8 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -travistest="1" -version="v19.6.0" +version="v19.9.0" shortname="fctr" gameservername="fctrserver" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -48,6 +47,9 @@ userinput="${1}" if [ ! -v TRAVIS ]; then TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" +else + servicename="travis" + travistest="1" fi ## GitHub Branch Select @@ -381,7 +383,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then + if [ -z "${travistest}" ]; then getopt=$1 core_getopt.sh fi @@ -782,7 +784,6 @@ grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g echo "" echo "5.0 - Monitor Tests" echo "==================================================================" - echo "" echo "Server IP - Port: ${ip}:${port}" echo "Server IP - Query Port: ${ip}:${queryport}" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 065c67f18..e0a9cd826 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,8 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -travistest="1" -version="v19.6.0" +version="v19.9.0" shortname="jc2" gameservername="jc2server" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -48,6 +47,9 @@ userinput="${1}" if [ ! -v TRAVIS ]; then TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" +else + servicename="travis" + travistest="1" fi ## GitHub Branch Select @@ -65,8 +67,6 @@ core_functions.sh(){ # Bootstrap # Fetches the core functions required before passed off to core_dl.sh. - -# Fetches core functions. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" local_filedir="${2}" @@ -281,15 +281,15 @@ if [ "$(whoami)" == "root" ]; then fi fi -# Download the latest serverlist. This is the complete list of all supported servers. -fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" -if [ ! -f "${serverlist}" ]; then - echo "[ FAIL ] serverlist.csv could not be loaded." - exit 1 -fi - # LinuxGSM installer mode. if [ "${shortname}" == "core" ]; then + # Download the latest serverlist. This is the complete list of all supported servers. + fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + if [ ! -f "${serverlist}" ]; then + echo "[ FAIL ] serverlist.csv could not be loaded." + exit 1 + fi + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then { tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' @@ -381,7 +381,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then + if [ -z "${travistest}" ]; then getopt=$1 core_getopt.sh fi diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 4be29da73..7853a9690 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,8 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -travistest="1" -version="v19.6.0" +version="v19.9.0" shortname="mc" gameservername="mcserver" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -48,6 +47,9 @@ userinput="${1}" if [ ! -v TRAVIS ]; then TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" +else + servicename="travis" + travistest="1" fi ## GitHub Branch Select @@ -65,8 +67,6 @@ core_functions.sh(){ # Bootstrap # Fetches the core functions required before passed off to core_dl.sh. - -# Fetches core functions. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" local_filedir="${2}" @@ -281,15 +281,15 @@ if [ "$(whoami)" == "root" ]; then fi fi -# Download the latest serverlist. This is the complete list of all supported servers. -fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" -if [ ! -f "${serverlist}" ]; then - echo "[ FAIL ] serverlist.csv could not be loaded." - exit 1 -fi - # LinuxGSM installer mode. if [ "${shortname}" == "core" ]; then + # Download the latest serverlist. This is the complete list of all supported servers. + fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + if [ ! -f "${serverlist}" ]; then + echo "[ FAIL ] serverlist.csv could not be loaded." + exit 1 + fi + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then { tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' @@ -381,7 +381,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then + if [ -z "${travistest}" ]; then getopt=$1 core_getopt.sh fi diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index faeb0e616..b6bbd5edc 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,8 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -travistest="1" -version="v19.6.0" +version="v19.9.0" shortname="ts3" gameservername="ts3server" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -48,6 +47,9 @@ userinput="${1}" if [ ! -v TRAVIS ]; then TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" +else + servicename="travis" + travistest="1" fi ## GitHub Branch Select @@ -65,8 +67,6 @@ core_functions.sh(){ # Bootstrap # Fetches the core functions required before passed off to core_dl.sh. - -# Fetches core functions. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" local_filedir="${2}" @@ -281,15 +281,15 @@ if [ "$(whoami)" == "root" ]; then fi fi -# Download the latest serverlist. This is the complete list of all supported servers. -fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" -if [ ! -f "${serverlist}" ]; then - echo "[ FAIL ] serverlist.csv could not be loaded." - exit 1 -fi - # LinuxGSM installer mode. if [ "${shortname}" == "core" ]; then + # Download the latest serverlist. This is the complete list of all supported servers. + fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + if [ ! -f "${serverlist}" ]; then + echo "[ FAIL ] serverlist.csv could not be loaded." + exit 1 + fi + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then { tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' @@ -381,7 +381,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then + if [ -z "${travistest}" ]; then getopt=$1 core_getopt.sh fi