From ddf9b26de8d25d0b7c4f545050036274126ccae3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 31 Oct 2015 12:19:16 +0000 Subject: [PATCH] New test script --- .travis.yml | 158 +--------------------------------------------------- test.sh | 66 ++++++++++++++++++---- 2 files changed, 57 insertions(+), 167 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95a170f9d..85148ae4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,162 +20,6 @@ addons: - telnet - expect - - - mkdir /home/travis/build/dgibbs64/linuxgsm/7DaysToDie/serverfiles - - touch /home/travis/build/dgibbs64/linuxgsm/7DaysToDie/serverfiles/serverconfig.xml - - - mkdir /home/travis/build/dgibbs64/linuxgsm/CounterStrike/serverfiles/ - - mkdir /home/travis/build/dgibbs64/linuxgsm/CounterStrike/serverfiles/cstrike - - - mkdir /home/travis/build/dgibbs64/linuxgsm/CounterStrikeGlobalOffensive/serverfiles/ - - mkdir /home/travis/build/dgibbs64/linuxgsm/CounterStrikeGlobalOffensive/serverfiles/csgo - - mkdir /home/travis/build/dgibbs64/linuxgsm/CounterStrikeGlobalOffensive/serverfiles/csgo/cfg - - - mkdir /home/travis/build/dgibbs64/linuxgsm/JustCause2/serverfiles/ - - touch /home/travis/build/dgibbs64/linuxgsm/JustCause2/serverfiles/default_config.lua - - - mkdir /home/travis/build/dgibbs64/linuxgsm/KillingFloor/serverfiles - - mkdir /home/travis/build/dgibbs64/linuxgsm/KillingFloor/serverfiles/System - - touch /home/travis/build/dgibbs64/linuxgsm/KillingFloor/serverfiles/System/Default.ini - - - mkdir /home/travis/build/dgibbs64/linuxgsm/ProjectZomboid/Zomboid - - mkdir /home/travis/build/dgibbs64/linuxgsm/ProjectZomboid/Zomboid/Server - - mkdir /home/travis/build/dgibbs64/linuxgsm/ProjectZomboid/serverfiles - - mkdir /home/travis/build/dgibbs64/linuxgsm/ProjectZomboid/serverfiles/projectzomboid - - - mkdir /home/travis/build/dgibbs64/linuxgsm/SeriousSam3BFE/serverfiles - - mkdir /home/travis/build/dgibbs64/linuxgsm/SeriousSam3BFE/serverfiles/Content/ - - mkdir /home/travis/build/dgibbs64/linuxgsm/SeriousSam3BFE/serverfiles/Content/SeriousSam3 - - mkdir /home/travis/build/dgibbs64/linuxgsm/SeriousSam3BFE/serverfiles/Content/SeriousSam3/Config - - mkdir /home/travis/build/dgibbs64/linuxgsm/SeriousSam3BFE/serverfiles/Bin - - - mkdir /home/travis/build/dgibbs64/linuxgsm/UnrealTournament2004/serverfiles - - mkdir /home/travis/build/dgibbs64/linuxgsm/UnrealTournament2004/serverfiles/System - - touch /home/travis/build/dgibbs64/linuxgsm/UnrealTournament2004/serverfiles/System/ut2k4-server.ini - - - mkdir /home/travis/build/dgibbs64/linuxgsm/UnrealTournament99/serverfiles - - mkdir /home/travis/build/dgibbs64/linuxgsm/UnrealTournament99/serverfiles/System - - touch /home/travis/build/dgibbs64/linuxgsm/UnrealTournament99/serverfiles/System/ut99-server.ini - - mkdir /home/travis/build/dgibbs64/linuxgsm/TeamSpeak3/serverfiles script: - - bash 7DaysToDie/sdtdserver auto-install - - bash 7DaysToDie/sdtdserver start - - bash 7DaysToDie/sdtdserver stop - - bash 7DaysToDie/sdtdserver restart - - bash 7DaysToDie/sdtdserver validate - - bash 7DaysToDie/sdtdserver monitor - - bash 7DaysToDie/sdtdserver email-test - - bash 7DaysToDie/sdtdserver details - - - bash Arma3/arma3server auto-install - - bash Arma3/arma3server start - - bash Arma3/arma3server stop - - bash Arma3/arma3server restart - - bash Arma3/arma3server validate - - bash Arma3/arma3server monitor - - bash Arma3/arma3server email-test - - bash Arma3/arma3server details - - - bash CounterStrike/csserver auto-install - - bash CounterStrike/csserver start - - bash CounterStrike/csserver stop - - bash CounterStrike/csserver restart - - bash CounterStrike/csserver validate - - bash CounterStrike/csserver monitor - - bash CounterStrike/csserver email-test - - bash CounterStrike/csserver details - - - bash CounterStrikeGlobalOffensive/csgoserver auto-install - - bash CounterStrikeGlobalOffensive/csgoserver start - - bash CounterStrikeGlobalOffensive/csgoserver stop - - bash CounterStrikeGlobalOffensive/csgoserver restart - - bash CounterStrikeGlobalOffensive/csgoserver validate - - bash CounterStrikeGlobalOffensive/csgoserver monitor - - bash CounterStrikeGlobalOffensive/csgoserver email-test - - bash CounterStrikeGlobalOffensive/csgoserver details - - - bash JustCause2/jc2server auto-install - - bash JustCause2/jc2server start - - bash JustCause2/jc2server stop - - bash JustCause2/jc2server restart - - bash JustCause2/jc2server validate - - bash JustCause2/jc2server monitor - - bash JustCause2/jc2server email-test - - bash JustCause2/jc2server details - - - bash KillingFloor/kfserver auto-install - - bash KillingFloor/kfserver start - - bash KillingFloor/kfserver stop - - bash KillingFloor/kfserver restart - - bash KillingFloor/kfserver validate - - bash KillingFloor/kfserver monitor - - bash KillingFloor/kfserver email-test - - bash KillingFloor/kfserver details - - - bash NaturalSelection2/ns2server auto-install - - bash NaturalSelection2/ns2server start - - bash NaturalSelection2/ns2server stop - - bash NaturalSelection2/ns2server restart - - bash NaturalSelection2/ns2server validate - - bash NaturalSelection2/ns2server monitor - - bash NaturalSelection2/ns2server email-test - - bash NaturalSelection2/ns2server details - - - bash ProjectZomboid/pzserver auto-install - - bash ProjectZomboid/pzserver start - - bash ProjectZomboid/pzserver stop - - bash ProjectZomboid/pzserver restart - - bash ProjectZomboid/pzserver validate - - bash ProjectZomboid/pzserver monitor - - bash ProjectZomboid/pzserver email-test - - bash ProjectZomboid/pzserver details - - - bash SeriousSam3BFE/ss3sserver auto-install - - bash SeriousSam3BFE/ss3sserver start - - bash SeriousSam3BFE/ss3sserver stop - - bash SeriousSam3BFE/ss3sserver restart - - bash SeriousSam3BFE/ss3sserver validate - - bash SeriousSam3BFE/ss3sserver monitor - - bash SeriousSam3BFE/ss3sserver email-test - - bash SeriousSam3BFE/ss3sserver details - - - bash StarBound/sbserver auto-install - - bash StarBound/sbserver start - - bash StarBound/sbserver stop - - bash StarBound/sbserver restart - - bash StarBound/sbserver validate - - bash StarBound/sbserver monitor - - bash StarBound/sbserver email-test - - bash StarBound/sbserver details - - - bash Terraria/terrariaserver auto-install - - bash Terraria/terrariaserver start - - bash Terraria/terrariaserver stop - - bash Terraria/terrariaserver restart - - bash Terraria/terrariaserver validate - - bash Terraria/terrariaserver monitor - - bash Terraria/terrariaserver email-test - - bash Terraria/terrariaserver details - - - bash UnrealTournament2004/ut2k4server start - - bash UnrealTournament2004/ut2k4server stop - - bash UnrealTournament2004/ut2k4server restart - - bash UnrealTournament2004/ut2k4server monitor - - bash UnrealTournament2004/ut2k4server email-test - - bash UnrealTournament2004/ut2k4server details - - - bash UnrealTournament99/ut99server start - - bash UnrealTournament99/ut99server stop - - bash UnrealTournament99/ut99server restart - - bash UnrealTournament99/ut99server monitor - - bash UnrealTournament99/ut99server email-test - - bash UnrealTournament99/ut99server details - - - bash TeamSpeak3/ts3server start - - bash TeamSpeak3/ts3server stop - - bash TeamSpeak3/ts3server restart - - bash TeamSpeak3/ts3server update - - bash TeamSpeak3/ts3server monitor - - bash TeamSpeak3/ts3server email-test - - bash TeamSpeak3/ts3server details + - bash test.sh \ No newline at end of file diff --git a/test.sh b/test.sh index f2e6cc30c..ce8efa06e 100644 --- a/test.sh +++ b/test.sh @@ -9,8 +9,8 @@ version="150715" # Notification Email # (on|off) -emailnotification="off" -email="email@example.com" +emailnotification="on" +email="me@danielgibbs.co.uk" # Steam login steamuser="anonymous" @@ -103,14 +103,24 @@ fn_setstatus(){ echo"" echo "Required status: ${requiredstatus}" + counter=0 while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter+1)) fn_currentstatus + echo -ne "Current status: ${currentstatus}\\r" if [ "${requiredstatus}" == "ONLINE" ]; then (fn_start > /dev/null 2>&1) else (fn_stop > /dev/null 2>&1) fi + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo "Current status: ${currentstatus}" + echo "" + echo "Unable to start or stop server." + exit + fi done echo -ne "Current status: ${currentstatus}\\r" echo -e "\n" @@ -119,6 +129,16 @@ fn_setstatus(){ sleep 0.5 } +echo "=================================" +echo "TravisCI Tests" +echo "Linux Game Server Manager" +echo "by Daniel Gibbs" +echo "http://gameservermanagers.com" +echo "=================================" +echo "" + + + echo "1.0 - start - no files" echo "=================================" echo "Description:" @@ -130,6 +150,9 @@ echo "" echo "Test complete!" sleep 1 echo "" + + + echo "2.0 - install" echo "=================================" echo "Description:" @@ -141,6 +164,9 @@ echo "" echo "Test complete!" sleep 1 echo "" + + + echo "3.1 - start" echo "=================================" echo "Description:" @@ -208,6 +234,8 @@ echo "Test complete!" sleep 1 echo "" + + echo "4.1 - update" echo "=================================" echo "Description:" @@ -302,6 +330,9 @@ echo "" echo "Test complete!" sleep 1 echo "" + + + echo "5.1 - monitor - online" echo "=================================" echo "Description:" @@ -316,7 +347,7 @@ echo "" echo "5.2 - monitor - offline - no lockfile" echo "=================================" echo "Description:" -echo "run monitor while server is offline with no lockfile" +echo "run monitor while server is offline with no lockfile." requiredstatus="OFFLINE" fn_setstatus (fn_monitor) @@ -324,10 +355,10 @@ echo "" echo "Test complete!" sleep 1 echo "" -echo "5.2 - monitor - offline - with lockfile" +echo "5.3 - monitor - offline - with lockfile" echo "=================================" echo "Description:" -echo "run monitor while server is offline with no lockfile" +echo "run monitor while server is offline with no lockfile." requiredstatus="OFFLINE" fn_setstatus fn_printinfonl "creating lockfile." @@ -337,17 +368,32 @@ echo "" echo "Test complete!" sleep 1 echo "" -echo "5.2 - monitor - gsquery.py failure" +echo "5.4 - monitor - gsquery.py failure" echo "=================================" echo "Description:" -echo "gsquery.py will fail to query port" +echo "gsquery.py will fail to query port." requiredstatus="ONLINE" fn_setstatus -port=${port+1} -(fn_monitor) -port=${port-1} +sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" +fn_monitor +echo "" +fn_printinfonl "Reseting ${servercfg}." +fn_install_config echo "" echo "Test complete!" sleep 1 echo "" + + +echo "6.0 - details" +echo "=================================" +echo "Description:" +echo "gsquery.py will fail to query port." +requiredstatus="ONLINE" +fn_setstatus +fn_details +echo "" +echo "Test complete!" +sleep 1 +echo "" \ No newline at end of file