tests_jc2server.sh 32 KB

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