Browse Source

feat(travis-ci): update test script to match linuxgsm.sh

pull/2217/head
Daniel Gibbs 7 years ago
parent
commit
aaeb4a14d6
  1. 10
      tests/tests_fctrserver.sh
  2. 164
      tests/tests_jc2server.sh
  3. 172
      tests/tests_ts3server.sh

10
tests/tests_fctrserver.sh

@ -460,6 +460,14 @@ fn_test_result_fail(){
fi
}
# test result n/a
fn_test_result_na(){
echo "================================="
echo "Expected result: N/A"
echo "Actual result: N/A"
fn_print_fail_nl "TEST N/A"
}
echo "================================="
echo "Travis CI Tests"
echo "Linux Game Server Manager"
@ -578,7 +586,7 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "2.0 - Instalation"
echo "2.0 - Installation"
echo "=================================================================="
echo ""

164
tests/tests_jc2server.sh

@ -8,7 +8,7 @@
# Website: https://linuxgsm.com
travistest="1"
version="180409"
version="190303"
shortname="jc2"
gameservername="jc2server"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
@ -23,9 +23,13 @@ serverfiles="${rootdir}/serverfiles"
functionsdir="${lgsmdir}/functions"
libdir="${lgsmdir}/lib"
tmpdir="${lgsmdir}/tmp"
datadir="${lgsmdir}/data"
serverlist="${datadir}/serverlist.csv"
serverlistmenu="${datadir}/serverlistmenu.csv"
configdir="${lgsmdir}/config-lgsm"
configdirserver="${configdir}/${gameservername}"
configdirdefault="${lgsmdir}/config-default"
userinput="${1}"
# Allows for testing not on Travis CI
if [ ! -v TRAVIS ]; then
@ -40,16 +44,16 @@ githubuser="GameServerManagers"
githubrepo="LinuxGSM"
githubbranch="${TRAVIS_BRANCH}"
# Core Function that is required first
# Core function that is required first.
core_functions.sh(){
functionfile="${FUNCNAME}"
fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
}
# Bootstrap
# Fetches the core functions required before passed off to core_dl.sh
# Fetches the core functions required before passed off to core_dl.sh.
# Fetches core functions
# Fetches core functions.
fn_bootstrap_fetch_file(){
remote_fileurl="${1}"
local_filedir="${2}"
@ -58,42 +62,42 @@ fn_bootstrap_fetch_file(){
run="${5:-0}"
forcedl="${6:-0}"
md5="${7:-0}"
# download file if missing or download forced
# Download file if missing or download forced.
if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then
if [ ! -d "${local_filedir}" ]; then
mkdir -p "${local_filedir}"
fi
# Defines curl path
# Defines curl path.
curlpath=$(command -v curl 2>/dev/null)
# If curl exists download file
# If curl exists download file.
if [ "$(basename "${curlpath}")" == "curl" ]; then
# trap to remove part downloaded files
# Trap to remove part downloaded files.
echo -en " fetching ${local_filename}...\c"
curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
local exitcode=$?
if [ ${exitcode} -ne 0 ]; then
echo -e "\e[0;31mFAIL\e[0m\n"
echo -e "FAIL"
if [ -f "${lgsmlog}" ]; then
echo -e "${remote_fileurl}" | tee -a "${lgsmlog}"
echo "${curlcmd}" | tee -a "${lgsmlog}"
fi
exit 1
else
echo -e "\e[0;32mOK\e[0m"
echo -e "OK"
fi
else
echo "[ FAIL ] Curl is not installed"
exit 1
fi
# make file chmodx if chmodx is set
# Make file chmodx if chmodx is set.
if [ "${chmodx}" == "chmodx" ]; then
chmod +x "${local_filedir}/${local_filename}"
fi
fi
if [ -f "${local_filedir}/${local_filename}" ]; then
# run file if run is set
# Run file if run is set.
if [ "${run}" == "run" ]; then
source "${local_filedir}/${local_filename}"
fi
@ -112,11 +116,11 @@ fn_bootstrap_fetch_file_github(){
run="${5:-0}"
forcedl="${6:-0}"
md5="${7:-0}"
# Passes vars to the file download function
# Passes vars to the file download function.
fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
}
# Installer menu
# Installer menu.
fn_print_center() {
columns="$(tput cols)"
@ -129,7 +133,7 @@ fn_print_horizontal(){
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}"
}
# Bash Menu
# Bash menu.
fn_install_menu_bash() {
local resultvar=$1
title=$2
@ -153,7 +157,7 @@ fn_install_menu_bash() {
done
}
# Whiptail/Dialog Menu
# Whiptail/Dialog menu.
fn_install_menu_whiptail() {
local menucmd=$1
local resultvar=$2
@ -178,14 +182,14 @@ fn_install_menu_whiptail() {
fi
}
# Menu selector
# Menu selector.
fn_install_menu() {
local resultvar=$1
local selection=""
title=$2
caption=$3
options=$4
# Get menu command
# Get menu command.
for menucmd in whiptail dialog bash; do
if [ -x "$(command -v "${menucmd}")" ]; then
menucmd=$(command -v "${menucmd}")
@ -201,7 +205,7 @@ fn_install_menu() {
eval "$resultvar=\"${selection}\""
}
# Gets server info from serverlist.csv and puts in to array
# Gets server info from serverlist.csv and puts in to array.
fn_server_info(){
IFS=","
server_info_array=($(grep -aw "${userinput}" "${serverlist}"))
@ -219,7 +223,7 @@ fn_install_getopt(){
echo -e ""
echo -e "Commands"
echo -e "install\t\t| Select server to install."
echo -e "servername\t| e.g $0 csgoserver. Enter name of server/game to install."
echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver."
echo -e "list\t\t| List all servers available for install."
exit
}
@ -248,9 +252,14 @@ fn_install_file(){
exit
}
# Prevent from running this script as root.
# Prevent LinuxGSM from running as root. Except if doing a dependency install.
if [ "$(whoami)" == "root" ]; then
if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then
if [ "${shortname}" == "core" ]; then
echo "[ FAIL ] Do NOT run this script as root!"
exit 1
fi
elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
echo "[ FAIL ] Do NOT run this script as root!"
exit 1
else
@ -259,12 +268,8 @@ if [ "$(whoami)" == "root" ]; then
fi
fi
# LinuxGSM installer mode
# LinuxGSM installer mode.
if [ "${shortname}" == "core" ]; then
userinput=$1
datadir="${tmpdir}/data"
serverlist="${datadir}/serverlist.csv"
# 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
@ -272,13 +277,14 @@ if [ "${shortname}" == "core" ]; then
exit 1
fi
if [ "${userinput}" == "list" ]; then
if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then
{
awk -F "," '{print $2 "\t" $3}' "${serverlist}"
tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}'
} | column -s $'\t' -t | more
exit
elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then
fn_install_menu result "LinuxGSM" "Select game to install" "${serverlist}"
tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
userinput="${result}"
fn_server_info
if [ "${result}" == "${gameservername}" ]; then
@ -301,65 +307,67 @@ if [ "${shortname}" == "core" ]; then
fn_install_getopt
fi
# LinuxGSM Server Mode
# LinuxGSM server mode.
else
core_functions.sh
# Load LinuxGSM configs
# These are required to get all the default variables for the specific server.
# Load the default config. If missing download it. If changed reload it.
if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
fi
if [ ! -f "${configdirserver}/_default.cfg" ]; then
mkdir -p "${configdirserver}"
echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
echo -e "\e[0;31mFAIL\e[0m\n"
exit 1
else
echo -e "\e[0;32mOK\e[0m"
if [ "${shortname}" != "core-dep" ]; then
# Load LinuxGSM configs.
# These are required to get all the default variables for the specific server.
# Load the default config. If missing download it. If changed reload it.
if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
fi
else
function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
if [ "${function_file_diff}" != "" ]; then
fn_print_warn_nl "_default.cfg has been altered. reloading config."
if [ ! -f "${configdirserver}/_default.cfg" ]; then
mkdir -p "${configdirserver}"
echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
echo -e "\e[0;31mFAIL\e[0m\n"
echo -e "FAIL"
exit 1
else
echo -e "\e[0;32mOK\e[0m"
echo -e "OK"
fi
else
function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
if [ "${function_file_diff}" != "" ]; then
fn_print_warn_nl "_default.cfg has been altered. reloading config."
echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
echo -e "FAIL"
exit 1
else
echo -e "OK"
fi
fi
fi
source "${configdirserver}/_default.cfg"
# Load the common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
source "${configdirserver}/common.cfg"
else
source "${configdirserver}/common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
source "${configdirserver}/${servicename}.cfg"
else
source "${configdirserver}/${servicename}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
fi
fi
source "${configdirserver}/_default.cfg"
# Load the common.cfg config. If missing download it
if [ ! -f "${configdirserver}/common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
source "${configdirserver}/common.cfg"
else
source "${configdirserver}/common.cfg"
fi
# Load the instance.cfg config. If missing download it
if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
source "${configdirserver}/${servicename}.cfg"
else
source "${configdirserver}/${servicename}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
fi
# Prevents running of core_exit.sh for Travis.
if [ -z "${travistest}" ]; then
# 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
getopt=$1
core_getopt.sh
fi
@ -578,7 +586,7 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "2.0 - Instalation"
echo "2.0 - Installation"
echo "=================================================================="
echo ""

172
tests/tests_ts3server.sh

@ -8,7 +8,7 @@
# Website: https://linuxgsm.com
travistest="1"
version="180409"
version="190303"
shortname="ts3"
gameservername="ts3server"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
@ -23,9 +23,13 @@ serverfiles="${rootdir}/serverfiles"
functionsdir="${lgsmdir}/functions"
libdir="${lgsmdir}/lib"
tmpdir="${lgsmdir}/tmp"
datadir="${lgsmdir}/data"
serverlist="${datadir}/serverlist.csv"
serverlistmenu="${datadir}/serverlistmenu.csv"
configdir="${lgsmdir}/config-lgsm"
configdirserver="${configdir}/${gameservername}"
configdirdefault="${lgsmdir}/config-default"
userinput="${1}"
# Allows for testing not on Travis CI
if [ ! -v TRAVIS ]; then
@ -40,16 +44,16 @@ githubuser="GameServerManagers"
githubrepo="LinuxGSM"
githubbranch="${TRAVIS_BRANCH}"
# Core Function that is required first
# Core function that is required first.
core_functions.sh(){
functionfile="${FUNCNAME}"
fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
}
# Bootstrap
# Fetches the core functions required before passed off to core_dl.sh
# Fetches the core functions required before passed off to core_dl.sh.
# Fetches core functions
# Fetches core functions.
fn_bootstrap_fetch_file(){
remote_fileurl="${1}"
local_filedir="${2}"
@ -58,42 +62,42 @@ fn_bootstrap_fetch_file(){
run="${5:-0}"
forcedl="${6:-0}"
md5="${7:-0}"
# download file if missing or download forced
# Download file if missing or download forced.
if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then
if [ ! -d "${local_filedir}" ]; then
mkdir -p "${local_filedir}"
fi
# Defines curl path
# Defines curl path.
curlpath=$(command -v curl 2>/dev/null)
# If curl exists download file
# If curl exists download file.
if [ "$(basename "${curlpath}")" == "curl" ]; then
# trap to remove part downloaded files
# Trap to remove part downloaded files.
echo -en " fetching ${local_filename}...\c"
curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
local exitcode=$?
if [ ${exitcode} -ne 0 ]; then
echo -e "\e[0;31mFAIL\e[0m\n"
echo -e "FAIL"
if [ -f "${lgsmlog}" ]; then
echo -e "${remote_fileurl}" | tee -a "${lgsmlog}"
echo "${curlcmd}" | tee -a "${lgsmlog}"
fi
exit 1
else
echo -e "\e[0;32mOK\e[0m"
echo -e "OK"
fi
else
echo "[ FAIL ] Curl is not installed"
exit 1
fi
# make file chmodx if chmodx is set
# Make file chmodx if chmodx is set.
if [ "${chmodx}" == "chmodx" ]; then
chmod +x "${local_filedir}/${local_filename}"
fi
fi
if [ -f "${local_filedir}/${local_filename}" ]; then
# run file if run is set
# Run file if run is set.
if [ "${run}" == "run" ]; then
source "${local_filedir}/${local_filename}"
fi
@ -112,11 +116,11 @@ fn_bootstrap_fetch_file_github(){
run="${5:-0}"
forcedl="${6:-0}"
md5="${7:-0}"
# Passes vars to the file download function
# Passes vars to the file download function.
fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
}
# Installer menu
# Installer menu.
fn_print_center() {
columns="$(tput cols)"
@ -129,7 +133,7 @@ fn_print_horizontal(){
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}"
}
# Bash Menu
# Bash menu.
fn_install_menu_bash() {
local resultvar=$1
title=$2
@ -153,7 +157,7 @@ fn_install_menu_bash() {
done
}
# Whiptail/Dialog Menu
# Whiptail/Dialog menu.
fn_install_menu_whiptail() {
local menucmd=$1
local resultvar=$2
@ -178,14 +182,14 @@ fn_install_menu_whiptail() {
fi
}
# Menu selector
# Menu selector.
fn_install_menu() {
local resultvar=$1
local selection=""
title=$2
caption=$3
options=$4
# Get menu command
# Get menu command.
for menucmd in whiptail dialog bash; do
if [ -x "$(command -v "${menucmd}")" ]; then
menucmd=$(command -v "${menucmd}")
@ -201,7 +205,7 @@ fn_install_menu() {
eval "$resultvar=\"${selection}\""
}
# Gets server info from serverlist.csv and puts in to array
# Gets server info from serverlist.csv and puts in to array.
fn_server_info(){
IFS=","
server_info_array=($(grep -aw "${userinput}" "${serverlist}"))
@ -219,7 +223,7 @@ fn_install_getopt(){
echo -e ""
echo -e "Commands"
echo -e "install\t\t| Select server to install."
echo -e "servername\t| e.g $0 csgoserver. Enter name of server/game to install."
echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver."
echo -e "list\t\t| List all servers available for install."
exit
}
@ -248,9 +252,14 @@ fn_install_file(){
exit
}
# Prevent from running this script as root.
# Prevent LinuxGSM from running as root. Except if doing a dependency install.
if [ "$(whoami)" == "root" ]; then
if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then
if [ "${shortname}" == "core" ]; then
echo "[ FAIL ] Do NOT run this script as root!"
exit 1
fi
elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
echo "[ FAIL ] Do NOT run this script as root!"
exit 1
else
@ -259,12 +268,8 @@ if [ "$(whoami)" == "root" ]; then
fi
fi
# LinuxGSM installer mode
# LinuxGSM installer mode.
if [ "${shortname}" == "core" ]; then
userinput=$1
datadir="${tmpdir}/data"
serverlist="${datadir}/serverlist.csv"
# 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
@ -272,13 +277,14 @@ if [ "${shortname}" == "core" ]; then
exit 1
fi
if [ "${userinput}" == "list" ]; then
if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then
{
awk -F "," '{print $2 "\t" $3}' "${serverlist}"
tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}'
} | column -s $'\t' -t | more
exit
elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then
fn_install_menu result "LinuxGSM" "Select game to install" "${serverlist}"
tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
userinput="${result}"
fn_server_info
if [ "${result}" == "${gameservername}" ]; then
@ -301,65 +307,67 @@ if [ "${shortname}" == "core" ]; then
fn_install_getopt
fi
# LinuxGSM Server Mode
# LinuxGSM server mode.
else
core_functions.sh
# Load LinuxGSM configs
# These are required to get all the default variables for the specific server.
# Load the default config. If missing download it. If changed reload it.
if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
fi
if [ ! -f "${configdirserver}/_default.cfg" ]; then
mkdir -p "${configdirserver}"
echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
echo -e "\e[0;31mFAIL\e[0m\n"
exit 1
else
echo -e "\e[0;32mOK\e[0m"
if [ "${shortname}" != "core-dep" ]; then
# Load LinuxGSM configs.
# These are required to get all the default variables for the specific server.
# Load the default config. If missing download it. If changed reload it.
if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
fi
else
function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
if [ "${function_file_diff}" != "" ]; then
fn_print_warn_nl "_default.cfg has been altered. reloading config."
if [ ! -f "${configdirserver}/_default.cfg" ]; then
mkdir -p "${configdirserver}"
echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
echo -e "\e[0;31mFAIL\e[0m\n"
echo -e "FAIL"
exit 1
else
echo -e "\e[0;32mOK\e[0m"
echo -e "OK"
fi
else
function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
if [ "${function_file_diff}" != "" ]; then
fn_print_warn_nl "_default.cfg has been altered. reloading config."
echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
echo -e "FAIL"
exit 1
else
echo -e "OK"
fi
fi
fi
source "${configdirserver}/_default.cfg"
# Load the common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
source "${configdirserver}/common.cfg"
else
source "${configdirserver}/common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
source "${configdirserver}/${servicename}.cfg"
else
source "${configdirserver}/${servicename}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
fi
fi
source "${configdirserver}/_default.cfg"
# Load the common.cfg config. If missing download it
if [ ! -f "${configdirserver}/common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
source "${configdirserver}/common.cfg"
else
source "${configdirserver}/common.cfg"
fi
# Load the instance.cfg config. If missing download it
if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
source "${configdirserver}/${servicename}.cfg"
else
source "${configdirserver}/${servicename}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
fi
# Prevents running of core_exit.sh for Travis.
if [ -z "${travistest}" ]; then
# 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
getopt=$1
core_getopt.sh
fi
@ -452,6 +460,14 @@ fn_test_result_fail(){
fi
}
# test result n/a
fn_test_result_na(){
echo "================================="
echo "Expected result: N/A"
echo "Actual result: N/A"
fn_print_fail_nl "TEST N/A"
}
echo "================================="
echo "Travis CI Tests"
echo "Linux Game Server Manager"
@ -570,7 +586,7 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "2.0 - Instalation"
echo "2.0 - Installation"
echo "=================================================================="
echo ""

Loading…
Cancel
Save