tests_jc2server.sh 34 KB

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