tests_jc2server.sh 32 KB

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