|
|
@ -41,14 +41,16 @@ configdirserver="${configdir}/${gameservername}" |
|
|
|
configdirdefault="${lgsmdir}/config-default" |
|
|
|
userinput="${1}" |
|
|
|
|
|
|
|
# Allows for testing not on Travis CI |
|
|
|
if [ ! -v TRAVIS ]; then |
|
|
|
# Allows for testing not on Travis CI. |
|
|
|
# if using travis for tests |
|
|
|
if [ -n "${TRAVIS}" ]; then |
|
|
|
selfname="travis" |
|
|
|
# if not using travis for tests |
|
|
|
else |
|
|
|
TRAVIS_BRANCH="develop" |
|
|
|
TRAVIS_BUILD_DIR="${rootdir}" |
|
|
|
else |
|
|
|
selfname="travis" |
|
|
|
travistest="1" |
|
|
|
fi |
|
|
|
travistest="1" |
|
|
|
|
|
|
|
## GitHub Branch Select |
|
|
|
# Allows for the use of different function files |
|
|
@ -242,7 +244,7 @@ fn_install_file(){ |
|
|
|
if [ -e "${local_filename}" ]; then |
|
|
|
i=2 |
|
|
|
while [ -e "${local_filename}-${i}" ] ; do |
|
|
|
let i++ |
|
|
|
(( i++ )) |
|
|
|
done |
|
|
|
local_filename="${local_filename}-${i}" |
|
|
|
fi |
|
|
@ -353,19 +355,24 @@ else |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
# shellcheck source=/dev/null |
|
|
|
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" |
|
|
|
# shellcheck source=/dev/null |
|
|
|
source "${configdirserver}/common.cfg" |
|
|
|
else |
|
|
|
# shellcheck source=/dev/null |
|
|
|
source "${configdirserver}/common.cfg" |
|
|
|
fi |
|
|
|
# Load the instance.cfg config. If missing download it. |
|
|
|
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then |
|
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
|
# shellcheck source=/dev/null |
|
|
|
source "${configdirserver}/${selfname}.cfg" |
|
|
|
else |
|
|
|
# shellcheck source=/dev/null |
|
|
|
source "${configdirserver}/${selfname}.cfg" |
|
|
|
fi |
|
|
|
|
|
|
@ -377,7 +384,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 [ -z "${travistest}" ]; then |
|
|
|
if [ "${travistest}" != "1" ]; then |
|
|
|
getopt=$1 |
|
|
|
core_getopt.sh |
|
|
|
fi |
|
|
@ -392,15 +399,6 @@ fn_currentstatus_tmux(){ |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
fn_currentstatus_ts3(){ |
|
|
|
check_status.sh |
|
|
|
if [ "${status}" != "0" ]; then |
|
|
|
currentstatus="ONLINE" |
|
|
|
else |
|
|
|
currentstatus="OFFLINE" |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
fn_setstatus(){ |
|
|
|
fn_currentstatus_tmux |
|
|
|
echo"" |
|
|
@ -490,9 +488,64 @@ echo -e "" |
|
|
|
echo -e "=================================" |
|
|
|
echo -e "Server Tests" |
|
|
|
echo -e "Using: ${gamename}" |
|
|
|
echo -e "Testing Branch: $TRAVIS_BRANCH" |
|
|
|
echo -e "Testing Branch: ${TRAVIS_BRANCH}" |
|
|
|
echo -e "=================================" |
|
|
|
|
|
|
|
echo -e "" |
|
|
|
echo -e "Tests Summary" |
|
|
|
echo -e "=================================" |
|
|
|
echo -e "0.0 - Pre-test Tasks" |
|
|
|
echo -e "0.1 - Create log dir's" |
|
|
|
echo -e "0.2 - Enable dev-debug" |
|
|
|
echo -e "" |
|
|
|
echo -e "1.0 - Pre-install tests" |
|
|
|
echo -e "1.1 - start - no files" |
|
|
|
echo -e "1.2 - getopt" |
|
|
|
echo -e "1.3 - getopt with incorrect args" |
|
|
|
echo -e "" |
|
|
|
echo -e "2.0 - Installation" |
|
|
|
echo -e "2.1 - install" |
|
|
|
echo -e "" |
|
|
|
echo -e "3.0 - Start/Stop/Restart Tests" |
|
|
|
echo -e "3.1 - start" |
|
|
|
echo -e "3.2 - start - online" |
|
|
|
echo -e "3.3 - start - updateonstart" |
|
|
|
echo -e "3.4 - stop" |
|
|
|
echo -e "3.5 - stop - offline" |
|
|
|
echo -e "3.6 - restart" |
|
|
|
echo -e "3.7 - restart - offline" |
|
|
|
echo -e "" |
|
|
|
echo -e "4.0 - Update Tests" |
|
|
|
echo -e "4.1 - update" |
|
|
|
echo -e "4.2 - update - change buildid" |
|
|
|
echo -e "4.3 - update - change buildid - online" |
|
|
|
echo -e "4.4 - update - remove appmanifest file" |
|
|
|
echo -e "4.5 - force-update" |
|
|
|
echo -e "4.6 - force-update - online" |
|
|
|
echo -e "4.7 - validate" |
|
|
|
echo -e "4.8 - validate - online" |
|
|
|
echo -e "4.9 - update-lgsm" |
|
|
|
echo -e "" |
|
|
|
echo -e "5.0 - Monitor Tests" |
|
|
|
echo -e "5.1 - monitor - online" |
|
|
|
echo -e "5.2 - monitor - offline - with lockfile" |
|
|
|
echo -e "5.3 - monitor - offline - no lockfile" |
|
|
|
echo -e "5.4 - test-alert" |
|
|
|
echo -e "" |
|
|
|
echo -e "6.0 - Details Tests" |
|
|
|
echo -e "6.1 - details" |
|
|
|
echo -e "6.2 - postdetails" |
|
|
|
echo -e "" |
|
|
|
echo -e "7.0 - Backup Tests" |
|
|
|
echo -e "7.1 - backup" |
|
|
|
echo -e "" |
|
|
|
echo -e "8.0 - Development Tools Tests" |
|
|
|
echo -e "8.1 - dev - detect glibc" |
|
|
|
echo -e "8.2 - dev - detect ldd" |
|
|
|
echo -e "8.3 - dev - detect deps" |
|
|
|
echo -e "8.4 - dev - query-raw" |
|
|
|
echo -e "" |
|
|
|
echo -e "9.0 - Donate" |
|
|
|
echo -e "9.1 - donate" |
|
|
|
echo -e "" |
|
|
|
echo -e "0.0 - Pre-test Tasks" |
|
|
|
echo -e "==================================================================" |
|
|
@ -543,7 +596,7 @@ echo -e "test script reaction to missing server files." |
|
|
|
echo -e "Command: ./${gameservername} start" |
|
|
|
echo -e "" |
|
|
|
# Allows for testing not on Travis CI |
|
|
|
if [ ! -v TRAVIS ]; then |
|
|
|
if [ -z "${TRAVIS}" ]; then |
|
|
|
( |
|
|
|
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" |
|
|
|
BASH_XTRACEFD="5" |
|
|
@ -601,7 +654,7 @@ echo -e "2.0 - Installation" |
|
|
|
echo -e "==================================================================" |
|
|
|
|
|
|
|
echo -e "" |
|
|
|
echo -e "2.0 - install" |
|
|
|
echo -e "2.1 - install" |
|
|
|
echo -e "=================================" |
|
|
|
echo -e "Description:" |
|
|
|
echo -e "install ${gamename} server." |
|
|
@ -917,6 +970,26 @@ echo -e "run order" |
|
|
|
echo -e "=================" |
|
|
|
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' |
|
|
|
|
|
|
|
echo -e "" |
|
|
|
echo -e "4.9 - update-lgsm" |
|
|
|
echo -e "=================================" |
|
|
|
echo -e "Description:" |
|
|
|
echo -e "update LinuxGSM." |
|
|
|
echo -e "" |
|
|
|
echo -e "Command: ./jc2server update-lgam" |
|
|
|
requiredstatus="ONLINE" |
|
|
|
fn_setstatus |
|
|
|
( |
|
|
|
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" |
|
|
|
BASH_XTRACEFD="5" |
|
|
|
set -x |
|
|
|
command_update_linuxgsm.sh |
|
|
|
) |
|
|
|
fn_test_result_pass |
|
|
|
echo -e "run order" |
|
|
|
echo -e "=================" |
|
|
|
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' |
|
|
|
|
|
|
|
echo -e "" |
|
|
|
echo -e "Inserting IP address" |
|
|
|
echo -e "=================================" |
|
|
@ -1165,6 +1238,29 @@ echo -e "run order" |
|
|
|
echo -e "=================" |
|
|
|
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' |
|
|
|
|
|
|
|
echo -e "" |
|
|
|
echo -e "9.0 - Donate" |
|
|
|
echo -e "==================================================================" |
|
|
|
|
|
|
|
echo -e "" |
|
|
|
echo -e "9.1 - donate" |
|
|
|
echo -e "=================================" |
|
|
|
echo -e "Description:" |
|
|
|
echo -e "donate." |
|
|
|
echo -e "Command: ./${gameservername} donate" |
|
|
|
requiredstatus="ONLINE" |
|
|
|
fn_setstatus |
|
|
|
( |
|
|
|
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" |
|
|
|
BASH_XTRACEFD="5" |
|
|
|
set -x |
|
|
|
command_donate.sh |
|
|
|
) |
|
|
|
fn_test_result_pass |
|
|
|
echo -e "run order" |
|
|
|
echo -e "=================" |
|
|
|
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' |
|
|
|
|
|
|
|
echo -e "" |
|
|
|
echo -e "=================================" |
|
|
|
echo -e "Server Tests - Complete!" |
|
|
@ -1172,8 +1268,4 @@ echo -e "Using: ${gamename}" |
|
|
|
echo -e "=================================" |
|
|
|
requiredstatus="OFFLINE" |
|
|
|
fn_setstatus |
|
|
|
if [ ! -v TRAVIS ]; then |
|
|
|
fn_print_info "Tidying up directories." |
|
|
|
rm -rfv "${serverfiles:?}" |
|
|
|
fi |
|
|
|
core_exit.sh |
|
|
|