tests_ts3server.sh 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  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: Teamspeak 3 | 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="v23.3.3"
  21. shortname="ts3"
  22. gameservername="ts3server"
  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. modulesdir="${lgsmdir}/modules"
  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 module files
  51. # from a different repo and/or branch.
  52. githubuser="GameServerManagers"
  53. githubrepo="LinuxGSM"
  54. githubbranch="${TRAVIS_BRANCH}"
  55. # Core module that is required first.
  56. core_modules.sh() {
  57. modulefile="${FUNCNAME[0]}"
  58. fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash"
  59. }
  60. # Bootstrap
  61. # Fetches the core modules 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 -f "${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}" == "GameServerManagers" ] && [ "${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 module.
  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. *)
  248. fn_install_menu_bash selection "${title}" "${caption}" "${options}"
  249. ;;
  250. esac
  251. eval "$resultvar=\"${selection}\""
  252. }
  253. # Gets server info from serverlist.csv and puts in to array.
  254. fn_server_info() {
  255. IFS=","
  256. server_info_array=($(grep -aw "${userinput}" "${serverlist}"))
  257. shortname="${server_info_array[0]}" # csgo
  258. gameservername="${server_info_array[1]}" # csgoserver
  259. gamename="${server_info_array[2]}" # Counter Strike: Global Offensive
  260. }
  261. fn_install_getopt() {
  262. userinput="empty"
  263. echo -e "Usage: $0 [option]"
  264. echo -e ""
  265. echo -e "Installer - Linux Game Server Managers - Version ${version}"
  266. echo -e "https://linuxgsm.com"
  267. echo -e ""
  268. echo -e "Commands"
  269. echo -e "install\t\t| Select server to install."
  270. echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver."
  271. echo -e "list\t\t| List all servers available for install."
  272. exit
  273. }
  274. fn_install_file() {
  275. local_filename="${gameservername}"
  276. if [ -e "${local_filename}" ]; then
  277. i=2
  278. while [ -e "${local_filename}-${i}" ]; do
  279. ((i++))
  280. done
  281. local_filename="${local_filename}-${i}"
  282. fi
  283. cp -R "${selfname}" "${local_filename}"
  284. sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}"
  285. sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}"
  286. echo -e "Installed ${gamename} server as ${local_filename}"
  287. echo -e ""
  288. if [ ! -d "${serverfiles}" ]; then
  289. echo -e "./${local_filename} install"
  290. else
  291. echo -e "Remember to check server ports"
  292. echo -e "./${local_filename} details"
  293. fi
  294. echo -e ""
  295. exit
  296. }
  297. # Prevent LinuxGSM from running as root. Except if doing a dependency install.
  298. if [ "$(whoami)" == "root" ]; then
  299. if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then
  300. if [ "${shortname}" == "core" ]; then
  301. echo -e "[ FAIL ] Do NOT run this script as root!"
  302. exit 1
  303. fi
  304. elif [ ! -f "${modulesdir}/core_modules.sh" ] || [ ! -f "${modulesdir}/check_root.sh" ] || [ ! -f "${modulesdir}/core_messages.sh" ]; then
  305. echo -e "[ FAIL ] Do NOT run this script as root!"
  306. exit 1
  307. else
  308. core_modules.sh
  309. check_root.sh
  310. fi
  311. fi
  312. # LinuxGSM installer mode.
  313. if [ "${shortname}" == "core" ]; then
  314. # Download the latest serverlist. This is the complete list of all supported servers.
  315. fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash"
  316. if [ ! -f "${serverlist}" ]; then
  317. echo -e "[ FAIL ] serverlist.csv could not be loaded."
  318. exit 1
  319. fi
  320. if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then
  321. {
  322. tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}'
  323. } | column -s $'\t' -t | more
  324. exit
  325. elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then
  326. tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
  327. fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
  328. userinput="${result}"
  329. fn_server_info
  330. if [ "${result}" == "${gameservername}" ]; then
  331. fn_install_file
  332. elif [ "${result}" == "" ]; then
  333. echo -e "Install canceled"
  334. else
  335. echo -e "[ FAIL ] menu result does not match gameservername"
  336. echo -e "result: ${result}"
  337. echo -e "gameservername: ${gameservername}"
  338. fi
  339. elif [ "${userinput}" ]; then
  340. fn_server_info
  341. if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then
  342. fn_install_file
  343. else
  344. echo -e "[ FAIL ] Unknown game server"
  345. fi
  346. else
  347. fn_install_getopt
  348. fi
  349. # LinuxGSM server mode.
  350. else
  351. core_modules.sh
  352. if [ "${shortname}" != "core-dep" ]; then
  353. # Load LinuxGSM configs.
  354. # These are required to get all the default variables for the specific server.
  355. # Load the default config. If missing download it. If changed reload it.
  356. if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
  357. mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
  358. fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nohash"
  359. fi
  360. if [ ! -f "${configdirserver}/_default.cfg" ]; then
  361. mkdir -p "${configdirserver}"
  362. echo -en "copying _default.cfg...\c"
  363. cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
  364. exitcode=$?
  365. if [ "${exitcode}" != 0 ]; then
  366. echo -e "FAIL"
  367. exit 1
  368. else
  369. echo -e "OK"
  370. fi
  371. else
  372. module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
  373. if [ "${module_file_diff}" != "" ]; then
  374. fn_print_warn_nl "_default.cfg has been altered. reloading config."
  375. echo -en "copying _default.cfg...\c"
  376. cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
  377. exitcode=$?
  378. if [ "${exitcode}" != 0 ]; then
  379. echo -e "FAIL"
  380. exit 1
  381. else
  382. echo -e "OK"
  383. fi
  384. fi
  385. fi
  386. # shellcheck source=/dev/null
  387. source "${configdirserver}/_default.cfg"
  388. # Load the common.cfg config. If missing download it.
  389. if [ ! -f "${configdirserver}/common.cfg" ]; then
  390. fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nohash"
  391. # shellcheck source=/dev/null
  392. source "${configdirserver}/common.cfg"
  393. else
  394. # shellcheck source=/dev/null
  395. source "${configdirserver}/common.cfg"
  396. fi
  397. # Load the secrets-common.cfg config. If missing download it.
  398. if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
  399. fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nohash"
  400. # shellcheck source=/dev/null
  401. source "${configdirserver}/secrets-common.cfg"
  402. else
  403. # shellcheck source=/dev/null
  404. source "${configdirserver}/secrets-common.cfg"
  405. fi
  406. # Load the instance.cfg config. If missing download it.
  407. if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
  408. fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nohash"
  409. # shellcheck source=/dev/null
  410. source "${configdirserver}/${selfname}.cfg"
  411. else
  412. # shellcheck source=/dev/null
  413. source "${configdirserver}/${selfname}.cfg"
  414. fi
  415. # Load the secrets-instance.cfg config. If missing download it.
  416. if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
  417. fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nohash"
  418. # shellcheck source=/dev/null
  419. source "${configdirserver}/secrets-${selfname}.cfg"
  420. else
  421. # shellcheck source=/dev/null
  422. source "${configdirserver}/secrets-${selfname}.cfg"
  423. fi
  424. # Load the linuxgsm.sh in to tmpdir. If missing download it.
  425. if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
  426. fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nohash"
  427. fi
  428. fi
  429. # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off.
  430. fn_ansi_loader
  431. # Prevents running of core_exit.sh for Travis-CI.
  432. if [ "${travistest}" != "1" ]; then
  433. getopt=$1
  434. core_getopt.sh
  435. fi
  436. fi
  437. fn_currentstatus_tmux() {
  438. check_status.sh
  439. if [ "${status}" != "0" ]; then
  440. currentstatus="STARTED"
  441. else
  442. currentstatus="STOPPED"
  443. fi
  444. }
  445. fn_setstatus() {
  446. fn_currentstatus_tmux
  447. echo""
  448. echo -e "Required status: ${requiredstatus}"
  449. counter=0
  450. echo -e "Current status: ${currentstatus}"
  451. while [ "${requiredstatus}" != "${currentstatus}" ]; do
  452. counter=$((counter + 1))
  453. fn_currentstatus_tmux
  454. echo -en "New status: ${currentstatus}\\r"
  455. if [ "${requiredstatus}" == "STARTED" ]; then
  456. (command_start.sh > /dev/null 2>&1)
  457. else
  458. (command_stop.sh > /dev/null 2>&1)
  459. fi
  460. if [ "${counter}" -gt "5" ]; then
  461. currentstatus="FAIL"
  462. echo -e "Current status: ${currentstatus}"
  463. echo -e ""
  464. echo -e "Unable to start or stop server."
  465. exit 1
  466. fi
  467. done
  468. echo -en "New status: ${currentstatus}\\r"
  469. echo -e "\n"
  470. echo -e "Test starting:"
  471. echo -e ""
  472. }
  473. # End of every test will expect the result to either pass or fail
  474. # If the script does not do as intended the whole test will fail
  475. # if expecting a pass
  476. fn_test_result_pass() {
  477. if [ $? != 0 ]; then
  478. echo -e "================================="
  479. echo -e "Expected result: PASS"
  480. echo -e "Actual result: FAIL"
  481. fn_print_fail_nl "TEST FAILED"
  482. exitcode=1
  483. core_exit.sh
  484. else
  485. echo -e "================================="
  486. echo -e "Expected result: PASS"
  487. echo -e "Actual result: PASS"
  488. fn_print_ok_nl "TEST PASSED"
  489. echo -e ""
  490. fi
  491. }
  492. # if expecting a fail
  493. fn_test_result_fail() {
  494. if [ $? == 0 ]; then
  495. echo -e "================================="
  496. echo -e "Expected result: FAIL"
  497. echo -e "Actual result: PASS"
  498. fn_print_fail_nl "TEST FAILED"
  499. exitcode=1
  500. core_exit.sh
  501. else
  502. echo -e "================================="
  503. echo -e "Expected result: FAIL"
  504. echo -e "Actual result: FAIL"
  505. fn_print_ok_nl "TEST PASSED"
  506. echo -e ""
  507. fi
  508. }
  509. # test result n/a
  510. fn_test_result_na() {
  511. echo -e "================================="
  512. echo -e "Expected result: N/A"
  513. echo -e "Actual result: N/A"
  514. fn_print_fail_nl "TEST N/A"
  515. }
  516. sleeptime="0"
  517. echo -e "================================="
  518. echo -e "Travis CI Tests"
  519. echo -e "Linux Game Server Manager"
  520. echo -e "by Daniel Gibbs"
  521. echo -e "Contributors: http://goo.gl/qLmitD"
  522. echo -e "https://linuxgsm.com"
  523. echo -e "================================="
  524. echo -e ""
  525. echo -e "================================="
  526. echo -e "Server Tests"
  527. echo -e "Using: ${gamename}"
  528. echo -e "Testing Branch: ${TRAVIS_BRANCH}"
  529. echo -e "================================="
  530. echo -e ""
  531. echo -e "Tests Summary"
  532. echo -e "================================="
  533. echo -e "0.0 - Pre-test Tasks"
  534. echo -e "0.1 - Create log dir's"
  535. echo -e "0.2 - Enable dev-debug"
  536. echo -e ""
  537. echo -e "1.0 - Pre-install tests"
  538. echo -e "1.1 - start - no files"
  539. echo -e "1.2 - getopt"
  540. echo -e "1.3 - getopt with incorrect args"
  541. echo -e ""
  542. echo -e "2.0 - Installation"
  543. echo -e "2.1 - install"
  544. echo -e ""
  545. echo -e "3.0 - Start/Stop/Restart Tests"
  546. echo -e "3.1 - start"
  547. echo -e "3.2 - start - online"
  548. echo -e "3.3 - start - updateonstart"
  549. echo -e "3.4 - stop"
  550. echo -e "3.5 - stop - offline"
  551. echo -e "3.6 - restart"
  552. echo -e "3.7 - restart - offline"
  553. echo -e ""
  554. echo -e "4.0 - Update Tests"
  555. echo -e "4.1 - update"
  556. echo -e "4.2 - update-lgsm"
  557. echo -e ""
  558. echo -e "5.0 - Monitor Tests"
  559. echo -e "5.1 - monitor - online"
  560. echo -e "5.2 - monitor - offline - with lockfile"
  561. echo -e "5.3 - monitor - offline - no lockfile"
  562. echo -e "5.4 - test-alert"
  563. echo -e ""
  564. echo -e "6.0 - Details Tests"
  565. echo -e "6.1 - details"
  566. echo -e "6.2 - postdetails"
  567. echo -e ""
  568. echo -e "7.0 - Backup Tests"
  569. echo -e "7.1 - backup"
  570. echo -e ""
  571. echo -e "8.0 - Development Tools Tests"
  572. echo -e "8.1 - dev - detect glibc"
  573. echo -e "8.2 - dev - detect ldd"
  574. echo -e "8.3 - dev - detect deps"
  575. echo -e "8.4 - dev - query-raw"
  576. echo -e ""
  577. echo -e "9.0 - Sponsor"
  578. echo -e "9.1 - sponsor"
  579. echo -e ""
  580. echo -e "0.0 - Pre-test Tasks"
  581. echo -e "=================================================================="
  582. echo -e "Description:"
  583. echo -e "Create log dir's"
  584. echo -e ""
  585. echo -e ""
  586. echo -e "0.1 - Create log dir's"
  587. echo -e "================================="
  588. echo -e ""
  589. (
  590. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  591. BASH_XTRACEFD="5"
  592. set -x
  593. install_logs.sh
  594. )
  595. echo -e "run order"
  596. echo -e "================="
  597. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  598. echo -e ""
  599. echo -e "0.2 - Enable dev-debug"
  600. echo -e "================================="
  601. echo -e "Description:"
  602. echo -e "Enable dev-debug"
  603. echo -e ""
  604. (
  605. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  606. BASH_XTRACEFD="5"
  607. set -x
  608. command_dev_debug.sh
  609. )
  610. fn_test_result_pass
  611. echo -e "run order"
  612. echo -e "================="
  613. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  614. echo -e ""
  615. echo -e "1.0 - Pre-install tests"
  616. echo -e "=================================================================="
  617. echo -e ""
  618. echo -e "1.1 - start - no files"
  619. echo -e "================================="
  620. echo -e "Description:"
  621. echo -e "test script reaction to missing server files."
  622. echo -e "Command: ./${gameservername} start"
  623. echo -e ""
  624. # Allows for testing not on Travis CI
  625. if [ -z "${TRAVIS}" ]; then
  626. (
  627. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  628. BASH_XTRACEFD="5"
  629. set -x
  630. command_start.sh
  631. )
  632. fn_test_result_fail
  633. else
  634. echo -e "Test bypassed"
  635. fi
  636. echo -e "run order"
  637. echo -e "================="
  638. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  639. echo -e ""
  640. echo -e "1.2 - getopt"
  641. echo -e "================================="
  642. echo -e "Description:"
  643. echo -e "displaying options messages."
  644. echo -e "Command: ./${gameservername}"
  645. echo -e ""
  646. (
  647. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  648. BASH_XTRACEFD="5"
  649. set -x
  650. core_getopt.sh
  651. )
  652. fn_test_result_pass
  653. echo -e "run order"
  654. echo -e "================="
  655. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  656. echo -e ""
  657. echo -e "1.3 - getopt with incorrect args"
  658. echo -e "================================="
  659. echo -e "Description:"
  660. echo -e "displaying options messages."
  661. echo -e "Command: ./${gameservername} abc123"
  662. echo -e ""
  663. getopt="abc123"
  664. (
  665. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  666. BASH_XTRACEFD="5"
  667. set -x
  668. core_getopt.sh
  669. )
  670. fn_test_result_pass
  671. echo -e "run order"
  672. echo -e "================="
  673. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  674. echo -e ""
  675. echo -e "2.0 - Installation"
  676. echo -e "=================================================================="
  677. echo -e ""
  678. echo -e "2.1 - install"
  679. echo -e "================================="
  680. echo -e "Description:"
  681. echo -e "install ${gamename} server."
  682. echo -e "Command: ./${gameservername} auto-install"
  683. (
  684. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  685. BASH_XTRACEFD="5"
  686. set -x
  687. fn_autoinstall
  688. )
  689. fn_test_result_pass
  690. echo -e "run order"
  691. echo -e "================="
  692. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  693. echo -e ""
  694. echo -e "3.0 - Start/Stop/Restart Tests"
  695. echo -e "=================================================================="
  696. echo -e ""
  697. echo -e "3.1 - start"
  698. echo -e "================================="
  699. echo -e "Description:"
  700. echo -e "start ${gamename} server."
  701. echo -e "Command: ./${gameservername} start"
  702. requiredstatus="STOPPED"
  703. fn_setstatus
  704. (
  705. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  706. BASH_XTRACEFD="5"
  707. set -x
  708. command_start.sh
  709. )
  710. fn_test_result_pass
  711. echo -e "run order"
  712. echo -e "================="
  713. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  714. echo -e ""
  715. echo -e "3.2 - start - online"
  716. echo -e "================================="
  717. echo -e "Description:"
  718. echo -e "start ${gamename} server while already running."
  719. echo -e "Command: ./${gameservername} start"
  720. requiredstatus="STARTED"
  721. fn_setstatus
  722. (
  723. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  724. BASH_XTRACEFD="5"
  725. set -x
  726. command_start.sh
  727. )
  728. fn_test_result_fail
  729. echo -e "run order"
  730. echo -e "================="
  731. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  732. echo -e ""
  733. echo -e "3.3 - start - updateonstart"
  734. echo -e "================================="
  735. echo -e "Description:"
  736. echo -e "will update server on start."
  737. echo -e "Command: ./${gameservername} start"
  738. requiredstatus="STOPPED"
  739. fn_setstatus
  740. (
  741. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  742. BASH_XTRACEFD="5"
  743. set -x
  744. updateonstart="on"
  745. command_start.sh
  746. )
  747. fn_test_result_pass
  748. echo -e "run order"
  749. echo -e "================="
  750. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  751. echo -e ""
  752. echo -e "3.4 - stop"
  753. echo -e "================================="
  754. echo -e "Description:"
  755. echo -e "stop ${gamename} server."
  756. echo -e "Command: ./${gameservername} stop"
  757. requiredstatus="STARTED"
  758. fn_setstatus
  759. (
  760. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  761. BASH_XTRACEFD="5"
  762. set -x
  763. command_stop.sh
  764. )
  765. fn_test_result_pass
  766. echo -e "run order"
  767. echo -e "================="
  768. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  769. echo -e ""
  770. echo -e "3.5 - stop - offline"
  771. echo -e "================================="
  772. echo -e "Description:"
  773. echo -e "stop ${gamename} server while already stopped."
  774. echo -e "Command: ./${gameservername} stop"
  775. requiredstatus="STOPPED"
  776. fn_setstatus
  777. (
  778. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  779. BASH_XTRACEFD="5"
  780. set -x
  781. command_stop.sh
  782. )
  783. fn_test_result_fail
  784. echo -e "run order"
  785. echo -e "================="
  786. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  787. echo -e ""
  788. echo -e "3.6 - restart"
  789. echo -e "================================="
  790. echo -e "Description:"
  791. echo -e "restart ${gamename}."
  792. echo -e "Command: ./${gameservername} restart"
  793. requiredstatus="STARTED"
  794. fn_setstatus
  795. (
  796. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  797. BASH_XTRACEFD="5"
  798. set -x
  799. command_restart.sh
  800. )
  801. fn_test_result_pass
  802. echo -e "run order"
  803. echo -e "================="
  804. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  805. echo -e ""
  806. echo -e "3.7 - restart - offline"
  807. echo -e "================================="
  808. echo -e "Description:"
  809. echo -e "restart ${gamename} while already stopped."
  810. echo -e "Command: ./${gameservername} restart"
  811. requiredstatus="STOPPED"
  812. fn_setstatus
  813. (
  814. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  815. BASH_XTRACEFD="5"
  816. set -x
  817. command_restart.sh
  818. )
  819. fn_test_result_pass
  820. echo -e "run order"
  821. echo -e "================="
  822. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  823. echo -e ""
  824. echo -e "4.0 - Update Tests"
  825. echo -e "=================================================================="
  826. echo -e ""
  827. echo -e "4.1 - update"
  828. echo -e "================================="
  829. echo -e "Description:"
  830. echo -e "check for updates."
  831. echo -e "Command: ./${gameservername} update"
  832. requiredstatus="STOPPED"
  833. fn_setstatus
  834. (
  835. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  836. BASH_XTRACEFD="5"
  837. set -x
  838. command_update.sh
  839. )
  840. fn_test_result_pass
  841. echo -e "run order"
  842. echo -e "================="
  843. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  844. echo -e ""
  845. echo -e "4.2 - update-lgsm"
  846. echo -e "================================="
  847. echo -e "Description:"
  848. echo -e "update LinuxGSM."
  849. echo -e ""
  850. echo -e "Command: ./jc2server update-lgam"
  851. requiredstatus="STARTED"
  852. fn_setstatus
  853. (
  854. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  855. BASH_XTRACEFD="5"
  856. set -x
  857. command_update_linuxgsm.sh
  858. )
  859. fn_test_result_pass
  860. echo -e "run order"
  861. echo -e "================="
  862. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  863. echo -e ""
  864. echo -e "5.0 - Monitor Tests"
  865. echo -e "=================================================================="
  866. echo -e ""
  867. info_game.sh
  868. echo -e "Server IP - Port: ${ip}:${port}"
  869. echo -e "Server IP - Query Port: ${ip}:${queryport}"
  870. echo -e ""
  871. echo -e "5.1 - monitor - online"
  872. echo -e "================================="
  873. echo -e "Description:"
  874. echo -e "run monitor server while already running."
  875. echo -e "Command: ./${gameservername} monitor"
  876. requiredstatus="STARTED"
  877. fn_setstatus
  878. (
  879. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  880. BASH_XTRACEFD="5"
  881. set -x
  882. command_monitor.sh
  883. )
  884. fn_test_result_pass
  885. echo -e "run order"
  886. echo -e "================="
  887. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  888. echo -e ""
  889. echo -e "5.2 - monitor - offline - with lockfile"
  890. echo -e "================================="
  891. echo -e "Description:"
  892. echo -e "run monitor while server is offline with lockfile."
  893. echo -e "Command: ./${gameservername} monitor"
  894. requiredstatus="STOPPED"
  895. fn_setstatus
  896. fn_print_info_nl "creating lockfile."
  897. date '+%s' > "${lockdir}/${selfname}.lock"
  898. echo "${version}" >> "${lockdir}/${selfname}.lock"
  899. echo "${port}" >> "${lockdir}/${selfname}.lock"
  900. (
  901. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  902. BASH_XTRACEFD="5"
  903. set -x
  904. command_monitor.sh
  905. )
  906. fn_test_result_pass
  907. echo -e "run order"
  908. echo -e "================="
  909. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  910. echo -e ""
  911. echo -e "5.3 - monitor - offline - no lockfile"
  912. echo -e "================================="
  913. echo -e "Description:"
  914. echo -e "run monitor while server is offline with no lockfile."
  915. echo -e "Command: ./${gameservername} monitor"
  916. requiredstatus="STOPPED"
  917. fn_setstatus
  918. (
  919. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  920. BASH_XTRACEFD="5"
  921. set -x
  922. command_monitor.sh
  923. )
  924. fn_test_result_fail
  925. echo -e "run order"
  926. echo -e "================="
  927. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  928. echo -e ""
  929. echo -e "5.4 - test-alert"
  930. echo -e "================================="
  931. echo -e "Description:"
  932. echo -e "run monitor while server is offline with no lockfile."
  933. echo -e "Command: ./${gameservername} test-alert"
  934. requiredstatus="STOPPED"
  935. fn_setstatus
  936. (
  937. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  938. BASH_XTRACEFD="5"
  939. set -x
  940. command_test_alert.sh
  941. )
  942. fn_test_result_fail
  943. echo -e "run order"
  944. echo -e "================="
  945. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  946. echo -e ""
  947. echo -e "6.0 - Details Tests"
  948. echo -e "=================================================================="
  949. echo -e ""
  950. echo -e "6.1 - details"
  951. echo -e "================================="
  952. echo -e "Description:"
  953. echo -e "display details."
  954. echo -e "Command: ./${gameservername} details"
  955. requiredstatus="STARTED"
  956. fn_setstatus
  957. (
  958. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  959. BASH_XTRACEFD="5"
  960. set -x
  961. command_details.sh
  962. )
  963. fn_test_result_pass
  964. echo -e "run order"
  965. echo -e "================="
  966. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  967. echo -e ""
  968. echo -e "6.2 - postdetails"
  969. echo -e "================================="
  970. echo -e "Description:"
  971. echo -e "post details."
  972. echo -e "Command: ./${gameservername} postdetails"
  973. requiredstatus="STARTED"
  974. fn_setstatus
  975. (
  976. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  977. BASH_XTRACEFD="5"
  978. set -x
  979. command_postdetails.sh
  980. )
  981. fn_test_result_pass
  982. echo -e "run order"
  983. echo -e "================="
  984. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  985. echo -e ""
  986. echo -e "7.0 - Backup Tests"
  987. echo -e "=================================================================="
  988. echo -e ""
  989. echo -e "7.1 - backup"
  990. echo -e "================================="
  991. echo -e "Description:"
  992. echo -e "run a backup."
  993. echo -e "Command: ./${gameservername} backup"
  994. requiredstatus="STARTED"
  995. fn_setstatus
  996. echo -e "test de-activated until issue #1839 fixed"
  997. #(command_backup.sh)
  998. fn_test_result_pass
  999. echo -e "run order"
  1000. echo -e "================="
  1001. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  1002. echo -e ""
  1003. echo -e "8.0 - Development Tools Tests"
  1004. echo -e "=================================================================="
  1005. echo -e ""
  1006. echo -e "8.1 - dev - detect glibc"
  1007. echo -e "================================="
  1008. echo -e "Description:"
  1009. echo -e "detect glibc."
  1010. echo -e "Command: ./${gameservername} detect-glibc"
  1011. requiredstatus="STARTED"
  1012. fn_setstatus
  1013. (
  1014. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  1015. BASH_XTRACEFD="5"
  1016. set -x
  1017. command_dev_detect_glibc.sh
  1018. )
  1019. fn_test_result_pass
  1020. echo -e "run order"
  1021. echo -e "================="
  1022. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  1023. echo -e ""
  1024. echo -e "8.2 - dev - detect ldd"
  1025. echo -e "================================="
  1026. echo -e "Description:"
  1027. echo -e "detect ldd."
  1028. echo -e "Command: ./${gameservername} detect-ldd"
  1029. requiredstatus="STARTED"
  1030. fn_setstatus
  1031. (
  1032. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  1033. BASH_XTRACEFD="5"
  1034. set -x
  1035. command_dev_detect_ldd.sh
  1036. )
  1037. fn_test_result_pass
  1038. echo -e "run order"
  1039. echo -e "================="
  1040. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  1041. echo -e ""
  1042. echo -e "8.3 - dev - detect deps"
  1043. echo -e "================================="
  1044. echo -e "Description:"
  1045. echo -e "detect dependencies."
  1046. echo -e "Command: ./${gameservername} detect-deps"
  1047. requiredstatus="STARTED"
  1048. fn_setstatus
  1049. (
  1050. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  1051. BASH_XTRACEFD="5"
  1052. set -x
  1053. command_dev_detect_deps.sh
  1054. )
  1055. fn_test_result_pass
  1056. echo -e "run order"
  1057. echo -e "================="
  1058. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  1059. echo -e ""
  1060. echo -e "8.4 - dev - query-raw"
  1061. echo -e "================================="
  1062. echo -e "Description:"
  1063. echo -e "raw query output."
  1064. echo -e "Command: ./${gameservername} query-raw"
  1065. requiredstatus="STARTED"
  1066. fn_setstatus
  1067. (
  1068. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  1069. BASH_XTRACEFD="5"
  1070. set -x
  1071. command_dev_query_raw.sh
  1072. )
  1073. fn_test_result_na
  1074. echo -e "run order"
  1075. echo -e "================="
  1076. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  1077. echo -e ""
  1078. echo -e "9.0 - Sponsor"
  1079. echo -e "=================================================================="
  1080. echo -e ""
  1081. echo -e "9.1 - sponsor"
  1082. echo -e "================================="
  1083. echo -e "Description:"
  1084. echo -e "sponsor."
  1085. echo -e "Command: ./${gameservername} sponsor"
  1086. requiredstatus="STARTED"
  1087. fn_setstatus
  1088. (
  1089. exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
  1090. BASH_XTRACEFD="5"
  1091. set -x
  1092. command_sponsor.sh
  1093. )
  1094. fn_test_result_pass
  1095. echo -e "run order"
  1096. echo -e "================="
  1097. grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g'
  1098. echo -e ""
  1099. echo -e "================================="
  1100. echo -e "Server Tests - Complete!"
  1101. echo -e "Using: ${gamename}"
  1102. echo -e "================================="
  1103. requiredstatus="STOPPED"
  1104. fn_setstatus
  1105. core_exit.sh