Procházet zdrojové kódy

added feature to jc2server

Daniel Gibbs před 8 roky
rodič
revize
32c5289269
1 změnil soubory, kde provedl 266 přidání a 52 odebrání
  1. 266 52
      tests/tests_jc2server.sh

+ 266 - 52
tests/tests_jc2server.sh

@@ -475,8 +475,15 @@ echo "================================="
 echo "Description:"
 echo "Create log dir's"
 echo ""
-(install_logs.sh)
-
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	install_logs.sh
+)
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo "0.2 - Enable dev-debug"
 echo "================================="
@@ -487,21 +494,14 @@ echo ""
 	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
 	BASH_XTRACEFD="5"
 	set -x
-	command_dev_debug.sh)
+	command_dev_debug.sh
+)
 fn_test_result_pass
-pwd
-echo "######travis build path"
-echo "${TRAVIS_BUILD_DIR}"
-echo "####### touch & date > /home/travis/build/GameServerManagers/LinuxGSM/tests/.dev-debug"
-touch /home/travis/build/GameServerManagers/LinuxGSM/tests/.dev-debug
-date > /home/travis/build/GameServerManagers/LinuxGSM/tests/.dev-debug
-
-echo "########## ${rootdir}/.dev-debug"
-grep "functionfile=" "${TRAVIS_BUILD_DIR}/dev-debug.log"
-echo "################## tree"
-tree
-echo "################## pwd"
-pwd
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
+
+echo ""
 echo "1.0 - start - no files"
 echo "================================="
 echo "Description:"
@@ -512,9 +512,12 @@ echo ""
 	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
 	BASH_XTRACEFD="5"
 	set -x
-	command_start.sh)
+	command_start.sh
+)
 fn_test_result_fail
-grep "functionfile=" "${TRAVIS_BUILD_DIR}/dev-debug.log"
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "1.1 - getopt"
@@ -527,10 +530,13 @@ echo ""
 	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
 	BASH_XTRACEFD="5"
 	set -x
-	core_getopt.sh)
+	core_getopt.sh
+)
 fn_test_result_pass
-cat "${TRAVIS_BUILD_DIR}/dev-debug.log"
-grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
+
 echo ""
 echo "1.2 - getopt with incorrect args"
 echo "================================="
@@ -539,9 +545,16 @@ echo "displaying options messages."
 echo "Command: ./jc2server abc123"
 echo ""
 getopt="abc123"
-(core_getopt.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	core_getopt.sh
+)
 fn_test_result_fail
-grep "functionfile=" "${TRAVIS_BUILD_DIR}/dev-debug.log"
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "2.0 - install"
@@ -549,9 +562,16 @@ echo "================================="
 echo "Description:"
 echo "install ${gamename} server."
 echo "Command: ./jc2server auto-install"
-(fn_autoinstall)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	fn_autoinstall
+)
 fn_test_result_pass
-grep "functionfile=" "${TRAVIS_BUILD_DIR}/dev-debug.log"
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "3.1 - start"
@@ -561,11 +581,17 @@ echo "start ${gamename} server."
 echo "Command: ./jc2server start"
 requiredstatus="OFFLINE"
 fn_setstatus
-(command_start.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_start.sh
+)
 fn_test_result_pass
-grep "functionfile=" "${TRAVIS_BUILD_DIR}/dev-debug.log"
-echo "############## tree"
-tree
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
+
 echo ""
 echo "3.2 - start - online"
 echo "================================="
@@ -574,8 +600,16 @@ echo "start ${gamename} server while already running."
 echo "Command: ./jc2server start"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_start.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_start.sh
+)
 fn_test_result_fail
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "3.3 - start - updateonstart"
@@ -585,8 +619,16 @@ echo "will update server on start."
 echo "Command: ./jc2server start"
 requiredstatus="OFFLINE"
 fn_setstatus
-(updateonstart="on";command_start.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	updateonstart="on";command_start.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "3.4 - stop"
@@ -596,8 +638,16 @@ echo "stop ${gamename} server."
 echo "Command: ./jc2server stop"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_stop.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_stop.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "3.5 - stop - offline"
@@ -607,8 +657,16 @@ echo "stop ${gamename} server while already stopped."
 echo "Command: ./jc2server stop"
 requiredstatus="OFFLINE"
 fn_setstatus
-(command_stop.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_stop.sh
+)
 fn_test_result_fail
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "3.6 - restart"
@@ -618,8 +676,16 @@ echo "restart ${gamename}."
 echo "Command: ./jc2server restart"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_restart.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_restart.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "3.7 - restart - offline"
@@ -629,8 +695,16 @@ echo "restart ${gamename} while already stopped."
 echo "Command: ./jc2server restart"
 requiredstatus="OFFLINE"
 fn_setstatus
-(command_restart.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_restart.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo "4.1 - update"
 echo "================================="
@@ -639,8 +713,16 @@ echo "check for updates."
 echo "Command: ./jc2server update"
 requiredstatus="OFFLINE"
 fn_setstatus
-(command_update.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_update.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "4.2 - update  - change buildid"
@@ -652,8 +734,16 @@ requiredstatus="OFFLINE"
 fn_setstatus
 fn_print_info_nl "changed buildid to 0."
 sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf"
-(command_update.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_update.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "4.3 - update  - change buildid - online"
@@ -665,8 +755,16 @@ requiredstatus="ONLINE"
 fn_setstatus
 fn_print_info_nl "changed buildid to 0."
 sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf"
-(command_update.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_update.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "4.4 - update  - remove appmanifest file"
@@ -678,8 +776,16 @@ requiredstatus="OFFLINE"
 fn_setstatus
 fn_print_info_nl "removed appmanifest_${appid}.acf."
 rm --verbose "${serverfiles}/steamapps/appmanifest_${appid}.acf"
-(command_update.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_update.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "4.5 - force-update"
@@ -689,8 +795,16 @@ echo "force-update bypassing update check."
 echo "Command: ./jc2server force-update"
 requiredstatus="OFFLINE"
 fn_setstatus
-(forceupdate=1;command_update.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	forceupdate=1;command_update.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "4.6 - force-update - online"
@@ -700,8 +814,16 @@ echo "force-update bypassing update check server while already running."
 echo "Command: ./jc2server force-update"
 requiredstatus="ONLINE"
 fn_setstatus
-(forceupdate=1;command_update.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	forceupdate=1;command_update.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "4.7 - validate"
@@ -711,8 +833,16 @@ echo "validate server files."
 echo "Command: ./jc2server validate"
 requiredstatus="OFFLINE"
 fn_setstatus
-(command_validate.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_validate.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "4.8 - validate - online"
@@ -723,8 +853,16 @@ echo ""
 echo "Command: ./jc2server validate"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_validate.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_validate.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "Inserting IP address"
@@ -744,8 +882,16 @@ echo "run monitor server while already running."
 echo "Command: ./jc2server monitor"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_monitor.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_monitor.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "5.2 - monitor - offline - with lockfile"
@@ -757,8 +903,16 @@ requiredstatus="OFFLINE"
 fn_setstatus
 fn_print_info_nl "creating lockfile."
 date > "${rootdir}/${lockselfname}"
-(command_monitor.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_monitor.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "5.3 - monitor - offline - no lockfile"
@@ -768,8 +922,16 @@ echo "run monitor while server is offline with no lockfile."
 echo "Command: ./jc2server monitor"
 requiredstatus="OFFLINE"
 fn_setstatus
-(command_monitor.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_monitor.sh
+)
 fn_test_result_fail
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "5.4 - monitor - gsquery.py failure"
@@ -781,8 +943,17 @@ requiredstatus="ONLINE"
 fn_setstatus
 cp "${servercfgfullpath}" "config.lua"
 sed -i 's/[0-9]\+/0/' "${servercfgfullpath}"
-(command_monitor.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_monitor.sh
+)
 fn_test_result_fail
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
+
 echo ""
 fn_print_info_nl "Re-generating ${servercfg}."
 cp -v "config.lua" "${servercfgfullpath}"
@@ -796,8 +967,16 @@ echo "display details."
 echo "Command: ./jc2server details"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_details.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_details.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "6.1 - post details"
@@ -807,8 +986,16 @@ echo "post details."
 echo "Command: ./jc2server postdetails"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_postdetails.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_postdetails.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "7.0 - backup"
@@ -821,6 +1008,9 @@ fn_setstatus
 echo "test de-activated until issue #1839 fixed"
 #(command_backup.sh)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "8.0 - dev - detect glibc"
@@ -830,8 +1020,16 @@ echo "detect glibc."
 echo "Command: ./jc2server detect-glibc"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_dev_detect_glibc.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_dev_detect_glibc.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "8.1 - dev - detect ldd"
@@ -841,8 +1039,16 @@ echo "detect ldd."
 echo "Command: ./jc2server detect-ldd"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_dev_detect_ldd.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_dev_detect_ldd.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "8.2 - dev - detect deps"
@@ -852,8 +1058,16 @@ echo "detect dependencies."
 echo "Command: ./jc2server detect-deps"
 requiredstatus="ONLINE"
 fn_setstatus
-(command_dev_detect_deps.sh)
+(
+	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
+	BASH_XTRACEFD="5"
+	set -x
+	command_dev_detect_deps.sh
+)
 fn_test_result_pass
+echo "run order"
+echo "================="
+grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"|  sed 's/functionfile=//g'
 
 echo ""
 echo "================================="