Merge branch 'develop' into master

This commit is contained in:
Daniel Gibbs 2019-01-06 22:10:54 +00:00 committed by GitHub
commit 7cfb960866
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 474 additions and 252 deletions

View File

@ -4,48 +4,41 @@ name: Bug report
about: Found a bug? Raise a report
---
Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you post the correct info.
For general support visit the **[steam group](https://linuxgsm.com/steam)**.
For general support visit the **[LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support)**.
GitHub is **ONLY** for:
```
Issues here are **ONLY** for:
* LinuxGSM bugs
* feature suggestions
* code contributions
```
GitHub is **NOT** for:
```
Issues here are **NOT** for:
* General support
* Specific game server issues (e.g CS:GO, TF2)
* Dedicated server issues (e.g Ubuntu, CentOS)
* Anything not directly related to LinuxGSM development
```
Any general support issues on GitHub will be closed.
*Please use the template below*
**Basic info**
Game:
Distro:
## User Story
As a [user description], I want [desired action] so that [desired outcome]
**Describe the bug**
A clear and concise description of what the bug is.
## Basic info
- Distro [Ubuntu 18.04]
- Game [Garry's Mod]
- Feature [Monitor]
**To Reproduce**
## Further Information
A clear description of what the bug is and any ideas on how to resolve it. Plus any further context that might be relevant to the issue.
## To Reproduce
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behaviour**
A clear and concise description of what you expected to happen.
**Minimum Information**
The game server you are running (e.g. Rust/CS:GO).
The link from `./gameserver postdetails` command.
**Additional context**
Add any other context about the problem here.
## Expected behaviour
A what you expected to happen.

View File

@ -3,16 +3,15 @@ name: Feature request
about: Suggest an idea for this project
---
Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you post the correct info.
For general support visit the **[steam group](https://linuxgsm.com/steam)**.
For general support visit the **[LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support)**.
GitHub is **ONLY** for:
Issues here are **ONLY** for:
* LinuxGSM bugs
* feature suggestions
* code contributions
GitHub is **NOT** for:
Issues here are **NOT** for:
* General support
* Specific game server issues (e.g CS:GO, TF2)
* Dedicated server issues (e.g Ubuntu, CentOS)
@ -22,18 +21,16 @@ Any general support issues on GitHub will be closed.
*Please use the template below*
**Basic info**
Game:
Distro:
## User Story
As a [user description], I want [desired action] so that [desired outcome]
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
## Basic info
- Distro [Ubuntu 18.04]
- Game [Garry's Mod]
- Feature [Monitor]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
## Further Information
A clear description of what the feature is and any ideas on how to achieve this.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
## Further Reading
Provide any useful documentation or resources that might help.

View File

@ -4,13 +4,13 @@ about: Suggest a new game server to be added
---
**What game server would you like adding?**
## What game server would you like adding?
**Can you link to any tutorials or guides?**
Any useful guides will help with development
## Can you link to any tutorials or guides?
Provide any useful documentation or resources that might help.
**Is the server on Steam?**
## Is the server on Steam?
If yes Use SteamDB to get the appid. (https://steamdb.info)
**Is the server supported on Linux?**
We only support Linux servers and do not support Wine.
## Is the server supported on Linux?
We only support Linux servers and do not support Wine.

View File

@ -1,14 +1,15 @@
language: bash
dist: trusty
dist: xenial
sudo: required
language: node_js
node_js:
- 10
before_script:
- curl -L "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz" | tar zx
install:
npm install gamedig
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- mailutils
- postfix

View File

@ -1,17 +1,15 @@
Please select the "Preview" tab above to view this message correctly.
Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you post the correct info.
For general support visit the **[steam group](https://linuxgsm.com/steam)**
For general support visit the **[LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support)**.
GitHub is **ONLY** for:
Issues here are **ONLY** for:
* LinuxGSM bugs
* feature suggestions
* code contributions
GitHub is **NOT** for:
Issues here are **NOT** for:
* General support
* Specific game server issues (e.g CS:GO, TF2)
* Dedicated server issues (e.g Ubuntu, CentOS)
* Anything not directly related to LinuxGSM development
**Any general support issues on GitHub will be closed.**
Any general support issues on GitHub will be closed.

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@ maxplayers="32"
## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){
parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}"
parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_homepath ${serverfiles} +set sv_authorizemode "-1" +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}"
}
#### LinuxGSM Settings ####

View File

@ -41,4 +41,18 @@ echo "./query_gsquery.py -a \"${ip}\" -p \"${queryport}\" -e \"${engine}\""
if [ ! -f "${functionsdir}/query_gsquery.py" ]; then
fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5"
fi
"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}"
"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}"
echo""
echo "================================="
echo "tcp Raw Output"
echo "================================="
echo""
echo "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''"
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
querystatus="$?"
if [ "${querystatus}" == "0" ]; then
echo "tcp query PASS"
else
echo "tcp query FAIL"
fi

View File

@ -13,6 +13,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_monitor_loop(){
# Will query up to 5 times every 15 seconds.
# Query will wait up to 60 seconds to confirm server is down giving server time if changing map.
totalseconds=0
for queryattempt in {1..5}; do
fn_print_dots "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_querying_eol

View File

@ -87,26 +87,39 @@ fn_stop_graceful_goldsource(){
# Attempts graceful of 7 Days To Die using telnet.
fn_stop_telnet_sdtd(){
if [ -z "${telnetpass}" ]; then
telnetpass="NOTSET"
fi
sdtd_telnet_shutdown=$( expect -c '
proc abort {} {
puts "Timeout or EOF\n"
exit 1
}
spawn telnet '"${telnetip}"' '"${telnetport}"'
expect {
"password:" { send "'"${telnetpass}"'\r" }
default abort
}
expect {
"session." { send "shutdown\r" }
default abort
}
expect { eof }
puts "Completed.\n"
')
if [ -z "${telnetpass}" ]||[ "${telnetpass}" == "NOT SET" ]; then
sdtd_telnet_shutdown=$( expect -c '
proc abort {} {
puts "Timeout or EOF\n"
exit 1
}
spawn telnet '"${telnetip}"' '"${telnetport}"'
expect {
"session." { send "shutdown\r" }
default abort
}
expect { eof }
puts "Completed.\n"
')
else
sdtd_telnet_shutdown=$( expect -c '
proc abort {} {
puts "Timeout or EOF\n"
exit 1
}
spawn telnet '"${telnetip}"' '"${telnetport}"'
expect {
"password:" { send "'"${telnetpass}"'\r" }
default abort
}
expect {
"session." { send "shutdown\r" }
default abort
}
expect { eof }
puts "Completed.\n"
')
fi
}
fn_stop_graceful_sdtd(){
@ -118,16 +131,16 @@ fn_stop_graceful_sdtd(){
elif [ "$(command -v expect 2>/dev/null)" ]; then
# Tries to shutdown with both localhost and server IP.
for telnetip in 127.0.0.1 ${ip}; do
fn_print_dots "Graceful: telnet: ${telnetip}"
fn_script_log_info "Graceful: telnet: ${telnetip}"
fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}"
fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}"
sleep 0.5
fn_stop_telnet_sdtd
completed=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Completed.")
refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF")
if [ -n "${refused}" ]; then
fn_print_error "Graceful: telnet: ${telnetip}: "
fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : "
fn_print_fail_eol_nl
fn_script_log_error "Graceful: telnet: ${telnetip}: FAIL"
fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL"
sleep 1
elif [ -n "${completed}" ]; then
break
@ -141,9 +154,9 @@ fn_stop_graceful_sdtd(){
fn_stop_telnet_sdtd
refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF")
if [ -n "${refused}" ]; then
fn_print_ok "Graceful: telnet: ${telnetip}: "
fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : "
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: telnet: ${telnetip}: ${seconds} seconds"
fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds"
break
fi
sleep 1
@ -155,7 +168,7 @@ fn_stop_graceful_sdtd(){
if [ -n "${refused}" ]; then
fn_print_error "Graceful: telnet: "
fn_print_fail_eol_nl
fn_script_log_error "Graceful: telnet: ${telnetip}: FAIL"
fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL"
else
fn_print_error_nl "Graceful: telnet: Unknown error"
fn_script_log_error "Graceful: telnet: Unknown error"

View File

@ -921,7 +921,7 @@ fn_info_config_sdtd(){
servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
port=$(grep "ServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
queryport=$((port + 1))
queryport=${port:-"0"}
webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
@ -1253,4 +1253,4 @@ elif [ "${shortname}" == "squad" ]; then
# Stationeers
elif [ "${shortname}" == "st" ]; then
fn_info_config_stationeers
fi
fi

View File

@ -13,7 +13,7 @@ shortname="fctr"
gameservername="fctrserver"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
servicename="${selfname}"
servicename="${gameservername}"
lockselfname=".${servicename}.lock"
lgsmdir="${rootdir}/lgsm"
logdir="${rootdir}/log"
@ -467,11 +467,16 @@ echo "Testing Branch: $TRAVIS_BRANCH"
echo "================================="
echo ""
echo "0.1 - Create log dir's"
echo "================================="
echo "0.0 - Pre-test Tasks"
echo "=================================================================="
echo "Description:"
echo "Create log dir's"
echo ""
echo ""
echo "0.1 - Create log dir's"
echo "================================="
echo ""
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
@ -500,11 +505,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.0 - start - no files"
echo "1.0 - Pre-install tests"
echo "=================================================================="
echo ""
echo "1.1 - start - no files"
echo "================================="
echo "Description:"
echo "test script reaction to missing server files."
echo "Command: ./fctrserver start"
echo "Command: ./${gameservername} start"
echo ""
# Allows for testing not on Travis CI
if [ ! -v TRAVIS ]; then
@ -524,11 +533,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.1 - getopt"
echo "1.2 - getopt"
echo "================================="
echo "Description:"
echo "displaying options messages."
echo "Command: ./fctrserver"
echo "Command: ./${gameservername}"
echo ""
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
@ -542,11 +551,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.2 - getopt with incorrect args"
echo "1.3 - getopt with incorrect args"
echo "================================="
echo "Description:"
echo "displaying options messages."
echo "Command: ./fctrserver abc123"
echo "Command: ./${gameservername} abc123"
echo ""
getopt="abc123"
(
@ -560,12 +569,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "2.0 - Instalation"
echo "=================================================================="
echo ""
echo "2.0 - install"
echo "================================="
echo "Description:"
echo "install ${gamename} server."
echo "Command: ./fctrserver auto-install"
echo "Command: ./${gameservername} auto-install"
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
@ -577,12 +590,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "3.0 - Start/Stop/Restart Tests"
echo "=================================================================="
echo ""
echo "3.1 - start"
echo "================================="
echo "Description:"
echo "start ${gamename} server."
echo "Command: ./fctrserver start"
echo "Command: ./${gameservername} start"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -601,7 +618,7 @@ echo "3.2 - start - online"
echo "================================="
echo "Description:"
echo "start ${gamename} server while already running."
echo "Command: ./fctrserver start"
echo "Command: ./${gameservername} start"
requiredstatus="ONLINE"
fn_setstatus
(
@ -620,7 +637,7 @@ echo "3.3 - start - updateonstart"
echo "================================="
echo "Description:"
echo "will update server on start."
echo "Command: ./fctrserver start"
echo "Command: ./${gameservername} start"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -639,7 +656,7 @@ echo "3.4 - stop"
echo "================================="
echo "Description:"
echo "stop ${gamename} server."
echo "Command: ./fctrserver stop"
echo "Command: ./${gameservername} stop"
requiredstatus="ONLINE"
fn_setstatus
(
@ -658,7 +675,7 @@ echo "3.5 - stop - offline"
echo "================================="
echo "Description:"
echo "stop ${gamename} server while already stopped."
echo "Command: ./fctrserver stop"
echo "Command: ./${gameservername} stop"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -677,7 +694,7 @@ echo "3.6 - restart"
echo "================================="
echo "Description:"
echo "restart ${gamename}."
echo "Command: ./fctrserver restart"
echo "Command: ./${gameservername} restart"
requiredstatus="ONLINE"
fn_setstatus
(
@ -696,7 +713,7 @@ echo "3.7 - restart - offline"
echo "================================="
echo "Description:"
echo "restart ${gamename} while already stopped."
echo "Command: ./fctrserver restart"
echo "Command: ./${gameservername} restart"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -710,12 +727,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "4.0 - Update Tests"
echo "=================================================================="
echo ""
echo "4.1 - update"
echo "================================="
echo "Description:"
echo "check for updates."
echo "Command: ./fctrserver update"
echo "Command: ./${gameservername} update"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -729,12 +750,20 @@ echo "run order"
echo "================="
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}"
echo ""
echo "5.1 - monitor - online"
echo "================================="
echo "Description:"
echo "run monitor server while already running."
echo "Command: ./fctrserver monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="ONLINE"
fn_setstatus
(
@ -753,7 +782,7 @@ echo "5.2 - monitor - offline - with lockfile"
echo "================================="
echo "Description:"
echo "run monitor while server is offline with lockfile."
echo "Command: ./fctrserver monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="OFFLINE"
fn_setstatus
fn_print_info_nl "creating lockfile."
@ -774,7 +803,7 @@ echo "5.3 - monitor - offline - no lockfile"
echo "================================="
echo "Description:"
echo "run monitor while server is offline with no lockfile."
echo "Command: ./fctrserver monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -789,11 +818,34 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "6.0 - details"
echo "5.4 - test-alert"
echo "================================="
echo "Description:"
echo "run monitor while server is offline with no lockfile."
echo "Command: ./${gameservername} test-alert"
requiredstatus="OFFLINE"
fn_setstatus
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
set -x
command_test_alert.sh
)
fn_test_result_fail
echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "6.0 - Details Tests"
echo "=================================================================="
echo ""
echo "6.1 - details"
echo "================================="
echo "Description:"
echo "display details."
echo "Command: ./fctrserver details"
echo "Command: ./${gameservername} details"
requiredstatus="ONLINE"
fn_setstatus
(
@ -808,11 +860,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "6.1 - post details"
echo "6.2 - postdetails"
echo "================================="
echo "Description:"
echo "post details."
echo "Command: ./fctrserver postdetails"
echo "Command: ./${gameservername} postdetails"
requiredstatus="ONLINE"
fn_setstatus
(
@ -827,11 +879,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "7.0 - backup"
echo "7.0 - Backup Tests"
echo "=================================================================="
echo ""
echo "7.1 - backup"
echo "================================="
echo "Description:"
echo "run a backup."
echo "Command: ./fctrserver backup"
echo "Command: ./${gameservername} backup"
requiredstatus="ONLINE"
fn_setstatus
echo "test de-activated until issue #1839 fixed"
@ -842,11 +898,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.0 - dev - detect glibc"
echo "8.0 - Development Tools Tests"
echo "=================================================================="
echo ""
echo "8.1 - dev - detect glibc"
echo "================================="
echo "Description:"
echo "detect glibc."
echo "Command: ./fctrserver detect-glibc"
echo "Command: ./${gameservername} detect-glibc"
requiredstatus="ONLINE"
fn_setstatus
(
@ -861,11 +921,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.1 - dev - detect ldd"
echo "8.2 - dev - detect ldd"
echo "================================="
echo "Description:"
echo "detect ldd."
echo "Command: ./fctrserver detect-ldd"
echo "Command: ./${gameservername} detect-ldd"
requiredstatus="ONLINE"
fn_setstatus
(
@ -880,11 +940,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.2 - dev - detect deps"
echo "8.3 - dev - detect deps"
echo "================================="
echo "Description:"
echo "detect dependencies."
echo "Command: ./fctrserver detect-deps"
echo "Command: ./${gameservername} detect-deps"
requiredstatus="ONLINE"
fn_setstatus
(
@ -898,6 +958,25 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.4 - dev - query-raw"
echo "================================="
echo "Description:"
echo "raw query output."
echo "Command: ./${gameservername} query-raw"
requiredstatus="ONLINE"
fn_setstatus
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
set -x
command_dev_query_raw.sh
)
fn_test_result_na
echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "================================="
echo "Server Tests - Complete!"

View File

@ -13,7 +13,7 @@ shortname="jc2"
gameservername="jc2server"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
servicename="${selfname}"
servicename="${gameservername}"
lockselfname=".${servicename}.lock"
lgsmdir="${rootdir}/lgsm"
logdir="${rootdir}/log"
@ -359,7 +359,7 @@ else
fi
# Prevents running of core_exit.sh for Travis.
if [ "${travistest}" != "1" ]; then
if [ -z "${travistest}" ]; then
getopt=$1
core_getopt.sh
fi
@ -452,6 +452,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"
@ -467,11 +475,16 @@ echo "Testing Branch: $TRAVIS_BRANCH"
echo "================================="
echo ""
echo "0.1 - Create log dir's"
echo "================================="
echo "0.0 - Pre-test Tasks"
echo "=================================================================="
echo "Description:"
echo "Create log dir's"
echo ""
echo ""
echo "0.1 - Create log dir's"
echo "================================="
echo ""
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
@ -500,11 +513,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.0 - start - no files"
echo "1.0 - Pre-install tests"
echo "=================================================================="
echo ""
echo "1.1 - start - no files"
echo "================================="
echo "Description:"
echo "test script reaction to missing server files."
echo "Command: ./jc2server start"
echo "Command: ./${gameservername} start"
echo ""
# Allows for testing not on Travis CI
if [ ! -v TRAVIS ]; then
@ -524,11 +541,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.1 - getopt"
echo "1.2 - getopt"
echo "================================="
echo "Description:"
echo "displaying options messages."
echo "Command: ./jc2server"
echo "Command: ./${gameservername}"
echo ""
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
@ -542,11 +559,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.2 - getopt with incorrect args"
echo "1.3 - getopt with incorrect args"
echo "================================="
echo "Description:"
echo "displaying options messages."
echo "Command: ./jc2server abc123"
echo "Command: ./${gameservername} abc123"
echo ""
getopt="abc123"
(
@ -560,12 +577,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "2.0 - Instalation"
echo "=================================================================="
echo ""
echo "2.0 - install"
echo "================================="
echo "Description:"
echo "install ${gamename} server."
echo "Command: ./jc2server auto-install"
echo "Command: ./${gameservername} auto-install"
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
@ -577,12 +598,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "3.0 - Start/Stop/Restart Tests"
echo "=================================================================="
echo ""
echo "3.1 - start"
echo "================================="
echo "Description:"
echo "start ${gamename} server."
echo "Command: ./jc2server start"
echo "Command: ./${gameservername} start"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -601,7 +626,7 @@ echo "3.2 - start - online"
echo "================================="
echo "Description:"
echo "start ${gamename} server while already running."
echo "Command: ./jc2server start"
echo "Command: ./${gameservername} start"
requiredstatus="ONLINE"
fn_setstatus
(
@ -620,7 +645,7 @@ echo "3.3 - start - updateonstart"
echo "================================="
echo "Description:"
echo "will update server on start."
echo "Command: ./jc2server start"
echo "Command: ./${gameservername} start"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -639,7 +664,7 @@ echo "3.4 - stop"
echo "================================="
echo "Description:"
echo "stop ${gamename} server."
echo "Command: ./jc2server stop"
echo "Command: ./${gameservername} stop"
requiredstatus="ONLINE"
fn_setstatus
(
@ -658,7 +683,7 @@ echo "3.5 - stop - offline"
echo "================================="
echo "Description:"
echo "stop ${gamename} server while already stopped."
echo "Command: ./jc2server stop"
echo "Command: ./${gameservername} stop"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -677,7 +702,7 @@ echo "3.6 - restart"
echo "================================="
echo "Description:"
echo "restart ${gamename}."
echo "Command: ./jc2server restart"
echo "Command: ./${gameservername} restart"
requiredstatus="ONLINE"
fn_setstatus
(
@ -696,7 +721,7 @@ echo "3.7 - restart - offline"
echo "================================="
echo "Description:"
echo "restart ${gamename} while already stopped."
echo "Command: ./jc2server restart"
echo "Command: ./${gameservername} restart"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -710,12 +735,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "4.0 - Update Tests"
echo "=================================================================="
echo ""
echo "4.1 - update"
echo "================================="
echo "Description:"
echo "check for updates."
echo "Command: ./jc2server update"
echo "Command: ./${gameservername} update"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -879,12 +908,20 @@ travisip=$(ip -o -4 addr|grep eth0|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?
sed -i "/BindIP/c\BindIP = \"${travisip}\"," "${serverfiles}/config.lua"
echo "IP: ${travisip}"
echo ""
echo "5.0 - Monitor Tests"
echo "=================================================================="
echo ""
echo "Server IP - Port: ${ip}:${port}"
echo "Server IP - Query Port: ${ip}:${queryport}"
echo ""
echo "5.1 - monitor - online"
echo "================================="
echo "Description:"
echo "run monitor server while already running."
echo "Command: ./jc2server monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="ONLINE"
fn_setstatus
(
@ -903,7 +940,7 @@ echo "5.2 - monitor - offline - with lockfile"
echo "================================="
echo "Description:"
echo "run monitor while server is offline with lockfile."
echo "Command: ./jc2server monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="OFFLINE"
fn_setstatus
fn_print_info_nl "creating lockfile."
@ -924,7 +961,7 @@ echo "5.3 - monitor - offline - no lockfile"
echo "================================="
echo "Description:"
echo "run monitor while server is offline with no lockfile."
echo "Command: ./jc2server monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -939,12 +976,12 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "5.4 - monitor - query_gsquery.py failure"
echo "5.4 - test-alert"
echo "================================="
echo "Description:"
echo "query_gsquery.py will fail to query port."
echo "Command: ./jc2server monitor"
requiredstatus="ONLINE"
echo "run monitor while server is offline with no lockfile."
echo "Command: ./${gameservername} test-alert"
requiredstatus="OFFLINE"
fn_setstatus
cp "${servercfgfullpath}" "config.lua"
sed -i 's/[0-9]\+/0/' "${servercfgfullpath}"
@ -952,7 +989,7 @@ sed -i 's/[0-9]\+/0/' "${servercfgfullpath}"
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
set -x
command_monitor.sh
command_test_alert.sh
)
fn_test_result_fail
echo "run order"
@ -965,11 +1002,15 @@ cp -v "config.lua" "${servercfgfullpath}"
echo "================================="
echo ""
echo "6.0 - details"
echo "6.0 - Details Tests"
echo "=================================================================="
echo ""
echo "6.1 - details"
echo "================================="
echo "Description:"
echo "display details."
echo "Command: ./jc2server details"
echo "Command: ./${gameservername} details"
requiredstatus="ONLINE"
fn_setstatus
(
@ -984,11 +1025,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "6.1 - post details"
echo "6.2 - postdetails"
echo "================================="
echo "Description:"
echo "post details."
echo "Command: ./jc2server postdetails"
echo "Command: ./${gameservername} postdetails"
requiredstatus="ONLINE"
fn_setstatus
(
@ -1003,11 +1044,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "7.0 - backup"
echo "7.0 - Backup Tests"
echo "=================================================================="
echo ""
echo "7.1 - backup"
echo "================================="
echo "Description:"
echo "run a backup."
echo "Command: ./jc2server backup"
echo "Command: ./${gameservername} backup"
requiredstatus="ONLINE"
fn_setstatus
echo "test de-activated until issue #1839 fixed"
@ -1018,11 +1063,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.0 - dev - detect glibc"
echo "8.0 - Development Tools Tests"
echo "=================================================================="
echo ""
echo "8.1 - dev - detect glibc"
echo "================================="
echo "Description:"
echo "detect glibc."
echo "Command: ./jc2server detect-glibc"
echo "Command: ./${gameservername} detect-glibc"
requiredstatus="ONLINE"
fn_setstatus
(
@ -1037,11 +1086,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.1 - dev - detect ldd"
echo "8.2 - dev - detect ldd"
echo "================================="
echo "Description:"
echo "detect ldd."
echo "Command: ./jc2server detect-ldd"
echo "Command: ./${gameservername} detect-ldd"
requiredstatus="ONLINE"
fn_setstatus
(
@ -1056,11 +1105,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.2 - dev - detect deps"
echo "8.3 - dev - detect deps"
echo "================================="
echo "Description:"
echo "detect dependencies."
echo "Command: ./jc2server detect-deps"
echo "Command: ./${gameservername} detect-deps"
requiredstatus="ONLINE"
fn_setstatus
(
@ -1074,6 +1123,25 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.4 - dev - query-raw"
echo "================================="
echo "Description:"
echo "raw query output."
echo "Command: ./${gameservername} query-raw"
requiredstatus="ONLINE"
fn_setstatus
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
set -x
command_dev_query_raw.sh
)
fn_test_result_na
echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "================================="
echo "Server Tests - Complete!"

View File

@ -13,7 +13,7 @@ shortname="ts3"
gameservername="ts3server"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
servicename="${selfname}"
servicename="${gameservername}"
lockselfname=".${servicename}.lock"
lgsmdir="${rootdir}/lgsm"
logdir="${rootdir}/log"
@ -359,7 +359,7 @@ else
fi
# Prevents running of core_exit.sh for Travis.
if [ "${travistest}" != "1" ]; then
if [ -z "${travistest}" ]; then
getopt=$1
core_getopt.sh
fi
@ -467,11 +467,16 @@ echo "Testing Branch: $TRAVIS_BRANCH"
echo "================================="
echo ""
echo "0.1 - Create log dir's"
echo "================================="
echo "0.0 - Pre-test Tasks"
echo "=================================================================="
echo "Description:"
echo "Create log dir's"
echo ""
echo ""
echo "0.1 - Create log dir's"
echo "================================="
echo ""
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
@ -500,11 +505,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.0 - start - no files"
echo "1.0 - Pre-install tests"
echo "=================================================================="
echo ""
echo "1.1 - start - no files"
echo "================================="
echo "Description:"
echo "test script reaction to missing server files."
echo "Command: ./ts3server start"
echo "Command: ./${gameservername} start"
echo ""
# Allows for testing not on Travis CI
if [ ! -v TRAVIS ]; then
@ -524,11 +533,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.1 - getopt"
echo "1.2 - getopt"
echo "================================="
echo "Description:"
echo "displaying options messages."
echo "Command: ./ts3server"
echo "Command: ./${gameservername}"
echo ""
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
@ -542,11 +551,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "1.2 - getopt with incorrect args"
echo "1.3 - getopt with incorrect args"
echo "================================="
echo "Description:"
echo "displaying options messages."
echo "Command: ./ts3server abc123"
echo "Command: ./${gameservername} abc123"
echo ""
getopt="abc123"
(
@ -560,12 +569,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "2.0 - Instalation"
echo "=================================================================="
echo ""
echo "2.0 - install"
echo "================================="
echo "Description:"
echo "install ${gamename} server."
echo "Command: ./ts3server auto-install"
echo "Command: ./${gameservername} auto-install"
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
@ -577,12 +590,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "3.0 - Start/Stop/Restart Tests"
echo "=================================================================="
echo ""
echo "3.1 - start"
echo "================================="
echo "Description:"
echo "start ${gamename} server."
echo "Command: ./ts3server start"
echo "Command: ./${gameservername} start"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -601,7 +618,7 @@ echo "3.2 - start - online"
echo "================================="
echo "Description:"
echo "start ${gamename} server while already running."
echo "Command: ./ts3server start"
echo "Command: ./${gameservername} start"
requiredstatus="ONLINE"
fn_setstatus
(
@ -620,7 +637,7 @@ echo "3.3 - start - updateonstart"
echo "================================="
echo "Description:"
echo "will update server on start."
echo "Command: ./ts3server start"
echo "Command: ./${gameservername} start"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -639,7 +656,7 @@ echo "3.4 - stop"
echo "================================="
echo "Description:"
echo "stop ${gamename} server."
echo "Command: ./ts3server stop"
echo "Command: ./${gameservername} stop"
requiredstatus="ONLINE"
fn_setstatus
(
@ -658,7 +675,7 @@ echo "3.5 - stop - offline"
echo "================================="
echo "Description:"
echo "stop ${gamename} server while already stopped."
echo "Command: ./ts3server stop"
echo "Command: ./${gameservername} stop"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -677,7 +694,7 @@ echo "3.6 - restart"
echo "================================="
echo "Description:"
echo "restart ${gamename}."
echo "Command: ./ts3server restart"
echo "Command: ./${gameservername} restart"
requiredstatus="ONLINE"
fn_setstatus
(
@ -696,7 +713,7 @@ echo "3.7 - restart - offline"
echo "================================="
echo "Description:"
echo "restart ${gamename} while already stopped."
echo "Command: ./ts3server restart"
echo "Command: ./${gameservername} restart"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -710,12 +727,16 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "4.0 - Update Tests"
echo "=================================================================="
echo ""
echo "4.1 - update"
echo "================================="
echo "Description:"
echo "check for updates."
echo "Command: ./ts3server update"
echo "Command: ./${gameservername} update"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -729,12 +750,20 @@ echo "run order"
echo "================="
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}"
echo ""
echo "5.1 - monitor - online"
echo "================================="
echo "Description:"
echo "run monitor server while already running."
echo "Command: ./ts3server monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="ONLINE"
fn_setstatus
(
@ -753,7 +782,7 @@ echo "5.2 - monitor - offline - with lockfile"
echo "================================="
echo "Description:"
echo "run monitor while server is offline with lockfile."
echo "Command: ./ts3server monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="OFFLINE"
fn_setstatus
fn_print_info_nl "creating lockfile."
@ -774,7 +803,7 @@ echo "5.3 - monitor - offline - no lockfile"
echo "================================="
echo "Description:"
echo "run monitor while server is offline with no lockfile."
echo "Command: ./ts3server monitor"
echo "Command: ./${gameservername} monitor"
requiredstatus="OFFLINE"
fn_setstatus
(
@ -789,11 +818,34 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "6.0 - details"
echo "5.4 - test-alert"
echo "================================="
echo "Description:"
echo "run monitor while server is offline with no lockfile."
echo "Command: ./${gameservername} test-alert"
requiredstatus="OFFLINE"
fn_setstatus
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
set -x
command_test_alert.sh
)
fn_test_result_fail
echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "6.0 - Details Tests"
echo "=================================================================="
echo ""
echo "6.1 - details"
echo "================================="
echo "Description:"
echo "display details."
echo "Command: ./ts3server details"
echo "Command: ./${gameservername} details"
requiredstatus="ONLINE"
fn_setstatus
(
@ -808,11 +860,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "6.1 - post details"
echo "6.2 - postdetails"
echo "================================="
echo "Description:"
echo "post details."
echo "Command: ./ts3server postdetails"
echo "Command: ./${gameservername} postdetails"
requiredstatus="ONLINE"
fn_setstatus
(
@ -827,11 +879,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "7.0 - backup"
echo "7.0 - Backup Tests"
echo "=================================================================="
echo ""
echo "7.1 - backup"
echo "================================="
echo "Description:"
echo "run a backup."
echo "Command: ./jc2server backup"
echo "Command: ./${gameservername} backup"
requiredstatus="ONLINE"
fn_setstatus
echo "test de-activated until issue #1839 fixed"
@ -842,11 +898,15 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.0 - dev - detect glibc"
echo "8.0 - Development Tools Tests"
echo "=================================================================="
echo ""
echo "8.1 - dev - detect glibc"
echo "================================="
echo "Description:"
echo "detect glibc."
echo "Command: ./jc2server detect-glibc"
echo "Command: ./${gameservername} detect-glibc"
requiredstatus="ONLINE"
fn_setstatus
(
@ -861,11 +921,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.1 - dev - detect ldd"
echo "8.2 - dev - detect ldd"
echo "================================="
echo "Description:"
echo "detect ldd."
echo "Command: ./jc2server detect-ldd"
echo "Command: ./${gameservername} detect-ldd"
requiredstatus="ONLINE"
fn_setstatus
(
@ -880,11 +940,11 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.2 - dev - detect deps"
echo "8.3 - dev - detect deps"
echo "================================="
echo "Description:"
echo "detect dependencies."
echo "Command: ./jc2server detect-deps"
echo "Command: ./${gameservername} detect-deps"
requiredstatus="ONLINE"
fn_setstatus
(
@ -898,6 +958,25 @@ echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "8.4 - dev - query-raw"
echo "================================="
echo "Description:"
echo "raw query output."
echo "Command: ./${gameservername} query-raw"
requiredstatus="ONLINE"
fn_setstatus
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"
set -x
command_dev_query_raw.sh
)
fn_test_result_na
echo "run order"
echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
echo ""
echo "================================="
echo "Server Tests - Complete!"