tests_fctrserver.sh 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183
  1. #!/bin/bash
  2. # Project: Game Server Managers - LinuxGSM
  3. # Author: Daniel Gibbs
  4. # License: MIT License, Copyright (c) 2020 Daniel Gibbs
  5. # Purpose: Travis CI Tests: Factorio | Linux Game Server Management Script
  6. # Contributors: https://linuxgsm.com/contrib
  7. # Documentation: https://docs.linuxgsm.com
  8. # Website: https://linuxgsm.com
  9. # DO NOT EDIT THIS FILE
  10. # LinuxGSM configuration is no longer edited here
  11. # To update your LinuxGSM config go to:
  12. # lgsm/config-lgsm
  13. # https://docs.linuxgsm.com/configuration/linuxgsm-config
  14. # Debugging
  15. if [ -f ".dev-debug" ]; then
  16. exec 5>dev-debug.log
  17. BASH_XTRACEFD="5"
  18. set -x
  19. fi
  20. version="v22.1.0"
  21. shortname="fctr"
  22. gameservername="fctrserver"
  23. commandname="CORE"
  24. rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
  25. selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
  26. sessionname=$(echo "${selfname}" | cut -f1 -d".")
  27. lgsmdir="${rootdir}/lgsm"
  28. logdir="${rootdir}/log"
  29. lgsmlogdir="${logdir}/lgsm"
  30. steamcmddir="${HOME}/.steam/steamcmd"
  31. serverfiles="${rootdir}/serverfiles"
  32. functionsdir="${lgsmdir}/functions"
  33. tmpdir="${lgsmdir}/tmp"
  34. datadir="${lgsmdir}/data"
  35. lockdir="${lgsmdir}/lock"
  36. serverlist="${datadir}/serverlist.csv"
  37. serverlistmenu="${datadir}/serverlistmenu.csv"
  38. configdir="${lgsmdir}/config-lgsm"
  39. configdirserver="${configdir}/${gameservername}"
  40. configdirdefault="${lgsmdir}/config-default"
  41. userinput="${1}"
  42. # Allows for testing not on Travis CI.
  43. # if using travis for tests
  44. if [ -z "${TRAVIS}" ]; then
  45. TRAVIS_BRANCH="develop"
  46. TRAVIS_BUILD_DIR="${rootdir}"
  47. fi
  48. travistest="1"
  49. ## GitHub Branch Select
  50. # Allows for the use of different function files
  51. # from a different repo and/or branch.
  52. githubuser="GameServerManagers"
  53. githubrepo="LinuxGSM"
  54. githubbranch="${TRAVIS_BRANCH}"
  55. # Core function that is required first.
  56. core_functions.sh(){
  57. functionfile="${FUNCNAME[0]}"
  58. fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash"
  59. }
  60. # Bootstrap
  61. # Fetches the core functions required before passed off to core_dl.sh.
  62. fn_bootstrap_fetch_file(){
  63. remote_fileurl="${1}"
  64. remote_fileurl_backup="${2}"
  65. remote_fileurl_name="${3}"
  66. remote_fileurl_backup_name="${4}"
  67. local_filedir="${5}"
  68. local_filename="${6}"
  69. chmodx="${7:-0}"
  70. run="${8:-0}"
  71. forcedl="${9:-0}"
  72. md5="${10:-0}"
  73. # Download file if missing or download forced.
  74. if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then
  75. # If backup fileurl exists include it.
  76. if [ -n "${remote_fileurl_backup}" ]; then
  77. # counter set to 0 to allow second try
  78. counter=0
  79. remote_fileurls_array=( remote_fileurl remote_fileurl_backup )
  80. else
  81. # counter set to 1 to not allow second try
  82. counter=1
  83. remote_fileurls_array=( remote_fileurl )
  84. fi
  85. for remote_fileurl_array in "${remote_fileurls_array[@]}"; do
  86. if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then
  87. fileurl="${remote_fileurl}"
  88. fileurl_name="${remote_fileurl_name}"
  89. elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then
  90. fileurl="${remote_fileurl_backup}"
  91. fileurl_name="${remote_fileurl_backup_name}"
  92. fi
  93. counter=$((counter+1))
  94. if [ ! -d "${local_filedir}" ]; then
  95. mkdir -p "${local_filedir}"
  96. fi
  97. # Trap will remove part downloaded files if canceled.
  98. trap fn_fetch_trap INT
  99. # Larger files show a progress bar.
  100. echo -en "fetching ${fileurl_name} ${local_filename}...\c"
  101. curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1)
  102. local exitcode=$?
  103. # Download will fail if downloads a html file.
  104. if [ -f "${local_filedir}/${local_filename}" ]; then
  105. if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then
  106. rm "${local_filedir:?}/${local_filename:?}"
  107. local exitcode=2
  108. fi
  109. fi
  110. # On first try will error. On second try will fail.
  111. if [ "${exitcode}" != 0 ]; then
  112. if [ ${counter} -ge 2 ]; then
  113. echo -e "FAIL"
  114. if [ -f "${lgsmlog}" ]; then
  115. fn_script_log_fatal "Downloading ${local_filename}"
  116. fn_script_log_fatal "${fileurl}"
  117. fi
  118. core_exit.sh
  119. else
  120. echo -e "ERROR"
  121. if [ -f "${lgsmlog}" ]; then
  122. fn_script_log_error "Downloading ${local_filename}"
  123. fn_script_log_error "${fileurl}"
  124. fi
  125. fi
  126. else
  127. echo -en "OK"
  128. sleep 0.3
  129. echo -en "\033[2K\\r"
  130. if [ -f "${lgsmlog}" ]; then
  131. fn_script_log_pass "Downloading ${local_filename}"
  132. fi
  133. # Make file executable if chmodx is set.
  134. if [ "${chmodx}" == "chmodx" ]; then
  135. chmod +x "${local_filedir}/${local_filename}"
  136. fi
  137. # Remove trap.
  138. trap - INT
  139. break
  140. fi
  141. done
  142. fi
  143. if [ -f "${local_filedir}/${local_filename}" ]; then
  144. # Execute file if run is set.
  145. if [ "${run}" == "run" ]; then
  146. # shellcheck source=/dev/null
  147. source "${local_filedir}/${local_filename}"
  148. fi
  149. fi
  150. }
  151. fn_bootstrap_fetch_file_github(){
  152. github_file_url_dir="${1}"
  153. github_file_url_name="${2}"
  154. # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
  155. if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
  156. remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
  157. remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
  158. else
  159. remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
  160. remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
  161. fi
  162. remote_fileurl_name="GitHub"
  163. remote_fileurl_backup_name="Bitbucket"
  164. local_filedir="${3}"
  165. local_filename="${github_file_url_name}"
  166. chmodx="${4:-0}"
  167. run="${5:-0}"
  168. forcedl="${6:-0}"
  169. md5="${7:-0}"
  170. # Passes vars to the file download function.
  171. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
  172. }
  173. # Installer menu.
  174. fn_print_center() {
  175. columns=$(tput cols)
  176. line="$*"
  177. printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}"
  178. }
  179. fn_print_horizontal(){
  180. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "="
  181. }
  182. # Bash menu.
  183. fn_install_menu_bash() {
  184. local resultvar=$1
  185. title=$2
  186. caption=$3
  187. options=$4
  188. fn_print_horizontal
  189. fn_print_center "${title}"
  190. fn_print_center "${caption}"
  191. fn_print_horizontal
  192. menu_options=()
  193. while read -r line || [[ -n "${line}" ]]; do
  194. var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}')
  195. menu_options+=( "${var}" )
  196. done < "${options}"
  197. menu_options+=( "Cancel" )
  198. select option in "${menu_options[@]}"; do
  199. if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then
  200. eval "$resultvar=\"${option/%\ */}\""
  201. fi
  202. break
  203. done
  204. }
  205. # Whiptail/Dialog menu.
  206. fn_install_menu_whiptail() {
  207. local menucmd=$1
  208. local resultvar=$2
  209. title=$3
  210. caption=$4
  211. options=$5
  212. height=${6:-40}
  213. width=${7:-80}
  214. menuheight=${8:-30}
  215. IFS=","
  216. menu_options=()
  217. while read -r line; do
  218. key=$(echo -e "${line}" | awk -F "," '{print $3}')
  219. val=$(echo -e "${line}" | awk -F "," '{print $2}')
  220. menu_options+=( "${val//\"}" "${key//\"}" )
  221. done < "${options}"
  222. OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
  223. if [ $? == 0 ]; then
  224. eval "$resultvar=\"${OPTION}\""
  225. else
  226. eval "$resultvar="
  227. fi
  228. }
  229. # Menu selector.
  230. fn_install_menu() {
  231. local resultvar=$1
  232. local selection=""
  233. title=$2
  234. caption=$3
  235. options=$4
  236. # Get menu command.
  237. for menucmd in whiptail dialog bash; do
  238. if [ "$(command -v "${menucmd}")" ]; then
  239. menucmd=$(command -v "${menucmd}")
  240. break
  241. fi
  242. done
  243. case "$(basename "${menucmd}")" in
  244. whiptail|dialog)
  245. fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;;
  246. *)
  247. fn_install_menu_bash selection "${title}" "${caption}" "${options}";;
  248. esac
  249. eval "$resultvar=\"${selection}\""
  250. }
  251. # Gets server info from serverlist.csv and puts in to array.
  252. fn_server_info(){
  253. IFS=","
  254. server_info_array=($(grep -aw "${userinput}" "${serverlist}"))
  255. shortname="${server_info_array[0]}" # csgo
  256. gameservername="${server_info_array[1]}" # csgoserver
  257. gamename="${server_info_array[2]}" # Counter Strike: Global Offensive
  258. }
  259. fn_install_getopt(){
  260. userinput="empty"
  261. echo -e "Usage: $0 [option]"
  262. echo -e ""
  263. echo -e "Installer - Linux Game Server Managers - Version ${version}"
  264. echo -e "https://linuxgsm.com"
  265. echo -e ""
  266. echo -e "Commands"
  267. echo -e "install\t\t| Select server to install."
  268. echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver."
  269. echo -e "list\t\t| List all servers available for install."
  270. exit
  271. }
  272. fn_install_file(){
  273. local_filename="${gameservername}"
  274. if [ -e "${local_filename}" ]; then
  275. i=2
  276. while [ -e "${local_filename}-${i}" ] ; do
  277. (( i++ ))
  278. done
  279. local_filename="${local_filename}-${i}"
  280. fi
  281. cp -R "${selfname}" "${local_filename}"
  282. sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}"
  283. sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}"
  284. echo -e "Installed ${gamename} server as ${local_filename}"
  285. echo -e ""
  286. if [ ! -d "${serverfiles}" ]; then
  287. echo -e "./${local_filename} install"
  288. else
  289. echo -e "Remember to check server ports"
  290. echo -e "./${local_filename} details"
  291. fi
  292. echo -e ""
  293. exit
  294. }
  295. # Prevent LinuxGSM from running as root. Except if doing a dependency install.
  296. if [ "$(whoami)" == "root" ]; then
  297. if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then
  298. if [ "${shortname}" == "core" ]; then
  299. echo -e "[ FAIL ] Do NOT run this script as root!"
  300. exit 1
  301. fi
  302. elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
  303. echo -e "[ FAIL ] Do NOT run this script as root!"
  304. exit 1
  305. else
  306. core_functions.sh
  307. check_root.sh
  308. fi
  309. fi
  310. # LinuxGSM installer mode.
  311. if [ "${shortname}" == "core" ]; then
  312. # Download the latest serverlist. This is the complete list of all supported servers.
  313. fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash"
  314. if [ ! -f "${serverlist}" ]; then
  315. echo -e "[ FAIL ] serverlist.csv could not be loaded."
  316. exit 1
  317. fi
  318. if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then
  319. {
  320. tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}'
  321. } | column -s $'\t' -t | more
  322. exit
  323. elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then
  324. tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
  325. fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
  326. userinput="${result}"
  327. fn_server_info
  328. if [ "${result}" == "${gameservername}" ]; then
  329. fn_install_file
  330. elif [ "${result}" == "" ]; then
  331. echo -e "Install canceled"
  332. else
  333. echo -e "[ FAIL ] menu result does not match gameservername"
  334. echo -e "result: ${result}"
  335. echo -e "gameservername: ${gameservername}"
  336. fi
  337. elif [ "${userinput}" ]; then
  338. fn_server_info
  339. if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then
  340. fn_install_file
  341. else
  342. echo -e "[ FAIL ] unknown game server"
  343. fi
  344. else
  345. fn_install_getopt
  346. fi
  347. # LinuxGSM server mode.
  348. else
  349. core_functions.sh
  350. if [ "${shortname}" != "core-dep" ]; then
  351. # Load LinuxGSM configs.
  352. # These are required to get all the default variables for the specific server.
  353. # Load the default config. If missing download it. If changed reload it.
  354. if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
  355. mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
  356. fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nohash"
  357. fi
  358. if [ ! -f "${configdirserver}/_default.cfg" ]; then
  359. mkdir -p "${configdirserver}"
  360. echo -en "copying _default.cfg...\c"
  361. cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
  362. exitcode=$?
  363. if [ "${exitcode}" != 0 ]; then
  364. echo -e "FAIL"
  365. exit 1
  366. else
  367. echo -e "OK"
  368. fi
  369. else
  370. function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
  371. if [ "${function_file_diff}" != "" ]; then
  372. fn_print_warn_nl "_default.cfg has been altered. reloading config."
  373. echo -en "copying _default.cfg...\c"
  374. cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
  375. exitcode=$?
  376. if [ "${exitcode}" != 0 ]; then
  377. echo -e "FAIL"
  378. exit 1
  379. else
  380. echo -e "OK"
  381. fi
  382. fi
  383. fi
  384. # shellcheck source=/dev/null
  385. source "${configdirserver}/_default.cfg"
  386. # Load the common.cfg config. If missing download it.
  387. if [ ! -f "${configdirserver}/common.cfg" ]; then
  388. fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nohash"
  389. # shellcheck source=/dev/null
  390. source "${configdirserver}/common.cfg"
  391. else
  392. # shellcheck source=/dev/null
  393. source "${configdirserver}/common.cfg"
  394. fi
  395. # Load the secrets-common.cfg config. If missing download it.
  396. if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
  397. fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nohash"
  398. # shellcheck source=/dev/null
  399. source "${configdirserver}/secrets-common.cfg"
  400. else
  401. # shellcheck source=/dev/null
  402. source "${configdirserver}/secrets-common.cfg"
  403. fi
  404. # Load the instance.cfg config. If missing download it.
  405. if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
  406. fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nohash"
  407. # shellcheck source=/dev/null
  408. source "${configdirserver}/${selfname}.cfg"
  409. else
  410. # shellcheck source=/dev/null
  411. source "${configdirserver}/${selfname}.cfg"
  412. fi
  413. # Load the secrets-instance.cfg config. If missing download it.
  414. if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
  415. fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nohash"
  416. # shellcheck source=/dev/null
  417. source "${configdirserver}/secrets-${selfname}.cfg"
  418. else
  419. # shellcheck source=/dev/null
  420. source "${configdirserver}/secrets-${selfname}.cfg"
  421. fi
  422. # Load the linuxgsm.sh in to tmpdir. If missing download it.
  423. if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
  424. fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nohash"
  425. fi
  426. fi
  427. # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off.
  428. fn_ansi_loader
  429. # Prevents running of core_exit.sh for Travis-CI.
  430. if [ "${travistest}" != "1" ]; then
  431. getopt=$1
  432. core_getopt.sh
  433. fi
  434. fi
  435. fn_currentstatus_tmux(){
  436. check_status.sh
  437. if [ "${status}" != "0" ]; then
  438. currentstatus="STARTED"
  439. else
  440. currentstatus="STOPPED"
  441. fi
  442. }
  443. fn_setstatus(){
  444. fn_currentstatus_tmux
  445. echo""
  446. echo -e "Required status: ${requiredstatus}"
  447. counter=0
  448. echo -e "Current status: ${currentstatus}"
  449. while [ "${requiredstatus}" != "${currentstatus}" ]; do
  450. counter=$((counter+1))
  451. fn_currentstatus_tmux
  452. echo -en "New status: ${currentstatus}\\r"
  453. if [ "${requiredstatus}" == "STARTED" ]; then
  454. (command_start.sh > /dev/null 2>&1)
  455. else
  456. (command_stop.sh > /dev/null 2>&1)
  457. fi
  458. if [ "${counter}" -gt "5" ]; then
  459. currentstatus="FAIL"
  460. echo -e "Current status: ${currentstatus}"
  461. echo -e ""
  462. echo -e "Unable to start or stop server."
  463. exit 1
  464. fi
  465. done
  466. echo -en "New status: ${currentstatus}\\r"
  467. echo -e "\n"
  468. echo -e "Test starting:"
  469. echo -e ""
  470. }
  471. # End of every test will expect the result to either pass or fail
  472. # If the script does not do as intended the whole test will fail
  473. # if expecting a pass
  474. fn_test_result_pass(){
  475. if [ $? != 0 ]; then
  476. echo -e "================================="
  477. echo -e "Expected result: PASS"
  478. echo -e "Actual result: FAIL"
  479. fn_print_fail_nl "TEST FAILED"
  480. exitcode=1
  481. core_exit.sh
  482. else
  483. echo -e "================================="
  484. echo -e "Expected result: PASS"
  485. echo -e "Actual result: PASS"
  486. fn_print_ok_nl "TEST PASSED"
  487. echo -e ""
  488. fi
  489. }
  490. # if expecting a fail
  491. fn_test_result_fail(){
  492. if [ $? == 0 ]; then
  493. echo -e "================================="
  494. echo -e "Expected result: FAIL"
  495. echo -e "Actual result: PASS"
  496. fn_print_fail_nl "TEST FAILED"
  497. exitcode=1
  498. core_exit.sh
  499. else
  500. echo -e "================================="
  501. echo -e "Expected result: FAIL"
  502. echo -e "Actual result: FAIL"
  503. fn_print_ok_nl "TEST PASSED"
  504. echo -e ""
  505. fi
  506. }
  507. # test result n/a
  508. fn_test_result_na(){
  509. echo -e "================================="
  510. echo -e "Expected result: N/A"
  511. echo -e "Actual result: N/A"
  512. fn_print_fail_nl "TEST N/A"
  513. }
  514. sleeptime="0"
  515. echo -e "================================="
  516. echo -e "Travis CI Tests"
  517. echo -e "Linux Game Server Manager"
  518. echo -e "by Daniel Gibbs"
  519. echo -e "Contributors: http://goo.gl/qLmitD"
  520. echo -e "https://linuxgsm.com"
  521. echo -e "================================="
  522. echo -e ""
  523. echo -e "================================="
  524. echo -e "Server Tests"
  525. echo -e "Using: ${gamename}"
  526. echo -e "Testing Branch: ${TRAVIS_BRANCH}"
  527. echo -e "================================="
  528. echo -e ""
  529. echo -e "Tests Summary"
  530. echo -e "================================="
  531. echo -e "0.0 - Pre-test Tasks"
  532. echo -e "0.1 - Create log dir's"
  533. echo -e "0.2 - Enable dev-debug"
  534. echo -e ""
  535. echo -e "1.0 - Pre-install tests"
  536. echo -e "1.1 - start - no files"
  537. echo -e "1.2 - getopt"
  538. echo -e "1.3 - getopt with incorrect args"
  539. echo -e ""
  540. echo -e "2.0 - Installation"
  541. echo -e "2.1 - install"
  542. echo -e ""
  543. echo -e "3.0 - Start/Stop/Restart Tests"
  544. echo -e "3.1 - start"
  545. echo -e "3.2 - start - online"
  546. echo -e "3.3 - start - updateonstart"
  547. echo -e "3.4 - stop"
  548. echo -e "3.5 - stop - offline"
  549. echo -e "3.6 - restart"
  550. echo -e "3.7 - restart - offline"
  551. echo -e ""
  552. echo -e "4.0 - Update Tests"
  553. echo -e "4.1 - update"
  554. echo -e "4.2 - update-lgsm"
  555. echo -e ""
  556. echo -e "5.0 - Monitor Tests"
  557. echo -e "5.1 - monitor - online"
  558. echo -e "5.2 - monitor - offline - with lockfile"
  559. echo -e "5.3 - monitor - offline - no lockfile"
  560. echo -e "5.4 - test-alert"
  561. echo -e ""
  562. echo -e "6.0 - Details Tests"
  563. echo -e "6.1 - details"
  564. echo -e "6.2 - postdetails"
  565. echo -e ""
  566. echo -e "7.0 - Backup Tests"
  567. echo -e "7.1 - backup"
  568. echo -e ""
  569. echo -e "8.0 - Development Tools Tests"
  570. echo -e "8.1 - dev - detect glibc"
  571. echo -e "8.2 - dev - detect ldd"
  572. echo -e "8.3 - dev - detect deps"
  573. echo -e "8.4 - dev - query-raw"
  574. echo -e ""
  575. echo -e "9.0 - Donate"
  576. echo -e "9.1 - donate"
  577. echo -e ""
  578. echo -e "0.0 - Pre-test Tasks"
  579. echo -e "=================================================================="
  580. echo -e "Description:"
  581. echo -e "Create log dir's"
  582. echo -e ""
  583. echo -e ""
  584. echo -e "0.1 - Create log dir's"
  585. echo -e "================================="
  586. echo -e ""
  587. (
  588. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  589. BASH_XTRACEFD="5"
  590. set -x
  591. install_logs.sh
  592. )
  593. echo -e "run order"
  594. echo -e "================="
  595. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  596. echo -e ""
  597. echo -e "0.2 - Enable dev-debug"
  598. echo -e "================================="
  599. echo -e "Description:"
  600. echo -e "Enable dev-debug"
  601. echo -e ""
  602. (
  603. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  604. BASH_XTRACEFD="5"
  605. set -x
  606. command_dev_debug.sh
  607. )
  608. fn_test_result_pass
  609. echo -e "run order"
  610. echo -e "================="
  611. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  612. echo -e ""
  613. echo -e "1.0 - Pre-install tests"
  614. echo -e "=================================================================="
  615. echo -e ""
  616. echo -e "1.1 - start - no files"
  617. echo -e "================================="
  618. echo -e "Description:"
  619. echo -e "test script reaction to missing server files."
  620. echo -e "Command: ./${gameservername} start"
  621. echo -e ""
  622. # Allows for testing not on Travis CI
  623. if [ -z "${TRAVIS}" ]; then
  624. (
  625. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  626. BASH_XTRACEFD="5"
  627. set -x
  628. command_start.sh
  629. )
  630. fn_test_result_fail
  631. else
  632. echo -e "Test bypassed"
  633. fi
  634. echo -e "run order"
  635. echo -e "================="
  636. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  637. echo -e ""
  638. echo -e "1.2 - getopt"
  639. echo -e "================================="
  640. echo -e "Description:"
  641. echo -e "displaying options messages."
  642. echo -e "Command: ./${gameservername}"
  643. echo -e ""
  644. (
  645. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  646. BASH_XTRACEFD="5"
  647. set -x
  648. core_getopt.sh
  649. )
  650. fn_test_result_pass
  651. echo -e "run order"
  652. echo -e "================="
  653. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  654. echo -e ""
  655. echo -e "1.3 - getopt with incorrect args"
  656. echo -e "================================="
  657. echo -e "Description:"
  658. echo -e "displaying options messages."
  659. echo -e "Command: ./${gameservername} abc123"
  660. echo -e ""
  661. getopt="abc123"
  662. (
  663. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  664. BASH_XTRACEFD="5"
  665. set -x
  666. core_getopt.sh
  667. )
  668. fn_test_result_pass
  669. echo -e "run order"
  670. echo -e "================="
  671. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  672. echo -e ""
  673. echo -e "2.0 - Installation"
  674. echo -e "=================================================================="
  675. echo -e ""
  676. echo -e "2.1 - install"
  677. echo -e "================================="
  678. echo -e "Description:"
  679. echo -e "install ${gamename} server."
  680. echo -e "Command: ./${gameservername} auto-install"
  681. (
  682. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  683. BASH_XTRACEFD="5"
  684. set -x
  685. fn_autoinstall
  686. )
  687. fn_test_result_pass
  688. echo -e "run order"
  689. echo -e "================="
  690. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  691. echo -e ""
  692. echo -e "3.0 - Start/Stop/Restart Tests"
  693. echo -e "=================================================================="
  694. echo -e ""
  695. echo -e "3.1 - start"
  696. echo -e "================================="
  697. echo -e "Description:"
  698. echo -e "start ${gamename} server."
  699. echo -e "Command: ./${gameservername} start"
  700. requiredstatus="STOPPED"
  701. fn_setstatus
  702. (
  703. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  704. BASH_XTRACEFD="5"
  705. set -x
  706. command_start.sh
  707. )
  708. fn_test_result_pass
  709. echo -e "run order"
  710. echo -e "================="
  711. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  712. echo -e ""
  713. echo -e "3.2 - start - online"
  714. echo -e "================================="
  715. echo -e "Description:"
  716. echo -e "start ${gamename} server while already running."
  717. echo -e "Command: ./${gameservername} start"
  718. requiredstatus="STARTED"
  719. fn_setstatus
  720. (
  721. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  722. BASH_XTRACEFD="5"
  723. set -x
  724. command_start.sh
  725. )
  726. fn_test_result_fail
  727. echo -e "run order"
  728. echo -e "================="
  729. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  730. echo -e ""
  731. echo -e "3.3 - start - updateonstart"
  732. echo -e "================================="
  733. echo -e "Description:"
  734. echo -e "will update server on start."
  735. echo -e "Command: ./${gameservername} start"
  736. requiredstatus="STOPPED"
  737. fn_setstatus
  738. (
  739. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  740. BASH_XTRACEFD="5"
  741. set -x
  742. updateonstart="on";command_start.sh
  743. )
  744. fn_test_result_pass
  745. echo -e "run order"
  746. echo -e "================="
  747. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  748. echo -e ""
  749. echo -e "3.4 - stop"
  750. echo -e "================================="
  751. echo -e "Description:"
  752. echo -e "stop ${gamename} server."
  753. echo -e "Command: ./${gameservername} stop"
  754. requiredstatus="STARTED"
  755. fn_setstatus
  756. (
  757. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  758. BASH_XTRACEFD="5"
  759. set -x
  760. command_stop.sh
  761. )
  762. fn_test_result_pass
  763. echo -e "run order"
  764. echo -e "================="
  765. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  766. echo -e ""
  767. echo -e "3.5 - stop - offline"
  768. echo -e "================================="
  769. echo -e "Description:"
  770. echo -e "stop ${gamename} server while already stopped."
  771. echo -e "Command: ./${gameservername} stop"
  772. requiredstatus="STOPPED"
  773. fn_setstatus
  774. (
  775. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  776. BASH_XTRACEFD="5"
  777. set -x
  778. command_stop.sh
  779. )
  780. fn_test_result_fail
  781. echo -e "run order"
  782. echo -e "================="
  783. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  784. echo -e ""
  785. echo -e "3.6 - restart"
  786. echo -e "================================="
  787. echo -e "Description:"
  788. echo -e "restart ${gamename}."
  789. echo -e "Command: ./${gameservername} restart"
  790. requiredstatus="STARTED"
  791. fn_setstatus
  792. (
  793. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  794. BASH_XTRACEFD="5"
  795. set -x
  796. command_restart.sh
  797. )
  798. fn_test_result_pass
  799. echo -e "run order"
  800. echo -e "================="
  801. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  802. echo -e ""
  803. echo -e "3.7 - restart - offline"
  804. echo -e "================================="
  805. echo -e "Description:"
  806. echo -e "restart ${gamename} while already stopped."
  807. echo -e "Command: ./${gameservername} restart"
  808. requiredstatus="STOPPED"
  809. fn_setstatus
  810. (
  811. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  812. BASH_XTRACEFD="5"
  813. set -x
  814. command_restart.sh
  815. )
  816. fn_test_result_pass
  817. echo -e "run order"
  818. echo -e "================="
  819. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  820. echo -e ""
  821. echo -e "4.0 - Update Tests"
  822. echo -e "=================================================================="
  823. echo -e ""
  824. echo -e "4.1 - update"
  825. echo -e "================================="
  826. echo -e "Description:"
  827. echo -e "check for updates."
  828. echo -e "Command: ./${gameservername} update"
  829. requiredstatus="STOPPED"
  830. fn_setstatus
  831. (
  832. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  833. BASH_XTRACEFD="5"
  834. set -x
  835. command_update.sh
  836. )
  837. fn_test_result_pass
  838. echo -e "run order"
  839. echo -e "================="
  840. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  841. echo -e ""
  842. echo -e "4.2 - update-lgsm"
  843. echo -e "================================="
  844. echo -e "Description:"
  845. echo -e "update LinuxGSM."
  846. echo -e ""
  847. echo -e "Command: ./jc2server update-lgam"
  848. requiredstatus="STARTED"
  849. fn_setstatus
  850. (
  851. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  852. BASH_XTRACEFD="5"
  853. set -x
  854. command_update_linuxgsm.sh
  855. )
  856. fn_test_result_pass
  857. echo -e "run order"
  858. echo -e "================="
  859. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  860. echo -e ""
  861. echo -e "5.0 - Monitor Tests"
  862. echo -e "=================================================================="
  863. echo -e ""
  864. info_game.sh
  865. echo -e "Server IP - Port: ${ip}:${port}"
  866. echo -e "Server IP - Query Port: ${ip}:${queryport}"
  867. echo -e ""
  868. echo -e "5.1 - monitor - online"
  869. echo -e "================================="
  870. echo -e "Description:"
  871. echo -e "run monitor server while already running."
  872. echo -e "Command: ./${gameservername} monitor"
  873. requiredstatus="STARTED"
  874. fn_setstatus
  875. (
  876. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  877. BASH_XTRACEFD="5"
  878. set -x
  879. command_monitor.sh
  880. )
  881. fn_test_result_pass
  882. echo -e "run order"
  883. echo -e "================="
  884. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  885. echo -e ""
  886. echo -e "5.2 - monitor - offline - with lockfile"
  887. echo -e "================================="
  888. echo -e "Description:"
  889. echo -e "run monitor while server is offline with lockfile."
  890. echo -e "Command: ./${gameservername} monitor"
  891. requiredstatus="STOPPED"
  892. fn_setstatus
  893. fn_print_info_nl "creating lockfile."
  894. date '+%s' > "${lockdir}/${selfname}.lock"
  895. echo "${version}" >> "${lockdir}/${selfname}.lock"
  896. echo "${port}" >> "${lockdir}/${selfname}.lock"
  897. (
  898. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  899. BASH_XTRACEFD="5"
  900. set -x
  901. command_monitor.sh
  902. )
  903. fn_test_result_pass
  904. echo -e "run order"
  905. echo -e "================="
  906. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  907. echo -e ""
  908. echo -e "5.3 - monitor - offline - no lockfile"
  909. echo -e "================================="
  910. echo -e "Description:"
  911. echo -e "run monitor while server is offline with no lockfile."
  912. echo -e "Command: ./${gameservername} monitor"
  913. requiredstatus="STOPPED"
  914. fn_setstatus
  915. (
  916. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  917. BASH_XTRACEFD="5"
  918. set -x
  919. command_monitor.sh
  920. )
  921. fn_test_result_fail
  922. echo -e "run order"
  923. echo -e "================="
  924. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  925. echo -e ""
  926. echo -e "5.4 - test-alert"
  927. echo -e "================================="
  928. echo -e "Description:"
  929. echo -e "run monitor while server is offline with no lockfile."
  930. echo -e "Command: ./${gameservername} test-alert"
  931. requiredstatus="STOPPED"
  932. fn_setstatus
  933. (
  934. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  935. BASH_XTRACEFD="5"
  936. set -x
  937. command_test_alert.sh
  938. )
  939. fn_test_result_fail
  940. echo -e "run order"
  941. echo -e "================="
  942. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  943. echo -e ""
  944. echo -e "6.0 - Details Tests"
  945. echo -e "=================================================================="
  946. echo -e ""
  947. echo -e "6.1 - details"
  948. echo -e "================================="
  949. echo -e "Description:"
  950. echo -e "display details."
  951. echo -e "Command: ./${gameservername} details"
  952. requiredstatus="STARTED"
  953. fn_setstatus
  954. (
  955. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  956. BASH_XTRACEFD="5"
  957. set -x
  958. command_details.sh
  959. )
  960. fn_test_result_pass
  961. echo -e "run order"
  962. echo -e "================="
  963. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  964. echo -e ""
  965. echo -e "6.2 - postdetails"
  966. echo -e "================================="
  967. echo -e "Description:"
  968. echo -e "post details."
  969. echo -e "Command: ./${gameservername} postdetails"
  970. requiredstatus="STARTED"
  971. fn_setstatus
  972. (
  973. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  974. BASH_XTRACEFD="5"
  975. set -x
  976. command_postdetails.sh
  977. )
  978. fn_test_result_pass
  979. echo -e "run order"
  980. echo -e "================="
  981. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  982. echo -e ""
  983. echo -e "7.0 - Backup Tests"
  984. echo -e "=================================================================="
  985. echo -e ""
  986. echo -e "7.1 - backup"
  987. echo -e "================================="
  988. echo -e "Description:"
  989. echo -e "run a backup."
  990. echo -e "Command: ./${gameservername} backup"
  991. requiredstatus="STARTED"
  992. fn_setstatus
  993. echo -e "test de-activated until issue #1839 fixed"
  994. #(command_backup.sh)
  995. fn_test_result_pass
  996. echo -e "run order"
  997. echo -e "================="
  998. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  999. echo -e ""
  1000. echo -e "8.0 - Development Tools Tests"
  1001. echo -e "=================================================================="
  1002. echo -e ""
  1003. echo -e "8.1 - dev - detect glibc"
  1004. echo -e "================================="
  1005. echo -e "Description:"
  1006. echo -e "detect glibc."
  1007. echo -e "Command: ./${gameservername} detect-glibc"
  1008. requiredstatus="STARTED"
  1009. fn_setstatus
  1010. (
  1011. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1012. BASH_XTRACEFD="5"
  1013. set -x
  1014. command_dev_detect_glibc.sh
  1015. )
  1016. fn_test_result_pass
  1017. echo -e "run order"
  1018. echo -e "================="
  1019. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1020. echo -e ""
  1021. echo -e "8.2 - dev - detect ldd"
  1022. echo -e "================================="
  1023. echo -e "Description:"
  1024. echo -e "detect ldd."
  1025. echo -e "Command: ./${gameservername} detect-ldd"
  1026. requiredstatus="STARTED"
  1027. fn_setstatus
  1028. (
  1029. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1030. BASH_XTRACEFD="5"
  1031. set -x
  1032. command_dev_detect_ldd.sh
  1033. )
  1034. fn_test_result_pass
  1035. echo -e "run order"
  1036. echo -e "================="
  1037. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1038. echo -e ""
  1039. echo -e "8.3 - dev - detect deps"
  1040. echo -e "================================="
  1041. echo -e "Description:"
  1042. echo -e "detect dependencies."
  1043. echo -e "Command: ./${gameservername} detect-deps"
  1044. requiredstatus="STARTED"
  1045. fn_setstatus
  1046. (
  1047. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1048. BASH_XTRACEFD="5"
  1049. set -x
  1050. command_dev_detect_deps.sh
  1051. )
  1052. fn_test_result_pass
  1053. echo -e "run order"
  1054. echo -e "================="
  1055. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1056. echo -e ""
  1057. echo -e "8.4 - dev - query-raw"
  1058. echo -e "================================="
  1059. echo -e "Description:"
  1060. echo -e "raw query output."
  1061. echo -e "Command: ./${gameservername} query-raw"
  1062. requiredstatus="STARTED"
  1063. fn_setstatus
  1064. (
  1065. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1066. BASH_XTRACEFD="5"
  1067. set -x
  1068. command_dev_query_raw.sh
  1069. )
  1070. fn_test_result_na
  1071. echo -e "run order"
  1072. echo -e "================="
  1073. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1074. echo -e ""
  1075. echo -e "9.0 - Donate"
  1076. echo -e "=================================================================="
  1077. echo -e ""
  1078. echo -e "9.1 - donate"
  1079. echo -e "================================="
  1080. echo -e "Description:"
  1081. echo -e "donate."
  1082. echo -e "Command: ./${gameservername} donate"
  1083. requiredstatus="STARTED"
  1084. fn_setstatus
  1085. (
  1086. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1087. BASH_XTRACEFD="5"
  1088. set -x
  1089. command_donate.sh
  1090. )
  1091. fn_test_result_pass
  1092. echo -e "run order"
  1093. echo -e "================="
  1094. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1095. echo -e ""
  1096. echo -e "================================="
  1097. echo -e "Server Tests - Complete!"
  1098. echo -e "Using: ${gamename}"
  1099. echo -e "================================="
  1100. requiredstatus="STOPPED"
  1101. fn_setstatus
  1102. core_exit.sh